How homeycommunity/web works
Main Components
a. Frontend Layer:
• Next.js App Router Structure
• Public Pages (/app/store, /app/docs, /app/control)
• Authentication Pages
• Control Panel Interface
• UI Components Layer (/components)
• Theme Provider & Global Styles
b. API Layer:
• REST API Routes (/app/api)
• Authentication endpoints
• HCS (Homey Control System) endpoints
• Device control endpoints
• Version management
• API key management
c. Database Layer:
• Prisma ORM
• Database migrations
• Data models (visible in prisma/schema.prisma)
d. External Integrations:
• Homey Device Integration
• Authentication Provider
• Discord Integration
• Sentry for monitoring
[Client Layer (Browser)]
• ↕
[Next.js Frontend Layer]
• ↕
[API Router Layer]
• ↕
[Business Logic Layer]
• ↕
[Database Layer]
Key Relationships to Highlight
• Authentication flow between frontend and auth provider
• API request flow through middleware
• Database interactions through Prisma
• External service communications
• Homey device management flow
Specific Implementation Details
a. Create separate sections for:
• Core application features (/app/control, /app/store)
• API documentation system (/app/docs)
• Authentication system
• Device management system
• Version control system
b. Specialized components:
• API key management
• Homey device integration
• File handling system
• Token encryption
⬡ Frontend Component
⬢ API Endpoint
○ External Service
□ Database Table
↔ Two-way Communication
→ One-way Data Flow
Additional Notes
• Environment configuration handling
• API versioning structure (v1)
• Security boundaries
• Feature flags and configuration points
• Caching layers if implemented