lib folder and best practives

What do you think about lib folder? I am moving from old project and want to move
formatDate.js
generateRssFeed.js
getAllArticles.js
formatDate.js
generateRssFeed.js
getAllArticles.js
in to typescript and into ct3 structure. Any tips on best practices?
6 Replies
Simvolick
Simvolick2y ago
Adding a message suggestion that already was made but I am afraid that utils folder is more for Utility functions and not for the functionality that I want there that seems very client side and relevant by @qpixel (fine with pings) i have a date format function, stuff for getting git revision/package.json version i have a folder labeled "utils" but also getAllArticles seems like hook, you could put it in a hooks folder ig?
velvox
velvox2y ago
My opinion on all of this is that it's subjective and there really isn't a "right" way to do it I'm on my pc now, so here's a screenshot of my folder layout
velvox
velvox2y ago
velvox
velvox2y ago
Please note this was originally a t3 app but because of changing requirements I'm now using a graphql api that I don't fully control (for some resemblance of typesafety) I'm currently deprecating trpc support
Simvolick
Simvolick2y ago
I hope to get a second opinion on this
velvox
velvox2y ago
You could look at the cal.com codebase iirc they were t3 app before t3 app was a thing also i believe answer overflow is a t3 app
Want results from more Discord servers?
Add your server