Lopen
Lopen
TTCTheo's Typesafe Cult
Created by Lopen on 1/28/2024 in #questions
why do people return jwt token despite setting cookie
I have observed that several backends returns jwt token as response when you hit endpoints like /login Why isn't setting cookies via header set-cookie enough?
2 replies
TTCTheo's Typesafe Cult
Created by Lopen on 1/11/2024 in #questions
what tool do you use for api testing
I have used postman over the years but for a few years now its been too buggy I also tried Insomnia but its kinda not usable and too strick I tried testfully it ok but too slow What do you use? And must be compatible to postman collection Because due to how bad the desktop apps has been i have resulted in using the online version of postman Then i proxy local api via ngrok so i can test my local api from the cloud, because no desktop app works I am using Linux btw
11 replies
TTCTheo's Typesafe Cult
Created by Lopen on 12/31/2023 in #questions
is deletion actually a thing or just formality in production?
Let's take shopify as an example, if a product is deleted, and as they claim deleted product can't be restored, how do they do their stats and other things related to orders Because the relationships in database will be Product -> Orders So technically if a product is deleted orders is supposed to be cascade deleted Or they have a boolean were on delete it sets thr product to deleted 😅 (or how do you handle such cases at work) Or will Orders be an Orhan were the relationship will be null on product deletion
15 replies
TTCTheo's Typesafe Cult
Created by Lopen on 11/2/2023 in #questions
i am building a react component library how can i keep the bundle size very low
I am trying to build a component library for react Nothing to crazy just a simple and sing component That will take in children props and do some stuffs At first i wanted to use nextjs but i decided not to go forward as it will complicate things because of how nextjs works So i decided to stick with react now a simple empty hello world div when compiled/ builder its already 100kb and a few more lines of code its already over 1.1mb I need suggestions on what other approaches i could use Also not i haven't added css yet I am using bun builder, i dont have strength to handle webpack though with a few stuffs webpack could only save me .05mb I think i want to stick to bun bunder simplicity I need suggestions on how to keep the build very small..... Preact?
1 replies
TTCTheo's Typesafe Cult
Created by Lopen on 10/10/2023 in #questions
which of this approach is better?
1)
const { password, ...userWithoutPassword } = user;
return userWithoutPassword
const { password, ...userWithoutPassword } = user;
return userWithoutPassword
2)
delete user.password;
return user
delete user.password;
return user
3 replies
TTCTheo's Typesafe Cult
Created by Lopen on 9/1/2023 in #questions
should i use a pool or connection in mysql
This is my first time going raw on sql. i usually use an orm(prisma) So, in this application; it's an express application I am using
mysql2
mysql2
package to do my queries This application is read intensive, possibly like hundreds or more read per second Should i use a
mysql.createConnetion
mysql.createConnetion
or
mysql.createPool
mysql.createPool
Also, note that i will inject the connection into express
app.use((req,res,next)=>
{
req.db = Dbconnection
})
app.use((req,res,next)=>
{
req.db = Dbconnection
})
Also, do i need to await the db? Because it's going to create more complexity
26 replies
TTCTheo's Typesafe Cult
Created by Lopen on 8/26/2023 in #questions
should package-lock.json be committed?
I see people committing package-lock.json to git repo always To me, i see it as a bad idea Because i have had many bad experiences with it, especially since i am using a Linux pc and the other contributor uses windows they is always strange issues with architecture kind of thing in the file Do you think it's a good practice? Why? I see it as a risk not worth taking
5 replies
TTCTheo's Typesafe Cult
Created by Lopen on 8/8/2023 in #questions
best practices to throw error on backend
I see people using throw new error and throw error But for me i kinda prefer having standard patterns across all the apis
return {
status: false,
error message
}
return {
status: false,
error message
}
43 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/27/2023 in #questions
next auth X DiscordProvider types
1 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/19/2023 in #questions
any npm package to achieve something like?
10 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/17/2023 in #questions
how do you all cope with onboarding on an already existing express project?
I just tried to maintain an already existing express app built with typescript, but i am getting frustrated due to the lack of standard design patterns Do you think nestjs should be a higher priority when we mention express js? But i hate the nestjs syntax, though
3 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/11/2023 in #questions
is nest js the laravel of the javascript land?
I really love the laravel approach like all the batteries to implement nearly anything you want out of the box From queues to auth, etc, I am planning to rewrite a current project based on t3 stack. i really loved it, but things are getting too complex, so i want to break to backend and frontend separation type of thing Just wanted to get your views on nest js for the backend i hate the syntax though i would have loved to use express js but just that i want something close to the,DX t3 stack provides but regular rest api based and TypeScript Also, websockets, web hooks, and queues are very much present on it and one of the reasons i am moving of the t3 stack.
19 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/8/2023 in #questions
which database will you recommend i use for storing jobs for queues
I would have loved to use redis, but i am scared someone may reboot the server, and everything will be lost I have so many juniors, etc
2 replies
TTCTheo's Typesafe Cult
Created by Lopen on 6/5/2023 in #questions
drizzle orm is overhyped
Everyone is talking about drizzle orm. we all know that vercel pays people to talk I feel prisma DX is no match for drizzle orm no matter what they say prisma is here to stay You may say performance Why not develop you backend in rust or golang if performance was your main focus DX and community 🎤
68 replies
TTCTheo's Typesafe Cult
Created by Lopen on 5/1/2023 in #questions
how can i select this object using "."
I am hitting an external api, and to my greatest surprise, the response is something like this
{
"status": "success",
"data": {
"CAD-USD": 74
}
}
{
"status": "success",
"data": {
"CAD-USD": 74
}
}
How can i access "CAD-USD " ?? Something like this
response.data.cad-usd
response.data.cad-usd
2 replies
TTCTheo's Typesafe Cult
Created by Lopen on 4/30/2023 in #questions
which code is best to create a class for an express app
2 replies
TTCTheo's Typesafe Cult
Created by Lopen on 4/29/2023 in #questions
best way to protect my code and avoid piracy when selling it
So i am trying to make a reusable SaaS product with both front-end, backend, and admin panel all a bundle that will be sold to different businesses for use So how do i go about making it so my code can't be resold and the code is only usable by the originally buyers I will be building with nodejs for the backend And nextjs for the front-end
3 replies
TTCTheo's Typesafe Cult
Created by Lopen on 4/22/2023 in #questions
Google analytics 4 very difficult to setup
I have been trying to get it to work on nextjs 13 / t3 stack It didn't work the only way i was able to get it to work a bit was to use the old google analytics which will soon be obsolete so that's why i trying to get the analytics 4 to work But all efforts to no avail
10 replies
TTCTheo's Typesafe Cult
Created by Lopen on 4/17/2023 in #questions
what are the factors to be considered in other to install an npm package as a dev Dependency
Because going around the internet everyone just runs
npm i package_name
npm i package_name
Should i install recoil as a dev Dependency Should i install @headlessui/react as a dev Dependency ?
5 replies
TTCTheo's Typesafe Cult
Created by Lopen on 4/9/2023 in #questions
framework suggestions to build a blog
So i am trying to build my personal blog. i would have gladly used T3 stack, but i have heard enough bad things in regards to SEO with next js So i need suggestions on what stack or framework that will best suit my needs with very good SEO
3 replies