How dsc-mcmaster-u/ai-journal works
Main Components
a) Client Layer:
• Next.js Frontend Application
• Auth Module (login)
• Main Application Module (dashboard, journals, stats, settings)
• UI Components Layer
• Custom Hooks Layer
b) Server Layer:
• Express.js Backend
• Controllers Layer
• Services Layer
• Routes Layer
• Middleware Layer
• Authentication System (Passport.js)
c) Database Layer:
• MySQL Database
d) External Services:
• AI Integration (mentioned in project description)
• Authentication Service
• Cloud Infrastructure (Google Cloud)
Architecture Pattern Representation
┌─ Client Layer ─────────────────────┐
• Next.js Frontend │
• ┌─────────────┐ ┌─────────────┐ │
• Auth Module │ │ Main Module │ │
• ┘ └─────────────┘ │
• ┌─────────────┐ ┌─────────────┐ │
• UI Layer │ │ Hooks Layer │ │
• ┘ └─────────────┘ │
• ┬───────────────────┘
┌───────────────▼───────────────────┐
• API Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Controllers │ │ Routes │ │
• ┘ └─────────────┘ │
• ┌─────────────┐ ┌─────────────┐ │
• Services │ │ Middleware │ │
• ┘ └─────────────┘ │
• ┬───────────────────┘
┌───────────────▼───────────────────┐
• Data Layer │
• ┌─────────────┐ │
• MySQL │ │
• ┘ │
• ┘
Key Relationships to Highlight
• Frontend to Backend communication via REST APIs
• Authentication flow between client, server, and database
• Data flow for journal entries and mood tracking
• Integration points with AI services
• Database interactions from various services
DevOps Infrastructure
A separate section showing:
• Docker containers
• Kubernetes orchestration
• Google Cloud deployment
• CI/CD pipelines (shown in .github/workflows)