An online portal developed in Django to manage CAL BPHC's instrument booking process.
gitpython>= 3.10poetry>= 2.1.1docker-composeorMySQL
-
Clone the repository
git clone https://github.com/CAL-BPHC/onlineCAL.git
-
Install dependencies
cd onlineCAL poetry sync --no-root -
Setup the database
-
The project uses MySQL as the database. You can either install MySQL or use the docker-compose file provided.
-
If you are using MySQL, create a database that you will use for the project.
-
If you are using the docker-compose file, run the following command
docker-compose -f server/docker-compose.yaml up
-
Create a
db.conffile in theserverdirectory following the format indb.conf.example. Use the same details if you're using Docker; otherwise, adjust them to match your MySQL setup.
-
-
Change directory
cd server -
Run the migrations
python manage.py migrate
-
Create a superuser for accessing the admin panel
python manage.py createsuperuser
-
Run the server
python manage.py runserver
The deployment process is automated through GitHub Actions, with a workflow that triggers on every push to the master branch.
If, for any reason, changes need to be deployed manually, the following steps can be followed, as they mirror the actions performed by the workflow:
-
SSH into the server using the private key file provided
-
Navigate to the project directory
cd /home/ubuntu/onlineCAL/server -
Pull the latest changes from the repository
git pull origin master
-
(Optional) Update dependencies if there have been any changes to them
poetry sync --no-root
-
(Optional) Run migrations if there are any new ones
python manage.py migrate
-
(Optional) Collect static files if there have been any changes
python manage.py collectstatic
-
Restart supervisor
sudo supervisorctl restart onlineCAL
Server configuration details are available here.