My Solopreneur Tech Stacks
Tech Stacks
- Next JS 15, with app router
- Zustand Store
- Prisma ORM
- Tailwind CSS
- Typescript
- Eslint
- Prettier
Rules
Zustand Rules:
- Create every Zustand Store in
src/storefolder - If the store is called
userStore, the correspondinguser-store.tsfile will be created insrc/storefolder - the typescript interface of the store will be created in
src/typesfolder. - the typescript interface parameters need to be the camel cased versions of the data stored in the postgres database (e.g. postgres database column name
user_idneeds to be written asuserIdin the typescript interface)
React Components Rules:
- start writing page in
src/app/<page_name>/page.tsx, as it is - use zustand store in
src/app/<page_name>/page.tsxby importing the store fromsrc/store/<store_name>.tsif it has relation with the data on the database. - React's
useStatehook can be used for local state only. Rewrite to Zustand store if it will be used repeatedly in multiple pages / components. - for repeatable components, use the
useStorehook to get the store from the context. Put the component insrc/componentsfolder