How spo-iitk/ras-backend works
Project Type & Purpose
• This is a backend microservice application (“Recruitment Automation System”) for managing placements at IIT Kanpur.
• It exposes multiple services (Auth, Student, Company, Recruitment Cycle (RC), Application) running on distinct ports behind an Nginx reverse proxy.
• It uses Go (Gin + GORM), PostgreSQL (one database per service), Docker, and Nginx, with inter-service IPC (future gRPC).
File-Structure & Architectural Patterns
• Top-Level Directories:
• cmd/ – entry-points for each service (admin, auth, company, ras, student, verification, etc.)
• auth/, student/, company/, rc/, application/, ras/ – service codebases, each with router.go, config.go, model.go, DB adapters, handlers.
• container/ – Dockerfile, init.sql, nginx.conf for deployment.
• config/, constants/, middleware/, util/ – shared configuration, constants (roles), cross-cutting middleware.
• mail/ – mail-service integration.
• Pattern: Microservices, each with its own database schema under service/model.go. Services communicate via HTTP (internal IPC), proxied by Nginx.
• Deployment: Docker Compose orchestrates containers, init.sql bootstraps databases, nginx.conf routes incoming API calls.
Key Insights from README
• Five microservices: Auth, Student, Company, Recruitment Cycle (RC), Application.
• Each has its own PostgreSQL database & user (created via container/init.sql).
• Services run on distinct ports; Nginx reverse proxy directs requests based on URL paths.
• Mail and Google Calendar integrations use secrets (secret.yml, GCP credentials).
Essential Details
• Ports or base-paths (e.g., /auth/* → Auth Service).
• Database schemas reside per service (model.go).
• Docker network—services and Nginx communicate over an internal Docker bridge.