--- created: 2025-03-05 last_updated: 2025-03-05 --- # Routes Architecture Documentation ## Keeping the Documentation Updated - Review and update this document whenever there are changes to the routing architecture - Ensure the mermaid diagram reflects the current file structure - Document any new routes or significant modifications ## Mermaid Documentation ```mermaid graph TD A[Routes] --> B[API Routes] A --> C[Frontend Routes] B --> D[Authentication] D --> D1[POST /login] D --> D2[POST /register] D --> D3[GET /logout] B --> E[Data Management] E --> E1[GET /data] E --> E2[POST /data] E --> E3[PUT /data/:id] E --> E4[DELETE /data/:id] C --> F[User Interface] F --> F1[/home] F --> F2[/dashboard] F --> F3[/profile] C --> G[Admin Panel] G --> G1[/admin/users] G --> G2[/admin/settings] G --> G3[/admin/logs] style A fill:#f9f,stroke:#333,stroke-width:4px style B fill:#bbf,stroke:#333,stroke-width:2px style C fill:#bbf,stroke:#333,stroke-width:2px ``` ``` src/app/ ├── (web3-authenticated)/ # Auth-protected routes │ ├── (dashboard)/ # Main dashboard layout │ │ ├── (buy-prepaid-service)/ │ │ │ └── bp/page.tsx # Prepaid service purchase │ │ ├── (projects)/ # Project management │ │ │ └── pr/ │ │ │ ├── [provider]/ # Dynamic provider segment │ │ │ │ └── [orgSlug]/(projects)/ps/ │ │ │ │ ├── (create)/cr/ # Creation wizard │ │ │ │ │ ├── (configure)/cf/page.tsx │ │ │ │ │ ├── (deploy)/dp/page.tsx │ │ │ │ │ └── (template)/tm/ │ │ │ │ │ ├── (configure)/cf/page.tsx │ │ │ │ │ └── (deploy)/dp/page.tsx │ │ │ │ └── [id]/ # Individual project │ │ │ │ ├── (deployments)/dep/page.tsx │ │ │ │ ├── (integrations)/int/page.tsx │ │ │ │ └── (settings)/set/ │ │ │ │ ├── (collaborators)/col/page.tsx │ │ │ │ ├── (domains)/dom/ │ │ │ │ │ └── (add)/cf/page.tsx │ │ │ │ └── (environment-variables)/env/page.tsx │ │ │ ├── error.tsx # Route error boundary │ │ │ └── loading.tsx # Suspense fallback │ │ └── layout.tsx # Dashboard layout │ └── layout.tsx # Auth group layout ├── .DS_Store # macOS directory metadata ├── favicon.ico # Browser tab icon ├── layout.tsx # Root layout component ├── login/ # Login interface │ └── page.tsx # Login page ├── not-found.tsx # 404 error page ├── page.tsx # Main entry point ├── store/ # State management │ ├── layout.tsx # State management layout │ └── page.tsx # Store dashboard └── wallet/ # Crypto wallet integration ├── layout.tsx # Wallet integration layout └── page.tsx # Wallet management Key architectural patterns: - Dynamic routing with [param] segments - Route groups using () for organization - Shared error/loading boundaries - Hierarchical layout inheritance - Isolated feature directories - Protected routes under authentication