Next.js Discord

Discord Forum

Curious how you guys structure ur folders?

Unanswered
Gharial posted this in #help-forum
Open in Discord
GharialOP
I usually do it like this:
src/
├── app/               # Routing & Layouts
│   ├── api/           # Route Handlers
│   ├── (auth)   
│   ├── (marketing)         
│   └── (protected)           
├── components/             
│   ├── ui/            # Buttons, Inputs
│   └── sections/      # Feature components
├── lib/                    
│   ├── actions/       # Server Actions ("use server")
│   ├── data/          # DAL (import 'server-only')
│   │   ├── projects.ts
│   │   └── reviews.ts
│   ├── graphql/
│   ├── any-other-lib/
│   └── utils.ts            
├── types/
├── constants/
├── hooks/
│   ├── use-scroll-position.ts
│   └── use-mobile.ts
├── styles/
│   ├── global.css
│   └── animations.css               
└── proxy.ts                # Middleware

1 Reply

Not bad , there are many way to structure folders but as long as it is working , no need to worries.