NTUSU ITC Backend is the server-side application powering the NTUSU ITC Portal. Built with Django REST Framework, it provides APIs and core business logic for modules such as authentication, ULocker, events, and other student-facing services.
This repository supports both local development and production deployment, with a containerised development workflow and a cloud-based production architecture spanning Google Cloud Platform and Amazon Web Services.
The project is currently maintained by the NTUSU ITC team.
The application is deployed as a containerised backend service on Google Cloud Run. Production traffic is routed through Amazon Route 53 to Cloud Run via custom Domain Mapping, while backend data is stored in Google Cloud SQL for MySQL. Outbound email functionality is handled through Amazon SES.
A Cloud Build pipeline is connected to this GitHub repository to automate image builds and deployments to Google Artifact Registry and Cloud Run. Static files are located in Amazon S3 and are retrieved during the Docker image build process.
This section will guide you through setting up the project locally to begin contributing to development!
- Docker Desktop (MacOS / Windows / Linux) - for consistent development environment
- Python 3 - for virtual environment setup and local development
- (Optional) MySQL Workbench - for easier management of the database
Clone this repository and change your current directory to the root of the project, where the file, docker-compose.yml, is located:
git clone https://github.com/NTUStudentUnion/ITCBackend.git
cd ITCBackendBuild the images and start the containers with the command:
docker-compose up --build📝 Note: To stop the application, press
CTRL+Cin the terminal!
Your application should now be running at http://localhost:8888/.
Using another terminal, execute the following command:
docker exec -ti SUITC_Backend python manage.py migrateYou should perform this command when:
- setting up the development environment for the first time, or
- there are new migration files added.
Sample data are generated using Django Fixtures. It is used to populate your database (stored in Docker Volumes):
docker exec -ti SUITC_Backend python manage.py loaddata sample_userRunning this command will create a superuser account with the following credentials:
- Username:
superuser - Password:
123
Other sample data can be seen on the fixtures folder (password for other sample user: 1048576#).
⚠️ Warning: Running this command may overwrite some existing data!
To start development, we will create a virtual environment on our local machine:
python3 -m venv venvTo activate the virtual environment we just created, follow the instructions for your respective operating system below:
Use the source command:
source venv/bin/activateIn Command Prompt:
venv\Scripts\activate.batIn PowerShell:
venv\Scripts\Activate.ps1deactivateFinally, install all required dependencies in our newly created virtual environment to finish setting up our local machine for development!
pip install -r requirements.txtThis section is to document any problems that might occur when running the development environment along with its solution, as we all are using different devices which might have slightly different behaviour.
- Note: For M-series chip MacBooks, you must execute the following:
softwareupdate --install-rosetta
export DOCKER_DEFAULT_PLATFORM=linux/amd64In order for you to execute other manage.py utility commands through Docker container, just add docker exec -ti SUITC_Backend (add sudo if you're using MAC) in front of your command. Please ensure that the server is indeed running, open another terminal if needed.
For example, to create new migrations you can run:
docker exec -ti SUITC_Backend python manage.py makemigrationsEverytime you add new features, please create the appropriate test cases. You can run this command to run all test cases in the project:
docker exec -ti SUITC_Backend python manage.py testAutomatic CI testing is enforced everytime a pull request or a push is done to the main branch.
There are 2 types of documentation provided here:
-
Automatic Documentation using Swagger UI
-
Manual Documentation in the
docsapp by writing markdown files (stored locally in this repository) (NOTE: this is not available in the live environment yet)
See some of the manual documentations here:
Production is deployed to Google Cloud Run through Cloud Build, as configured through cloudbuild.yaml.
- Build image using
docker/prod/Dockerfile, retrieving static files from Amazon S3 - Push image to Artifact Registry
- Deploy the latest artifact from Artifact Registry to Cloud Run as a revision
The following environment variables are necessary for production deployment, to be configured in Cloud Run:
PROD=1PROD_HOSTDB_NAME,DB_USER,DB_PASSWORD,DB_HOSTAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_STORAGE_BUCKET_NAME,EVENTS_CSV_BUCKET_NAMES3_ACCESS_KEY_ID,S3_SECRET_ACCESS_KEYSES_ACCESS_KEY_ID,SES_SECRET_ACCESS_KEY
📝 Note: Sensitive values should be stored securely using Google Secret Manager!
Hosts the manual API documentation, written as Markdown files and served through the backend. An alternative to the auto-generated Swagger UI for human-readable endpoint guides.
Event management and check-in system for NTUSU internal events. Supports creating and managing events with configurable access rules (e.g. allow non-undergraduates or exchange students), auto start/end based on scheduled times, event officers with token-based mobile check-in, and matric number check-in tracking.
General-purpose portal APIs. Manages update notes (changelog entries shown to users) and a feedback form system that supports bug reports, feature requests, improvement suggestions, and ITC recruitment enquiries.
Authentication and user identity layer for the entire backend. Implements a custom Django user model with email-based login, JWT access/refresh token authentication, and a custom token mechanism for password reset and email verification flows.
Student locker booking and management system. Models locations, individual lockers, and bookings with allocation status tracking. Includes admin configuration, QR code generation support, and a ULockerAdmin role for managing the system.
These apps remain in the codebase for historical reference but are no longer actively maintained or exposed in production:
UFacility, Inventory, Indexswapper, StarsWar, Workshop, Communication, Games, UShop

