Victor Jeman Academy

How do you generate the initial structure instead of inventing folders as you go?

A good structure makes it obvious where new code belongs.

Start from a known structure

Invent folders as you go and the project drifts. Names stop matching, similar files end up in different places. Start from a structure you can explain out loud and every new file has one obvious home. Feature-folder means each feature owns its own slice (UI, data, types, config) in one folder, and no feature imports from another.

Project structure

Click a folder to see why it exists.

Why this folder?

app

The Next.js App Router. Every URL the user can visit is a folder here. Keep this layer thin: a page reads params, calls a feature, and renders it. No business logic lives here.

Here is my feature-folder structure: app, core (components/ui, lib), features (each with ui, actions, fetchers, hooks, queries, types, schemas, config), server. Pick [one folder] and explain in one sentence why it exists and what belongs there.

Place new code without guessing

Good structure passes one test: you drop new code in without stopping to think. You already know where an API call lives, where a reusable component lives.

Using only the folders in my feature-folder structure (no new ones): where should I put [the file I am unsure about], and why that folder over the next-closest one?

A structure you can explain beats folders you invent on the fly. Every new file lands in one obvious home.

Additional Resources

Explore these carefully curated resources to deepen your understanding and practice the concepts covered in this lesson.