Backend repository for NTUMods, a course schedule planner for Nanyang Technological University students.
This section will guide you through setting up the project on your local machine without using Docker.
This method is more preferrable for backend developers as you can make use of the automatic reloads provided by Django's
runserver.
Please ensure you have the following installed on your machine:
Use the following command to clone the repository to your local machine:
git clone https://github.com/ntumods-org/ntumods-backend.git
cd ntumods-backendpython3 -m venv venvsource venv/bin/activatevenv\Scripts\activatepip install -r requirements.txtcp .env.example .envpython manage.py migratepython manage.py loaddata sample_data.jsonThis should allow you to login as superuser (admin) with the following credentials:
- Username:
superuser - Password:
123
python manage.py runserverThis section will guide you through setting up the project on your local machine using Docker. It is recommended to use Docker for development to ensure consistency across different environments.
-
Install Docker Desktop based on your operating system (MAC / Windows / Linux) and launch the application.
-
Clone this repository and move into the project directory where
docker-compose.ymlfile is located.git clone https://github.com/ntumods-org/ntumods-backend.git cd ntumods-backend -
Install the server using Docker
docker compose up --build -d
Stop using
Ctrl+C. Re-run this command when you want to start the server again in your local development environment. Your server should be up atlocalhost:8000. Migration should be done automatically when the server is started. -
Load sample data
docker exec -ti ntumods_api python manage.py loaddata sample_data.jsonIf this is the first time you are running the server, please execute this command to load sample data. This should allow you to login as superuser (admin) with the following credentials:
- Username:
superuser - Password:
123
You can execute other utility commands by running
docker exec -ti ntumods_api python manage.py <command>, such as making migrations, executing tests, etc. - Username:
Make sure you have Docker installed.
docker pull postgres
docker run --name postgres-db \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=postgres \
-p 5432:5432 \
-d postgres- 📆 Timetable
- 📖 Course Information
- 🚀 Schedule Optimizer (WIP)
If you want to contribute to NTUMods, please read CONTRIBUTING.md to get started.
NTUMods is open source and available under the AGPL-3.0-or-later license.
