A project to help disaster-relief efforts
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
accounts
camps
collectioncentres
config
docs
help
news
opensalve
.gitignore
Dockerfile
LICENSE
Pipfile
Pipfile.lock
README.md
manage.py
requirements.txt

README.md

OpenSalve

Setup

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 :
    DJANGO_SECRET_KEY='random stuff here...'
    
    For this very purpose, one could use the following code.
    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

Contributing

TODO

  • 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

API Docs

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 (where http://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