Clarity & Findability
Every file should have an obvious place and purpose. A developer should be able to find any component or configuration within seconds of looking.
/src/components/header/header.css
Bad:
/css/styles-v2-final.css
Master web development project organization by exploring our interactive file system. Hover over folders and files to discover their purpose, click for detailed explanations, and build a solid foundation for organizing your own projects.
Good project structure is like organizing a library - it makes everything easier to find, understand, and maintain. Learn the principles that guide professional web development.
Every file should have an obvious place and purpose. A developer should be able to find any component or configuration within seconds of looking.
/src/components/header/header.css
/css/styles-v2-final.css
Start with a structure that can grow. What works for 5 components should still work for 50 components without major reorganization.
Follow established patterns that other developers recognize. This makes collaboration easier and reduces the learning curve for new team members.
package.json
, src/
, tests/
my-config.json
, code/
, checks/
Explore the BSB project structure below. Hover over items for quick explanations, click folders to expand them, and use "Learn More" for detailed guides with examples.
These patterns appear across most professional web projects. Understanding them will help you navigate any codebase and organize your own projects effectively.
src/
├── components/ ← Reusable UI pieces
├── pages/ ← Individual page templates
├── styles/ ← CSS organization
├── scripts/ ← JavaScript functionality
└── assets/ ← Images, fonts, icons
Why: Separates different types of source code for easier navigation and maintenance. Each folder has a clear, single responsibility.
project-root/
├── package.json ← Project metadata & deps
├── vite.config.js ← Build tool configuration
├── .gitignore ← Version control rules
├── .eslintrc.json ← Code quality rules
└── jest.config.js ← Testing configuration
Why: Tools expect configuration files at the project root. This makes setup automatic and follows universal conventions.
components/header/
├── header.html ← Structure
├── header.css ← Styling
├── header.js ← Behavior
├── header.test.js ← Tests
└── README.md ← Documentation
Why: Related files stay together. When you need to modify the header, everything you need is in one place.
project/
├── src/ ← Source code (editable)
├── dist/ ← Built files (generated)
├── node_modules/ ← Dependencies (installed)
└── tests/ ← Test files (quality)
Why: Source code stays clean and editable. Generated files are kept separate and can be safely deleted and rebuilt.
Use established patterns like src/
, components/
, and package.json
. Don't reinvent the wheel - follow conventions that other developers already know.
Keep component HTML, CSS, and JavaScript in the same folder. When you need to work on the header, everything should be in /components/header/
.
Avoid names like utils
, helpers
, or misc
. Use specific names: date-formatters
, api-clients
, form-validators
.
Avoid deep nesting like /src/ui/components/forms/inputs/text/
. Prefer flatter structures: /src/components/text-input/
.
Add README files explaining folder purposes. Future you (and your teammates) will thank you for explaining why things are organized the way they are.
It's better to have a consistent structure that everyone follows than a "perfect" structure that's inconsistently applied. Document and enforce your patterns.
Apply these principles to create maintainable, scalable web projects that other developers will love to work with.