How tietokilta/web works
Main Components
a. Frontend Layer:
• Next.js Web Application (@tietokilta/web)
• Client-side components
• Server-side components
• API routes
• Internationalization system
b. CMS Layer:
• Payload CMS (@tietokilta/cms)
• Admin Panel
• Content API
• Media Management
• Authentication System
c. Database Layer:
• MongoDB Database
• Collections (boards, committees, documents, etc.)
• Media Storage
d. Shared Components:
• UI Library (@tietokilta/ui)
• Type Definitions (@tietokilta/cms-types)
• Configuration Packages
Architecture Representation
┌─────────────────────────────────────────────────────────────┐
• Client Browsers │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Next.js Web Application │
• ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
• Pages │ │ API │ │ Components │ │
• (App Router)│ │ Routes │ │ (@tietokilta/ui) │
• ┘ └──────────────┘ └──────────────┘ │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Payload CMS │
• ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
• Admin Panel │ │ Content API │ │Media Manager │ │
• ┘ └──────────────┘ └──────────────┘ │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• MongoDB Database │
• ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
• Collections │ │ Media │ │ Versions │ │
• ┘ └──────────────┘ └──────────────┘ │
• ┘
Important Relationships to Highlight
• Next.js app consuming Payload CMS API
• CMS authentication flow
• Database interactions
• Shared component usage
• Internationalization flow
• Media handling pipeline
Additional Elements
• External service integrations (HSL stops, calendar)
• Build and deployment pipeline
• Development tooling
Specific Implementation Details
Technical stack annotations:
• Next.js 14 with App Router
• Payload CMS
• MongoDB
• TypeScript
• Tailwind CSS
• Docker
• pnpm workspace
Development Flow
How the development environment works:
• Local development setup
• Database seeding
• Image storage
• Type generation
• Build process
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this project unique, such as the monorepo structure and the tight integration between the CMS and website components.