Skip to content

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 >= 2.1.1
  • docker-compose or MySQL

Installation

  1. Clone the repository

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

    cd onlineCAL
    poetry sync --no-root
  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. Change directory

    cd server
  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 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. (Optional) Update dependencies if there have been any changes to them

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

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

    python manage.py collectstatic
  7. 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

Contributing

Stars

Watchers

Forks

Contributors