/Blitz-API

Blitz API - Event management platform for rented spaces

Primary LanguagePythonMIT LicenseMIT

Build Status Coverage Status Updates

Blitz API

Issue manager

Issues are handled in a Redmine instance. Feel free to create an account there to begin contributing!


Command to work

Generation of POT file

Translation are done with Weblate on our own instance.

We do not create or update *.po file inside the repository but ONLY via weblate interface.

To refresh the list of translation string (*.pot) please just execute this command below, it will prepare the *.pot file, that is a template used for every languages in Weblate. (locale fr is specified because we are obliged to set one, but it will do all the languages)

docker-compose run --rm api python manage.py makemessages --locale fr --keep-pot

Quickstart

We're going to install and configure the latest develop build of this API.

Clone the project

First of all, you need to clone the project on your computer with :

git clone https://github.com/FJNR-inc/Blitz-API.git

Create a virtual environment

Virtualenv provides an isolated Python environment, which are more practical than installing packages system-wide. They also allow packages to be installed without administrator privileges.

  1. Create a new virtual environment
virtualenv env
  1. Activate the virtual environment
. env/bin/activate

You need to ensure the virtual environment is active each time you want to launch the project.

Install all requirements

Your OS will need SQLite3 (<3.26) for unit testing.

Requirements of the project are stored in the requirements.txt file. Requirements for development related actions are stored in the requirements-dev.txt file. You can install them with:

WARNING : Make sure your virtual environment is active or you will install the packages system-wide.

pip install -r requirements.txt
pip install -r requirements-dev.txt

Configure the database

Django has a system of database migration. You first need to apply all existing "migrations" to update your local database.

python manage.py migrate

Note: The project uses a squlite3 file as database to simplify developement. Once in production, feel free to switch to a DB server.

Test the installation

You can now launch an instance of the API and visit the included admin website.

To login into the admin page, you'll need to create a superuser:

python manage.py createsuperuser

You can now launch the instance with:

python manage.py runserver

You can now visit the homepage to validate the installation.

http://localhost:8000/ and http://localhost:8000/admin

Custom settings - NOT IMPLEMENTED YET

If you need to have custom settings on your local environment, you can override global settings in apiBlitz/local_settings.py.

Deployment process

  1. Activate Deploy screen on frontend

deploy_page

Need to be execute in frontend repository

npm run deploy:prod:deploy_page
  1. Deploy api code
./utils/deploy_prod.sh
  1. Deploy frontend
npm run deploy:prod