NextJS - tRPC - SUPABASE - PRISMA along with BunJS and TailwindCSS base
This is NextJS with React 18 template, which support auto format with eslint and integrated husky
for code checking before commit. This will help in smooth out project building.
- Run:
pnpm install
for install all packages - Run:
pnpm dev
for start dev environment - Run:
pnpm build
for build your project - Run:
pnpm start
for start your built project - Run:
pnpm lint
for checking error and fix it
├── app # New NextJS app folder
├── components # All components that can share between screen
│ └── _template # Template for component
├── locales # I18N Language files
│ ├── en.json
│ └── vi.json
├── constants # All configs and constant goes here
├── hooks # Custom hooks for project
├── layouts # Layouts of screen and components
├── pages # Page file of old NextJS (Use as API route)
├── prisma # Prisma folder
├── public # Public folder, contain static files
├── server # Handle TRPC server
│ ├── common # Common folder for server
│ ├── routers # Routers for server
│ └── services # Services for server (3rd services)
├── states # State management for app
├── styles # App global styles (SCSS)
├── types # App global type (Typescript)
└── utilities # App's utils
- Component that belong only to screen, should be placed on that screen's folder
- App's state should using Recoil, state relate to API should using Redux
- Function that can be used many time should place in utils or hooks if relate to state
- HOC placed in
layouts
have prefix*HOC
likeAuthenticationHOC
- Layout placed in
layouts
and have prefix*Layout
likeMainLayout
orDefaultLayout
- All atom from recoil should have prefix
*Atom
likeDarkmodeAtom
- All config export from configs folder should have export prefix
*Config
likeBaseConfig
orApiConfig
tRPC
for APISupabase
for database and authenticationPrisma
for ORMNextJS + Typescript
Base sourcezustand
State managermentHusky
Git helperSCSS modules
Style systemEslint and Prettier
Rule of codeBunJS
for build