Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

subins2000/OpenSalve

Repository files navigation

OpenSalve

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

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

About

A project to help disaster-relief efforts. Moved to GitLab : https://gitlab.com/rebuildearth/OpenSalve

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published