Jaaneek
Jaaneek
Explore posts from servers
DTDrizzle Team
Created by Jaaneek on 4/2/2024 in #help
How to Join/subquery when using orderBy and groupBy
const data = await ctx.db
.select({
propositionId: propositionsVotes.propositionId,
twitchSubscriptionsCount: sql<number>`cast(count(nullif(${propositionsVotes.twitchSubscribed},false)) as int)`,
youtubeSubscriptionsCount: sql<number>`cast(count(nullif(${propositionsVotes.youtubeSubscribed},false)) as int)`,
normalVotesCount: sql<number>`cast(count(${propositionsVotes.profileId}) as int)`,
proposition: WRITE SOMETHING THAT WILL GIVE ME PROPOSITION DATA IN HERE
})
.from(propositionsVotes)
.groupBy(propositionsVotes.propositionId)
.orderBy(
sql<number>`cast(count(${propositionsVotes.twitchSubscribed}) as int)`,
);
const data = await ctx.db
.select({
propositionId: propositionsVotes.propositionId,
twitchSubscriptionsCount: sql<number>`cast(count(nullif(${propositionsVotes.twitchSubscribed},false)) as int)`,
youtubeSubscriptionsCount: sql<number>`cast(count(nullif(${propositionsVotes.youtubeSubscribed},false)) as int)`,
normalVotesCount: sql<number>`cast(count(${propositionsVotes.profileId}) as int)`,
proposition: WRITE SOMETHING THAT WILL GIVE ME PROPOSITION DATA IN HERE
})
.from(propositionsVotes)
.groupBy(propositionsVotes.propositionId)
.orderBy(
sql<number>`cast(count(${propositionsVotes.twitchSubscribed}) as int)`,
);
I need to get proposition, how should I approach that?
13 replies
DTDrizzle Team
Created by Jaaneek on 3/7/2024 in #help
Vercel Edge Runtime + Supabase + Drizzle, 15 seconds server lags + Trpc
When deploying on vercel with lambda everything is extra smooth. With vercel edge runtime a lot of things are not quite working One of those things are my transactions. The db < - > server trip is very fast. but the server < - > client takes 15seconds + Am I doing something wrong with this transaction?
await ctx.db.transaction(async (db) => {
const board = await db
.insert(boards)
.values({
name: input.name,
twitchUsername: input.twitchUsername,
youtubeChannelId: input.youtubeChannelId,
id: input.id,
slug: input.slug,
})
.returning();

console.timeLog("addNewBoard", { board });
const newValue = board[0] || null;

if (!newValue) {
db.rollback();

return "success";
}

await db.insert(boardOwnerships).values({
boardId: newValue.id,
profileId: ctx.user.id,
});
console.timeLog("addNewBoard", "board query done");

return "success";
});
console.timeEnd("addNewBoard");

return "success";
await ctx.db.transaction(async (db) => {
const board = await db
.insert(boards)
.values({
name: input.name,
twitchUsername: input.twitchUsername,
youtubeChannelId: input.youtubeChannelId,
id: input.id,
slug: input.slug,
})
.returning();

console.timeLog("addNewBoard", { board });
const newValue = board[0] || null;

if (!newValue) {
db.rollback();

return "success";
}

await db.insert(boardOwnerships).values({
boardId: newValue.id,
profileId: ctx.user.id,
});
console.timeLog("addNewBoard", "board query done");

return "success";
});
console.timeEnd("addNewBoard");

