This is a simple website used to connect Donors of Plasma and Hospitals for the treatment of COVID19. Plasma therapy is recently started in India and this website will act as a platform to connect nearby donor with hospitals the require plasma.
Deployment system architecture
- This project uses google maps API. Go to https://console.cloud.google.com/ and create a new project.
- Create an API key
- Activate the following services for the API key
- Geolocation API
- Maps Javascript API
- Places API
Add the API KEY to the .env file. (Follow the installation below)
-
Clone the repository by running the following command in the terminal :
git clone https://github.com/abbasidaniyal/PlasmaHelp.git
-
Install virtualenv. Run the following commands in terminal:
pip install virtualenv
-
Create a virtual environment and activate it.
python -m venv <path>/<env_name> source <path>/<env_name>/bin/activate (Linux) <path>\<env_name>\Scripts\activate (Windows)
The environment will be created in the specified path.
-
navigate into the repository by running the following command in terminal:
cd plasmahelp
-
Install dependencies by running the following command:
pip install -r requirements.txt
-
Create a .env file using the .env.sample format in the root directory
-
Run the Django standard runserver steps:
python manage.py makemigrations python manage.py migrate python manage.py runserver
Your website will be up and running at http://localhost:8000
-
Create a .env file and a .env_postgis file from the .env.sample file and .env_postgis.sample. Simply copy the contents and setup required environment variables.
Note : Make sure that the db settings in both the files are same.
-
Install Docker and Docker-compose in your system. Use the following commands.
For docker : https://docs.docker.com/get-docker/
For docker-compose : https://docs.docker.com/compose/install/
-
Create an empty directory named
postgres
. This will be the volume mount point for the db.mkdir postgres
-
If you simply wish to run the project, use the following command:
docker-compose up
-
If you want to develop using auto reload, use
docker-compose up db
This will start the database container. Then you can start django by running
./django_setup.sh
-
Install pre-commit hooks : Already in requirements.txt (pip install pre-commit)
-
Run the folloing to install pre-commit
pre-commit install