Lumberjack
Lumberjack
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Lumberjack on 9/20/2023 in #questions
auth with Fastify and redis
When it comes to db session strategy in NextAuth. I used to use a Prisma adapter that stores the session in MySQL db but afaik that's not optimal for bigger apps especially if there's lot of queries and it should be stored in a redis db instead. Now im trying to build a simple auth system using Fastify and Passport js with MySQL for storing users info and a Redis db for storing sessions. But idk really how to do that and i searched lot but i didn't find anything. Should i stick with MySQL there gonna be lot of requests btw or should make a redis db for that. If yes how can i do that?
2 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 9/9/2023 in #questions
bun for a large scale app
hello, im going to make a large scale app and i asked about the best options for that. some friends recommended either hone with bun or fiber with Go, im not into learning a new language yet so i was wondering if using bun at this version for this type of app levels is a wise choice. I'll be happy to knw which framework is the best choice for such an apps like this
147 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 9/8/2023 in #questions
socket.io
No description
5 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 9/2/2023 in #questions
C first or C++
I'm currently learning Rust and its the first low level lang im learning im familiar with programming and im thinking to go further to c or c++ but im not sure which one should i start with nd maybe i'll drop the other one if it serves my needs. I still don't knw that much in DSA and low level stuff. So idk if should i start with c or c++ first after getting done with Rust
44 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 9/1/2023 in #questions
shadcn Form
Hello im having two forms made with shadcn components and react-hook-from Controller for validation The idea is when u fill the first form and submit it. The second form takes the first one place. I added a cancel button to take the user back to the the first one . I want it with all the fields filled up with the previous data but idk how to do it through the controller. That's a code snippet.
<FormField
control={form.control}
name="Nom"
render={({ field }) => (
<FormItem>
<FormControl>
<div className="flex flex-col space-y-1.5">
<Label
htmlFor="Nom"
className="text-lg flex justify-between"
>
Nom
<FormMessage />
</Label>
<Input
{...field}
id="Nom"
placeholder="John"
className={` ${
form.formState.errors.Nom &&
"border-err placeholder:text-destructives"
} text-md py-5 placeholder:opacity-40 rounded-sm border-[3px] `}
/>
</div>
</FormControl>
</FormItem>
)}
/>
<FormField
control={form.control}
name="Nom"
render={({ field }) => (
<FormItem>
<FormControl>
<div className="flex flex-col space-y-1.5">
<Label
htmlFor="Nom"
className="text-lg flex justify-between"
>
Nom
<FormMessage />
</Label>
<Input
{...field}
id="Nom"
placeholder="John"
className={` ${
form.formState.errors.Nom &&
"border-err placeholder:text-destructives"
} text-md py-5 placeholder:opacity-40 rounded-sm border-[3px] `}
/>
</div>
</FormControl>
</FormItem>
)}
/>
9 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 8/31/2023 in #questions
messenger bot api
im trying to make a messenger chat bot for a group chat and i found this unoff api on github but im not sure if it can have a negative effect on my gc especially causing security vurlnablities or causing to close all the users acc's https://github.com/Schmavery/facebook-chat-api
35 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 8/22/2023 in #questions
dynamic unit testing
Hello. Well i checked the Unit, E2E, Integration testing and where/what/when they should be used for. The thing that i can't understand is in the Unit testing when i write a test basically i'll hard code every case and that's basically not efficient for me. I may end up with a function that has +50 test cases and idk how to make the process dynamic.
13 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 8/20/2023 in #questions
containerization
Im thinking about implementing multiple techs/languages in a monolith. Does the containerization makes it possible
76 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 7/28/2023 in #questions
state updating problem
Hello recently i made a custom hook that fetches the user from the db and another one that fetches data from an external api. Basically this api returns a chess fen a chess position on the chessboard and the possible moves around 8 moves i passed the fen as a prop to the chessboard component and make it as an initial value to the fen state i did that because the fen will change during the game until the moves are null. For testing i hard coded a fen and a moves vars and everything worked fine but when i switched to the custom hook it breaks as follows : When i console.log The fen state it logs undefined and nothing shows on the board ui and i think because its related to the state and the async behavior but i couldn't find a good way to make the initial state not undefined. here's some code snippets to explain more:
7 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 7/8/2023 in #questions
next auth jwt session
Hello im having some problems with making the session for credentials provider i managed to make it for google provider using the Prisma adapter but since there's no adapters for the credentials i tried to make it with jwt but i don't have any idea if this is the right implementation That's the github repo : https://github.com/CLOG9/PuzChess And that's the auth code im having doubts about (from app/api/auth/[... nextauth]/options.ts):
callbacks: {
async session({ session, token, user }) {
console.log("im session", session);
session.user = token;

return session;
},
async jwt({ token, user }) {
console.log("im token", token);

return { ...token, ...user };
},
},
callbacks: {
async session({ session, token, user }) {
console.log("im session", session);
session.user = token;

return session;
},
async jwt({ token, user }) {
console.log("im token", token);

return { ...token, ...user };
},
},
270 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 7/4/2023 in #questions
next email library
Hello im working on password recovery by email feature in next js. which mailing lib/service u suggest
45 replies
TTCTheo's Typesafe Cult
Created by Lumberjack on 7/2/2023 in #questions
next-auth
Im working on auth in this next app using next auth with google and credentials providers, and custom sign in and register page . I definitely don't knw if I'm doing it in the right safest way to prevent my data from attackers. I made only the
play
play
route redirect u to the login page when u're not logged in i'll do the same for the rest of the pages later except blogs, home, sign in routes Also the dashboard route will be protected route with user based auth
For now i wanna knw if my method is correct or not and what the things that i missed or did wrong. This is the github repo pls feel free to check it out : https://github.com/CLOG9/PuzChess/tree/main
425 replies
KPCKevin Powell - Community
Created by Lumberjack on 6/17/2023 in #front-end
RN or flutter for a react dev
Hello again, im a react/next dev and im interested in the cross platform field but im confused between choosing flutter or react native even tho i already know dart , but im still not sure if changing the ecosystems is good or not for me.
5 replies
KPCKevin Powell - Community
Created by Lumberjack on 6/13/2023 in #front-end
vercel deployment
1 replies
KPCKevin Powell - Community
Created by Lumberjack on 6/10/2023 in #front-end
Flutter or RN for react dev
Hello again, im a react/next dev and im interested in the cross platform field but im confused between choosing flutter or react native even tho i already know dart , but im still not sure if changing the ecosystems is good or not for me.
1 replies
KPCKevin Powell - Community
Created by Lumberjack on 6/9/2023 in #front-end
next js basics
I learned react js and im up to next js, what are the things that i need t learn before dive in (not the next js it self but the core concepts before learning it)
1 replies