Skip to main content

oprec-backend - Documentation

Document Status
Document OwnerProduct Engineering 2026Product Engineering 2026
Contributors
Project Linkshttps://github.com/RistekCSUI/oprec-backendhttps://github.com/RistekCSUI/oprec-backend
Project Linkshttps://api.join.ristek.cs.ui.ac.idhttps://api.join.ristek.cs.ui.ac.id
Project Linkshttps://api.join.ristek.cs.ui.ac.id/__docs/https://api.join.ristek.cs.ui.ac.id/__docs/
TeamTheodore Kevin Himawantheodore.kevin@ristek.cs.ui.ac.id
TeamAri Darrell Muljonodarrell@ristek.cs.ui.ac.id
TeamGrace Karinagracekarin@ristek.cs.ui.ac.id
TeamYeshua Marco G. Manurungmarco@ristek.cs.ui.ac.id

πŸ”Ž Background

Overview​

This service is the Backend API for the RISTEK Open Recruitment website. It acts as the core engine handling user registrations via UI SSO, student profiles, available divisions and specific tasks linked to them, and storing candidate submissions securely.

Stakeholders​

Scope & Boundaries​

  • In Scope: User Profiles, Division listing and tasks, Submissions, SSO/LDAP integration, API authentication, Database models, Admin panel logic.
  • Out of Scope: Frontend application, email delivery mechanism, complex analytics.

βš™οΈ Architecture & Design

System Diagram​

Architecture Decisions (ADRs)​

  • Language/Framework: Python 3.11.3 / Django 3.1.7 / Django Rest Framework
  • Database: PostgreSQL 15 (Relational Data)
  • Communication: Synchronous RESTful API over HTTP, with Token-based Authentication.
  • Documentation Engine: drf_yasg (Swagger/OpenAPI UI integration)
  • Infrastructure setup: Docker managed by docker-compose.yml (dev) and Amazon Elastic Container Registry (ECR).

πŸ’»Technical Specifications

API Documentation​

The application automatically generates OpenAPI specs via drf-yasg located at /__docs/. Sub-routes under /api/: login/: Handles authentication (generates Auth Token) login-ldap/: Alternate login endpoint via LDAP event-deadlines/: Defines timeline for registration, selection, announcements. profile/: Gets/Sets user information. date-time/: Syncs server time with client. submissions/ & submissions/<id>/: Handles file task submission URLs linked to divisions. divisions/ & divisions/tasks/: Renders available divisions and their respective assignment prompts. remaining-task/: Gets remaining unsubmitted tasks per applicant.

Data Model/Schema​

Core entities residing under the openrecruitment app: UserProfile: Contains student demographics, assigned priority divisions. EventDeadline: Stores timeline points like REGISTRATION_START, ANNOUNCEMENT. Division: Contains names, requirements (min/max applicants), descriptions, and deadlines. DivisionInterest & DivisionAchievement: Extends Division details. Task: A specific test assignment tied to a Division. Submission: Binds a UserProfile to a Task providing an external attachment URL.

Project Structure​

oprec-backend/
β”œβ”€β”€ .github/ # GitHub Actions (e.g., CI/CD deploy-staging.yml to ECR)
β”œβ”€β”€ marvel/ # Django project root module; contains settings.py, WSGI/ASGI configurations, root urls.py, CAS handling core logic.
β”œβ”€β”€ openrecruitment/ # Primary Django App for business logic
β”‚ β”œβ”€β”€ api/ # Submodule for DRF Serializers, API views, and sub-routes
β”‚ β”œβ”€β”€ seeds/ # Database seed information (.json files)
β”‚ β”œβ”€β”€ models.py # Database schema map
β”‚ β”œβ”€β”€ views.py # Core endpoints and business action (login logic)
β”‚ β”œβ”€β”€ admin.py # Django internal admin panel schema maps
β”‚ └── apps.py # Django app definition
β”œβ”€β”€ tests/ # Test suite configurations (using django-nose)
β”œβ”€β”€ Dockerfile # Docker setup logic
β”œβ”€β”€ Makefile # Useful build scripts (`make install`, `make run_dev`)
β”œβ”€β”€ dev.docker-compose.yml # PostgreSQL & Django container layout for dev
β”œβ”€β”€ manage.py # Django binary manager
└── requirements.txt # Python pip dependencies

Components​

LayerPathsResponsibility
Django Auth & SSO Modulemarvel/etc/cas.py, openrecruitment/views.pyHooks into University SSO and LDAP schemas providing standard tokens upon verification.
REST Viewsopenrecruitment/api/views.pyOrchestrates endpoints utilizing rest_framework.generics. Features IsAuthenticated checking mapped universally across the backend.
Settings Modulemarvel/settings.pyUtilizes .env with python-dotenv, configuring CORS_ORIGIN_WHITELIST to explicitly list trusted frontends like join.ristek.cs.ui.ac.id.

☁️ Operational Playbook

Infrastructure​

  • Cloud Provider: AWS EC2 Instance (Deployment using manually managed Compose stack).
  • Container Registry: Amazon ECR logic driven by GitHub actions .github/workflows/deploy-staging.yml.
  • Link: [https://api.join.ristek.cs.ui.ac.id]

Environment Variables​

(example)

KeyDescriptionDefault (Dev)Sensitive?
PORTPort mapping8000No
DATABASE_URLFull connection string to remote DB if usedβ€”Yes
DJANGO_ENVApp environment (local/production)localNo
SECRET_KEYSecure Django Cryptographic Keyβ€”Yes
POSTGRES_DBPostgreSQL NameoprecNo
POSTGRES_PORTPostgres host port5432No
POSTGRES_USERDB Userβ€”Yes
POSTGRES_PASSWORDDB Passwordβ€”Yes

πŸ™‹Questions

πŸ—’ List of frequently asked questions or question that need to be answered that is related to this initiative ..