Project Structure
The Maybern frontend follows a feature-based organization pattern for scalability and maintainability.Top-Level Structure
Application Shell (src/app/)
Core application setup:
Features (src/features/)
Each feature is self-contained:
Feature Module Pattern
Shared Code (src/shared/)
Reusable across features:
Generated Code (src/gen/)
Auto-generated, do not edit:
Theme (src/theme/)
Chakra UI customization:
Build Scripts (buildSrc/)
Code generation:
Key Files
| File | Purpose |
|---|---|
vite.config.ts | Vite configuration |
tsconfig.json | TypeScript configuration |
orval.config.ts | API client generation |
.nvmrc | Node.js version |
.envrc | Environment variables |
Import Aliases
Configured intsconfig.json:
Best Practices
Feature Organization
Feature Organization
- Keep related code together in features
- Features should be self-contained
- Minimize cross-feature imports
- Use shared code for truly common utilities
Component Structure
Component Structure
- One component per file
- Co-locate styles with components (Chakra)
- Export from index files for clean imports
Generated Code
Generated Code
- Never edit
src/gen/files - Regenerate with
pnpm genafter API changes - Check generated files into source control