How hedavam/midd-laundry works
Main Components
A. Frontend Layer:
• Client-side Components (src/components/)
• Calendar
• Machine
• Notifications
• UserForm components
• Pages (src/pages/)
• Room views
• API routes
B. Backend Layer:
• API Routes (/api)
• Loads endpoints
• Machines endpoints
• Rooms endpoints
• Database Models
• BaseModel
• Loads
• Machines
• Rooms
C. External Services:
• SendGrid (Email notifications)
• PostgreSQL Database
• Docker (development environment)
[Client Layer]
• ▼
[Next.js Server Layer]
• ▼
[Data Layer]
Detailed Component Relationships
A. Client Layer (Top):
• Page routing structure (rooms.js, [room].js)
• Material-UI theming system
B. Next.js Server Layer (Middle):
• API Routes structure showing endpoints for:
• /api/loads
• /api/machines
• /api/rooms
• Middleware handling
• Authentication flow (if implemented)
C. Data Layer (Bottom):
• PostgreSQL Database
• Knex.js Query Builder
• Migration system
• Seeding process
Data Flow Indicators
• Client-to-Server API calls
• Server-to-Database queries
• Email notification flow through SendGrid
Architectural Patterns to Highlight
• API-first design
• Model-View-Controller pattern in API routes
• Database migration strategy
• Component-based frontend architecture
Integration points with external services
Remember to:
• Keep the main flow clear and centered
• Related components together
• Version/environment indicators
• Scaling considerations