2019 October 16 : OpenSalve is now part of rebuildearth project. The repo has been moved to GitLab.. See also the devsprint openhack.tech where we further develop OpenSalve
After cloning the repo,
- Setup
pipenv
- With the repo folder as the present working directory, setup the environment :
pipenv install
- Open file
.env
and set secret key :For this very purpose, one could use the following code.DJANGO_SECRET_KEY='random stuff here...'
import random "".join([random.SystemRandom().choice('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(96)])
- Activate environment :
pipenv shell
- Migrate :
python manage.py makemigrations && python manage.py migrate
- Start server :
python manage.py runserver
- Follow the PEP 8 Coding Standards
- Use meaningful commit messages
- Document things as necessary
- User Accounts
- Login/Register
- User Roles
- Help Requests
- Register request
- Get request complete info
- Resolve request
- Status of request
- Comments on request
- Visualize request in maps
- Editing requests
- Prioritizing Requests
- Live location with GPS
- Camps
- Add & List
- Camp requirements
- Inhabitants
- Allow camp manager to add
- Collection Centres
- Add & List
- Supplies required
- List quantity, unit
- Stock view
Use an interactive API documentation from /docs after setting up OpenSalve locally on http://127.0.0.1:8000
.
Or use the online API docs.
Steps to generate static API docs :
- Install
spectacle-docs
:npm install -g spectacle-docs
- Save the OpenAPI in JSON format to
api.json
file (wherehttp://127.0.0.1:8000
is where OpenSalve is running) :curl http://127.0.0.1:8000/docs/?format=openapi > api.json
- Generate docs :
spectacle api.json -t docs
- Cleanup :
rm api.json
Or use this one liner :
curl http://127.0.0.1:8000/docs/?format=openapi > api.json && spectacle api.json -t docs && rm api.json