How ogumakouta/shift-calendar works
Project Type and Purpose
• This is a full-stack web application (“Shift Calendar”) that unifies work-shift scheduling and personal event management.
• Users register/log in, configure workplaces, add/edit/delete shifts and private events, manage event labels, and view monthly salary calculations.
File Structure Analysis
• Top level:
• backend/ – NestJS API service (TypeScript, Prisma ORM, JWT auth)
• frontend/ – Next.js UI (TypeScript, React, Tailwind CSS)
• nginx/ – Nginx reverse-proxy configuration
• docker-compose.yml & docker-compose.prod.yml – container orchestration
• backend/src modules: auth, user, workplace, event, event-label, prisma service
• frontend: app routes under src/app (calendar, login, signup, setting), reusable React components
• Prisma migrations & schema define MySQL tables and relations
• Dockerfiles in both backend and frontend, plus Compose files, point to containerized deployment
Key Architectural Elements from README
• API endpoints (REST) for auth, user, workplace, event, event-label
• Database: MySQL 8.0, connected via Prisma
• Authentication: JWT + bcrypt
• Frontend SSR/CSR via Next.js, calling BACKEND_PORT=8000
• Infrastructure: Docker Compose network, Nginx for routing static assets and API calls
Main Components
a. Client Layer
• Browser/Device running Next.js pages (calendar, login, signup, settings)
• React components invoking Fetch API
b. Reverse Proxy Layer
• Nginx container forwarding requests to frontend (port 3000) and backend (port 8000)
c. Application Layer
• Frontend Service container (Next.js)
• Backend Service container (NestJS)
• Internal modules: Auth, User, Workplace, Event, Event-Label
• Prisma Service for DB access
d. Data Layer
• MySQL database container
• Prisma migrations and schema
e. Orchestration & Networking
• Docker network linking all containers
• docker-compose.yml for dev, docker-compose.prod.yml for prod
Relationships & Data Flows
• User’s browser → HTTP/HTTPS → Nginx
• Static asset requests → Frontend container
• API calls (/auth, /create, /getEvents, etc.) → Backend container
• Backend container → SQL queries → MySQL container via Prisma
• Backend issues JWTs to client; client includes JWT in Authorization header
• docker-compose manages service startup order, shared network
Architectural Patterns & Principles
• Layered architecture: presentation (UI) → API layer → persistence
• Module-based organization in backend (NestJS modules)
• Infrastructure-as-code: containerization, environment separation (dev vs prod)
• Single monolithic API (not microservices) but clear module boundaries
• CI/CD readiness: docker-compose for deployment