An online portal developed in Django to manage CAL BPHC's instrument booking process.
git
python
>= 3.10poetry
>= 1.8.4docker-compose
orMySQL
-
Clone the repository
git clone https://github.com/CAL-BPHC/onlineCAL.git
-
Install dependencies
cd onlineCAL poetry install
-
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.conf
file in theserver
directory following the format indb.conf.example
. Use the same details if you're using Docker; otherwise, adjust them to match your MySQL setup.
-
-
Activate the virtual environment
poetry shell
-
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 available here 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
-
Start the poetry shell
poetry shell
-
(Optional) Install dependencies if there have been any updates to them
poetry install --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.