How know-how-ai/know-how-fe works
Main Components
a. Frontend Layer (Next.js Application):
• Component hierarchy using Atomic Design:
• Atoms (basic UI components)
• Molecules (composite components)
• Organisms (complex components)
• Pages (route components)
• State Management (Redux + Redux Toolkit)
• Theme System (Light/Dark modes)
• Local Storage (Redux-persist)
b. Backend Layer (Express.js Application):
• MVC Architecture
• Authentication System (Session-based)
• API Controllers
• Middleware Layer
c. Database Layer:
• MySQL (Primary Database)
• Redis (Session Store)
• Sequelize ORM
d. External Services:
• OpenAI API Integration
• AWS Services (S3, CloudFront, Route 53, Lightsail)
[Client Layer]
• ↓ ↑
[CDN Layer (CloudFront)]
• ↓ ↑
[Frontend Layer (Next.js on S3)]
• ↓ ↑
[API Gateway/Apache Reverse Proxy]
• ↓ ↑
[Backend Layer (Express.js on Lightsail)]
• ↓ ↑
[Database Layer] [External Services]
Important Flows to Highlight
• Authentication flow with session management
• API request/response cycle
• Static asset delivery through CDN
• Database interactions
• OpenAI API integration
• State management flow
Additional Elements
• Security layers (SSL/TLS)
• Caching mechanisms
• Monitoring points (PM2)
Implementation Details
• Keep components proportional to their importance
• Version numbers for major components
• Annotations for key architectural decisions
Remember to maintain a balance between detail and clarity, focusing on the service's unique aspects like the AI integration, atomic design pattern, and multi-layer authentication system.