Before setting up the project, ensure that you have the following installed on your system:
git clone https://github.com/brendel-group/mission_db.git
cd mission_dbTo compile opencv-python with the support for h264 codec some system packages are required:
sudo apt install cmake gcc g++ python3-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgtk-3-dev x264 libx264-dev- install cmake
cd backend
pip install -r requirements.txt This will install all required python packages and compile opencv-python which may take up to 30 minutes.
cd frontend
npm install We are using postgreSQL for our database, so please make sure that you have it installed. Setting up your database can either be done in the PostgreSQL shell or in the pgAdmin GUI:
- access the shell:
sudo -u postgres psql`- create a new server and user:
CREATE USER <username> WITH SUPERUSER PASSWORD <password>;- create a new database:
CREATE DATABASE <db_name>;- expand the desired server and PostgreSQL insallation
- rightclick the databases section and click on create
Create a .env file in the backend/backend directory and configure the required environment variables. Refer to the following template:
DATABASE_URL=postgres://username:password@localhost:5432/db_name
SECRET_KEY=your_secret_key # django secret keyFor authentication purposes, you need to create a user:
cd backend
python cli.py
user add --name <username>You will then be asked to define your password and confirm it afterwards. These credentials will then be used when loggin in.
In order that logging in on the frontend also authenticates you to access the database, we need to set the cookie domain accordingly.
You can either set an environment variable COOKIE_DOMAIN in the previously created .env file, or change the default value of the COOKIE_DOMAIN variable in the backend/backend/settings.py file. If you are using the mission explorer locally, the domain should be localhost, if it's deployed externally, it should be the corresponding domain.
In order to synchronise your local files with the database, first, you have to save the files in the backend/media folder. Then you'll need to start the CLI:
cd backend
python cli.py
synccd backend
python manage.py runserver cd frontend
npm run build
npm start Go to the URL provided after running npm start and login using the credentials you have created in the CLI.
This guide should help you get the project up and running quickly. If you encounter issues, check the respective README files in the documentation.