TTC
Theo's Typesafe Culttomharto
How would you structure the backend for an application like this?
I have a simple app I want to rebuild in T3, and curious what approach would work well, I haven't used React/TRPC so don't want to work again the tools.
It's a simple reading list, books grouped by month, and within each month ordered by the date the book is marked as read.
I have a few ideas:
1. One call, get all the data, group it in the front end
1. One call, get all the data ordered but flat, and group it in the front end
2. Each MonthView component does a call for it's own data
Would any of these be a good idea, or maybe something else completely?
M
michaeldrotar•17d ago
grouping in the FE seems like a generally bad idea since things will generally scale to the point of needing pagination
however grouped by month with a
<MonthView />
component in this context seems equivalent to filtered by month
Couple benefits:
- This approach will still support pagination if needed in the future.
- Showing multiple months is a matter of multiple parallel calls or passing multiple months
- Adding a year, week, or day view is a simple matter of changing the filter accordinglyT
tomharto•17d ago
Thanks, yeah that's what I was thinking. My current version in Vue took the idea one approach and I didn't like it, very messy and tough to update when the user changed anything.
If I did the month view idea, is there a nice clean way to get every component to refresh it's data on a given user action, e.g marking a book as read?
M
michaeldrotar•16d ago
yeah, depends what you're using but you'd be searching for how to do a revalidation (ie. to invalidate the existing data)
For instance, when using server actions: https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation
21KMembers
View on DiscordWant results from more Discord servers?
More PostsPlease help me save our internal app from cookies set at subdomains in our company!Our Nodejs Express application is seeing 400 bad request responses and 413 request header too large Fail to try beta version of Typescript because @t3-oss requirementhello guys, noob question, how to bypass peer dependencies requirement? i want to use typescript 5.5Module not found: Can't resolve './utils/createUtilityFunctions.mjs't3 starter app with nextauth auth.ts config problems```tsx
const config = {
providers: [GoogleProvider, FacebookProvider],
adapter: DrizzleAdapter(dwhats the proper way to disable auto zoom focus on inputs and textareas on mobile?whats the proper way to disable auto zoom focus on inputs and textareas on mobile? i know you can seinternal server error when deploying to DigitalOceanWhen entering some specific pages in my site, the server gets an error and shuts down.
Why is this error: NEXT_REDIRECTI'm doing a server call in RSC, but it crash the app and show this kind of error and It shows in theNodejs take less time instead BunWhy they close this issue??
https://github.com/oven-sh/bun/issues/10519Testing in reactHey everyone, I’ve been pondering whether diving into learning how to test React code is worth it. DCreate t3 app with nextauth and new router problemsI have a question regarding the t3-createapp with nextauth.
In what file do I put my <SessionProvid