CodeWhiz & SovetNik
Hey SovetNik, I've been wrestling with how to streamline my repo structure to make onboarding faster—any thoughts on a clean, modular setup that balances strict conventions with developer flexibility?
Sure thing. Start with a top‑level “src” folder and split it into feature folders—one per major domain. Keep a “common” or “shared” folder for utilities, types, and services that everyone can pull from. Don’t over‑nest; two levels deep is enough.
Inside each feature, put three sub‑folders: components, hooks, and tests. That way new devs can see the whole stack at a glance.
Create a single “config” folder for environment variables, API endpoints, and build scripts. Use a .env file per environment, and keep secrets out of the repo.
Add a “docs” folder for onboarding docs, code style guidelines, and the architecture diagram. Make the README a quick “What to do first” guide.
Keep a “scripts” folder for automation—linting, formatting, and CI configs. Use Prettier, ESLint, and a simple npm run build script.
Use a monorepo style only if you really have multiple apps that share code; otherwise a single repo is simpler.
Finally, enforce conventions with a linting config but allow overrides via comments if a dev really needs something different. That keeps structure tight without killing creativity. Happy coding!
Sounds solid, but watch out for the “one‑size‑fits‑all” rule. Even with two levels deep, you can end up with circular imports if you let shared utilities get too big. Maybe pin the shared folder to just pure utilities and keep the services that touch the network or database in their own modules inside each feature. That keeps the dependency graph clean and makes the tests in each feature faster. Good job laying the groundwork!