Nobody teaches folder structure; everyone judges it. Reviewers open your repo and form an opinion in ten seconds.
Small static project
my-site/ โโโ index.html โโโ css/style.css โโโ js/main.js โโโ images/ โโโ README.md โ the most-skipped, most-read file
App-sized (Vite/React)
src/ โโโ components/ # reusable UI (Button, Card, Navbar) โโโ pages/ # route-level views โโโ hooks/ # useAuth, useFetch โโโ utils/ # pure helpers (formatDate, calcGpa) โโโ services/ # API calls in ONE place โ not scattered fetches โโโ assets/ โโโ main.jsx
The services folder is the sleeper: every fetch in one layer means auth headers, error handling and base URLs change in one file.
Scaling rule: group by feature, not type
# past ~20 components, flip the axis: src/features/ โโโ auth/ # ITS components, hooks, api, tests together โโโ results/ โโโ playground/
Everything about a feature lives together โ deleting a feature is deleting a folder.
The consistency laws
- Pick ONE casing (kebab-case files, PascalCase components) and never mix
- index.js re-exports keep imports clean:
import { Button } from "@/components" - A README with setup steps + screenshot beats any structure โ write it first, not never