How dstu-diploma/back_monorepo works
Project Type and Purpose
• This is a backend monorepo hosting multiple microservices for a diploma project’s backend.
• The services (chatservice, hackathonservice, teamservice, userservice) each expose HTTP APIs.
• An Nginx reverse-proxy routes incoming traffic; Postgres stores data; Docker Compose handles orchestration.
Main Components
a. External Frontend
• Next.js/React application (not in this repo).
• Communicates via HTTP requests to Nginx.
b. Nginx Reverse Proxy
• Entry point for all HTTP(S) from frontend or external clients.
• Routes to individual backend services based on URL paths or host headers.
c. Microservices
• chatservice
• hackathonservice
• teamservice
• userservice
Each runs independently, exposing REST or GraphQL endpoints.
d. Database
• PostgreSQL instance (initialized by dev/init_db.sql).
e. Infrastructure / Orchestration
• Docker Compose (docker-compose.example.yml)
• Makefile targets for setup & startup
• dev/nginx.conf for local proxy settings
Relationships & Data Flows
1. Frontend → Nginx: External HTTP requests (Next.js/React → Nginx)
2. Nginx → Microservices: Routes path-based requests to the appropriate service
3. Microservices → Database: Each service issues SQL queries to Postgres
4. Services ↔ Services (optional): If chatservice needs user data, it calls userservice via HTTP or RPC
Architectural Patterns & Principles
• Microservice architecture: each business domain is an independent deployable unit.
• Infrastructure as code: Docker Compose and Makefile scripts standardize environments.
• API gateway pattern: Nginx acts as a single entry point routing to services.
• Separation of concerns: different services manage distinct data and logic.