Kevin Powell - Community

KPC

Kevin Powell - Community

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

Join

front-end

resources

back-end

ui-ux

os-and-tools

I cannot see the cookies using fetch in react but I can see the cookies in thunderclient

```jsx <Button onClick={async () => { console.log("log bth clk"); const response = await fetch("http://localhost:3000/login", {...
No description

not seeing any errors yet the code isn't working with login and register

it seems my login and register pages are error-ed and the database isn't getting the data but im not seeing errors. Any ideas?

NameCheap domian block

hey guys someone can help me, my domian was block and i dont know how to fix
No description

How to generate first frame of video as image?

Hello. I'm working on social network app with Next.js and MongoDB. Users should be able to post images and videos as content (btw all posts in DB have content field which is array of links to that content, which is either image or video). I'm facing an issue when trying to display posts to the user. I have a <PostCard /> component which renders first element of content as "thumbnail" and problem occurs when first element is video, which obviously can't be rendered as image. So I was thinking, if first element is video, it should somehow take first frame of that video and use it as thumbnail. But it would probably be bad to render it every time user visits the page, so I was thinking of generating it once when user creates a post, and save it as something like poster as separate field in DB. But I have no idea how to do that lol. Any suggestions/advices/opinions?...
No description

npm json-server

Hello guys, currently i am using fake api of npm json-server. How can i create a custom endpoint because in my db.json i have nested object array and i want to have an endpoint to the child array of my db.json because i only have endpoint to the parent object array I'm Noob, correct me if i use wrong term ```...

Micro Service Load Balancer

Been working on building micro services and I understand how scaling is aided through load balancers, the question is how can load balancers themselves be scaled, let's say a billion users for example they can't all go through same load balancer, so where can load balancers be scaled for users to connect to different load balancers per say, is that doable, or is the solution just a bigger load balancer

next-auth redirecting to the same page over and over again

Hello, I am using next-auth, i have a custom login page and i have a dashboard page that is a protected route so you need to be authenticated in order to see it, when i try to access it it redirects me to the custom login page, so far so good, but when i enter the right username and password it redirects me to, the login form again?? and that happens in a loop. Here is my code. api/auth/[...nextauth]/options.ts ```typescript...
No description

Handling sessions with php question

For my project id like to start the session after they are successfully logged in and transferred to their userpage. I'm curious though how to store the session like do I use the user_id assigned to some other id or something in order to keep track of it being active. I tried reading the php docs on it but I got a bit confused. Any insight on handling sessions is most welcomed. I'll share my code for my login page so others can let me know if im doing this wrong. Thanks!

(feedback) Double Account Threat Intelligence

I want to introduce you a new system to verify discord users. This system is for preventing alternate accounts on discord servers. Traditional bots relies on network metrics to detect alternate accounts, which is ineffective and can be spoofed or bypassed. DATI System, on the other hand, uses biometric authentication, which can be hard-to-spoof. This biometric authentication is named "UVID", Unique Voice Identification. It uses mathematical concepts and AI for processing sounds and speech recognition. An hash is created, containing information about the user's voice, and this hash is compared on a database via a binary search. If the hash matches, then the user is banned because it's an alternate account. ...
No description

creating a historical database for graph generation

Anyone have opinions / thoughts / experience on the best way to store database history? Like if I was storing the values of a stock ticker and wanted to generate a graph of stock price over time (not my actual use case but similar idea). Seems like there are a lot of wrong ways to do it. I'll be accessing the DB with an expressJS server and I haven't choosen a database stack yet...

dynamic file names for php like in js can it be done?

you know how in js you can have file names like [id].js where id is a field from a database for pages that are changing based on what is pulled from the db? Can you do the same for php like [user_id].php for a building something like a individual user page?

Working Contact Form

I am working on a website using html css bootstrap and js , now I want to add a contact form but using a backened language. I want help by telling me which backened language is a good and an easy way to use for that .

Compress imagem to database laravel

"Hello, I'm developing a project in Laravel where the user can upload their own images, and I want them to be compressed when selected. Can anyone help me figure out the best way to do this?"

MongoDB & mongoose | How to automatically remove element from array after certain amount of time?

I'm creating Instagram clone and right now working with stories. I need them to be visible to followers for only 24h, so I was thinking of giving each user activeStories field which would be array of story IDs that user posted within last 24h. But I'm not sure how I would remove them after 24h. Is there a built-in way to handle this or am I gonna have to handle that myself?

NPM issues

I just started Beyond CSS and I'm having some issues with Project 1. I don't get the message that Kevin does that the dependencies are not installed so I assume that they are. However when I run npm start I get the following error: sh: npm-run-all: command not found. I did try npm install and got a ton of Errors. Sorry if it's comething obvious - I'm new to this side of things

Creating a Database on my Mac

Hello, What is a good SQL program for mac for creating a database for my student database for a School Attendance System I am working on? Perifably GUI based as I don't work well with a command line....

seting cookies in the cookies storage in the borwser

the cokies are being set when i hit the login api, and i can inspect in the network section in the browser from the response.headers that the cookies are available but the cookies are not being set in the browser properly , i checked for answer in stack overflow where they said i need to send {withCredentials:true} with the login pay load but when i set this it causes a failed response, can anyone help please?...

Patch request Error, json-server

Anyone can help me what is the problem of this: The get request is working using the user_num property as identifier and not the id. but when i use it in patch it returns 404 not found Get Request: axios.get('http://localhost:3000/users?user_num=US24-18')...

remove unused dependencies? Importance?

Just wondering if unused dependencies (in package.json) effect anything other than install time (and potentially deployment-time)? i'm taking a course, they provided some starter code - there was an unused dependency - I asked if i should remove it, they said "if you want" - so i'm trying to find out!...

Database setup for a simple login and registration page in terms of having a "remember me" function

I'm not sure how to setup my database to have a "Remember me" function in order to handle bypassing login. I know you use a cookie with a encoded string and other stuff but the database setup itself is a bit odd. I'm using a Postgres database and so far here are the fields I thought of... ``` user_id AUTOINCREMENT INTEGER email TEXT NOT NULL...