Kevin Powell - Community


Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.







newbie to backend ..need help with concepts

sending access and refresh token to client will help with auth but when the page is reloaded again , will the server again send the access token to the client again? this resets both the token s expiry time?

Consistent Hashing

What's the best way to implement consistent hashing in a database that doesn't have this feature by default, in my setup I have a bunch of nodes in a zookeeper path and when I retrieve all the nodes i hash a key and decide which node to place a user own, should my consistent hashing algorithm exist in my application code? And how I go about remapping the keys in the db

.Net 8 Database Interfaces

I'm working on my budget app and have come to the point where I need to use a database (SQLite specifically). I'm debating between using Microsoft.Data.Sqlite or just biting the bullet and using Entity Framework Core. The database tables are not very complex so the SQL statements won't be that verbose, but most places (from my research) use EFCore. But I don't like/understand EFCore (maybe some correlation/causation there :p). Thoughts?...
No description

Node.js memory leak error

I have this ts code that give me memory leak error every time: ``` type Conns = { name: string, platform: string,...
No description

What's the difference between a schema and model in mongoose?

I'm new to databases, and really to server side logic in general. I don't exactly understand the difference between schemas and models in mongoose, despite the fact i've read numerous explanations. Maybe someone here can explain it in a way that clicks with me. Thanks

Query MongoDB documents for a particular date range

Hi devs, I am trying to query documents based on particular date range. So I need all the documents where the createdDate is less than equal to current date and greater than equal to currentDate - 2. I am assuming that there is some issue in the date format between how mongo db stores and how I am trying to fire that in the query. Attached the screenshot. Can someone help...
No description

help with back end post request

Good morning, does anyone how to submit a post correct to the sever on a reactjs local host? I already doesn't express.js file to create a server and the message in the response tab Proxy error: Could not proxy request /api/submit from localhost: 3001 to http:// localhost:3003...

Java NIO

I've been learning about network programming and tho I understand thread per connection so easily I'm having trouble with java selector and register event loop way in NIO, particular reading when I key file descriptor that is ready to read do I just read till I get my protocol termination line e.g. /r/n/r/n in http, but I'm reading it might not always be available how do you read then pause and come back for a post request for example that has a large binary after the request how is this achieve...

Send API request with IP that user provided

i want to send a request to an API and i dont want the api backend recognise the sender ip , i want it to think im using the IP that i provided.

Making my first full stack website, and I want an authentification system

So I wanna make my first big fullstack project, and between the backend functionalities, I need an authentification system, the thing is that making it all by hand is extremely long and prone to being extremely not secure. I want my first project to have a good level of security. Is it okay to use a library like NextAuth or Firebase Auth for it? Will I still be learning or will it do everything for me? Cuz I want to learn from my fullstack project to some extent, and if these auth services do everything for you in one click isn't that counterproductive? People online do say that it's very recommended to use services because they were built by pros that know how to make them secure and flexible, and in the future I plan on using them again, but how will that look like in the eyes of companies that might hire me or if I want to freelance?...

Php and node.js

can i work in front-end with reactJs and in the back-end with php and can link between the two ?

Php Json how to get property?

I have a json file. I would like to get "Zangya" (which is in "animeName") ```php $datas = file_get_contents('getCharacters.json'); $datas = json_decode($datas);...

MAX height

```sql SELECT first_name, last_name, height...

Multi-provider authentication on Firestore

I'm working on an MV3 Chrome extension on a feature that requires authentication with a third party provider Considering that I'm not proficient in backend, I was wondering what's the right way to handle multi-provider authentication, i.e. letting the user to login with both Google and Facebook FYI, I chose Firebase for several reasons: 1. It has a great integration with extensions such that when I put a listener for a collection on Firestore in the background script, it prevents it from getting terminated 2. Firebase is quite beginner friendly...


Here, I am trying to post to the user database. I am using the saveUser API on the registration page. I have also provided images of the server and error. I have been stuck here for the past few hours. Can anyone tell me what the issue might be?
No description

How do you edit a website that's already deployed on a cloud service provider?

How do you make small changes to your website if its hosted on aws elastic beanstalk for example

Cookie from backend not getting set in frontend

Hi devs, I am trying to set the jwt token as the cookie from backend but I am not seeing that getting set in the Applications tab in the browser. Too much to ask maybe, but if someone is available can we connect. I can walkthrough the code whatever I am trying to do. I am just stuck and not able to proceed with my project....
No description

Handling POST request in Express.js

Hello, So I have this form that sends an email to a waitlist database, both the form sending form "fetch" and the express view that handles the request works perfectly fine in these two situations: - Through my local development environment - and through postman, which sends the request to the live website both works as expected, but when I submit a form through the live website and try to send it, I get a 404 error in the console and a "Cannot Post" error in the network tab....

Allow logins from multiple providers

I'm working on an MV3 Chrome extension and in the past several months I've been working on addin a paid feature that requires logging in to the extension Considering that I'm not proficient in backend, I chose Firebase and Firestore My goal is to allow the user to authenticate with both Google and Facebook So far I successfully managed to let the user login with Google and I save his UID in Firestore, but I realized that if his account gets deleted due to , he should at least be able to authenticate with Facebook After he logs in with Google, he has to start a monthly PayPal subscription to use the feature, and so I pass the UID to the webhook and I update that Firestore entry...