ProHealth : A Project to improve health in rural areas.
-
Clone this repo, preferably using ssh clone instead of https, so that you won't be bothered for password everytime you push or pull.
git clone git@gitlab.com:TeamADDS/ProHealth.git
-
We use
postgresql
for database. Installation Guide- Depending on the job, you may want to install pgcli or pgadmin4(provides graphical ui).
- Create database. Open
psql
(or,pgcli
) and enter following sql query.
CREATE DATABASE prohealth
If you want other database name to be other than
prohealth
, you may need to add a environment variable of the database name) -
cd
into this repo(where you cloned it). You will see the following repo structure roughly.. ├── backend ├── .coverage ├── env.example ├── frontend ├── .git ├── .gitignore ├── .gitlab-ci.yml └── README.md
- There's clear separation between backend and frontend.
- Now create a virtual environment for python and activate.
-
On shell,
python -m venv backend/venv
On Windows if above didn't work,
c:\Python36\python -m venv c:\path\to\venv
. ^[1] -
Activate:
source backend/venv/bin/activate
On Windows, either use
backend\venv\Scripts\activate.bat
oncmd.exe
orbackend\venv\Scripts\Activate.ps1
onPowerShell
(default on Windows 10). -
Test if it's working.
which python
should return the path having the current directory somewhere in the parent of the path.
-
-
Install all the requirements (
pip install -r backend/requirements/local.txt
). -
Copy file
env.example
from root of this repo in a new file.env
(dot env) in same directory.cp env.example .env
Warning: Don't delete
env.example
though.
-
Open the file and change
user
with database owner(usually theusername
) andpass
with your database password(usually your user password). -
cd backend
if you are not already in. -
Make migrations file and then migrate.
python manage.py makemigrations
python manage.py migrate
Not working? Maybe you forgot to activate virtual environment?
-
Run test to ensure everything is working.
python manage.py test
Tests failed? It's likely that the setup didn't go well. Maybe, you skipped something.
-
Change directory to
frontend
directory, from the root of the repo. -
Install dependencies for frontend and run tests for verifying everything.
npm install
npm test
Tests fine? Congratulations. Now, the tedious setup has come to an end.
-
Run
node
server.npm run start
-
Run backend server from backend directory.
python manage.py runserver
-
Now, open localhost:8000.
Don't want to run two servers? Fine. Not recommended if you are working on frontend. You may lose out the perks that
node
provides.- Build bundle using
npm build
. - Uncomment the line
#DJANGO_BUILD_WEBPACK=True
- Rerun the backend server(running node server not required as it's already built)
- Visit localhost:8000 as usual.
- Build bundle using
- Create an issue before you start working on.
- Create an
WIP
merge request and branch for working on that issue. - Only work on the issue and don't mix it with others.
- At least one should review it before merging.
- Be helpful on other's issues and suggest and discuss potential solutions.
- Master should be auto-deployable, so code cannot be pushed in it.
- Pull that using
git pull --all
and checkout to the new branch(git checkout <branchname>
).