Skip to content

An online portal to manage CAL BPHC's instrument booking process

License

Notifications You must be signed in to change notification settings

CAL-BPHC/onlineCAL

Repository files navigation

onlineCAL

An online portal developed in Django to manage CAL BPHC's instrument booking process.

Development Setup

Prerequisites

  • git
  • python >= 3.10
  • poetry >= 1.8.4
  • docker-compose or MySQL

Installation

  1. Clone the repository

    git clone https://github.com/CAL-BPHC/onlineCAL.git
  2. Install dependencies

    cd onlineCAL
    poetry install
  3. 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 the server directory following the format in db.conf.example. Use the same details if you're using Docker; otherwise, adjust them to match your MySQL setup.

  4. Activate the virtual environment

    poetry shell
  5. Run the migrations

     python manage.py migrate
  6. Create a superuser for accessing the admin panel

    python manage.py createsuperuser
  7. Run the server

     python manage.py runserver

Deployment

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:

  1. SSH into the server using the private key file provided

  2. Navigate to the project directory

    cd /home/ubuntu/onlineCAL/server
  3. Pull the latest changes from the repository

     git pull origin master
  4. Start the poetry shell

     poetry shell
  5. (Optional) Install dependencies if there have been any updates to them

     poetry install --no-root
  6. (Optional) Run migrations if there are any new ones

     python manage.py migrate
  7. (Optional) Collect static files if there have been any changes

     python manage.py collectstatic
  8. Restart supervisor

     sudo supervisorctl restart onlineCAL

Hosting

Server configuration details are available here.

About

An online portal to manage CAL BPHC's instrument booking process

Resources

License

Stars

Watchers

Forks

Languages