return "success";
1. When I remove the transaction and write the same code without it, it works as expected 2. Works perfectly on lambda 3. works perfectly locally
6 replies
TtRPC
Created by Jaaneek on 1/31/2024 in #❓-help
TRPC not working on multi tenant app
No description
7 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 1/16/2024 in #questions
Parsing JSON Into zod schema using OPENAI GPT
I want to parse a JSON example https://store.steampowered.com/api/appdetails?appids=1702010 Into large advanced zod schema. Do you guys have any experience doing this with gpt openai package?? Seems like pretty normal use case but I can't find any good examples
50 replies
TtRPC
Created by Jaaneek on 11/13/2023 in #❓-help
Server Component Call to TRPC on express backend
I have following structure: - Nextjs App folder with both client components and server components - TRPC on express backend. Communication with client components works perfectly, but I would like to call it from the server components as well. What is the correct approach?
2 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 9/21/2023 in #questions
ideas for projects
Is there a płace were people share their problems/ideas for apps? Something like product hunt, but with problems instead of products. I’m kinda stagating with ideas
8 replies
TtRPC
Created by Jaaneek on 9/3/2023 in #❓-help
Turborepo, nextjs, vite react app, express server
I have following structure Apps: First Frontend - Nextjs app Second Frontend - Vite ReactApp Backend - Express Server Packages: Commons - Shared types, functions etc... I would like to create a Trpc on express server and to consume it on Nextjs App & Vite React App, did you guys seen such setup? Any tips? I'm just starting out and I only used trpc with nextjs so far
2 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 8/11/2023 in #questions
Product hunt hunters
Im about to release my Saas built with t3stack on product hunt. Do you guys have any advice that I can use? Is it a good idea to launch it on saturday? I want it to be less competetive since I doubt I will break through other products who have better marketing strategies Did you use hunters? What do you think about that
3 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 8/9/2023 in #questions
React Joyride alternatives
What do you use for creating guided tours of your apps? Joyride seems most popular but it has class component in example so I'm hesistant about using it lmao
2 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 8/2/2023 in #questions
Microservice and where to host it
Is fastify still the #1 for quick microservice? Where do you recommend hosting it
6 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 8/2/2023 in #questions
Single endpoint that can take up to few minutes to resolve
I have my whole backend on nextjs api routes. Everything works great, but right now I need the backend to have an endpoint that can take up to few minutes to resolve, mostly because of calling gpt API, should I go with lambda function or seperate micro service? Are there any other alternatives? What would you do in that scenario? Thx
4 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 7/19/2023 in #questions
Which wysiwyg are you using? What would you recommend for a website builder
I can save the output as json in postgres
5 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 7/5/2023 in #questions
best react video player
What is your favorite react video player? And why?
5 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/25/2023 in #questions
What are the most popular social medias amongs IT proffesionals?
I'm creating an app and I would like to include all of the most popular platforms. This includes: recruiters, programmers, UX/UI and any other IT profession My curent list: - Facebook - Twiiter - Linkedin - Github - Youtube - Behance - Dribble - Instagram
2 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/22/2023 in #questions
I'm using icons from github repo that is updated, how would you store it?
Hi, I'm allowing users to choose their techstack, I have the techstack from https://github.com/gilbarbara/logos How would you store them? As a file or would you insert it into database, what if the data changes, would you have some script to update the database? I'm leaning forward a simple file that is cached, but would love hear a second opinion on this
5 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/17/2023 in #questions
How to gather user feedback?
I'm launching my product soon, I would like to let users give me feeback & reports bug. How do you usually approach that? Do you use 3rd party providers? Do you display a button at all time and redirect to form?
28 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/16/2023 in #questions
Can I split trpc router so some of the endpoints are on edge and other on nextjs?
Should I create another endpoint something like [edgetrpc] and have seperate instance of trpc there? What is the best approach?
2 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/12/2023 in #questions
What do you use for carousels?
I have to implement carousel, there is so many libraries. What do you go for usually?
12 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/5/2023 in #questions
My project got pretty slow
I migrated my whole project to app folder, trpc, prisma, chakra-ui. The development got pretty slow, every dev has the newest m1 macbooks with 32gb ram. Are there any patterns that we should avoid? Should we seperate types somehow to make the performance better? Any tips are welcome. We are using t3stack starter
39 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/3/2023 in #questions
Testing payments on development server
Hi guys, how are you approaching payments on development server. I have full local setup (database, backend, frontend) I obviously can't send a webhook to localhost, I also don't want to force developers into using ngrok/localtunell and then manually going into the stripe/paddle dashboard and setting url there whenever they test something. Is there any common approach? inb4 I'm not asking about testing on staging, I'm asking for development when developer is running the project on his machine
8 replies