Skip to content

Lighten is a web-based tool for social service providers to store, update, and exchange social services information through a universal standard. We are solving the problem of quickly getting the right help to the right people, by making it easy to get the right information to the right people.

License

Notifications You must be signed in to change notification settings

sfbrigade/lighten-api

Repository files navigation

lighten-api

CircleCI

This repo contains the Lighten API which runs on Heroku at https://lighten-api.herokuapp.com/.

Initial Setup

The steps here only need to be run once.

  1. Install Docker for Mac from https://docs.docker.com/docker-for-mac/

  2. Install the Heroku CLI

      brew install heroku
    
  3. Clone the lighten-api repo and submodules

      git clone [email protected]:sfbrigade/lighten-api.git
      cd lighten-api
      git submodule update --init --recursive
    
  4. Create an .env file for holding environment variables

      echo "SECRET_KEY=$(openssl rand -hex 24)" > .env
    
  5. Bring up the development services

      docker-compose up -d
    
  6. Initialize the database

      docker-compose exec api python manage.py migrate
    
  7. Load initial data via fixtures

      docker-compose exec api python manage.py loaddata lighten_api/organization
    
  8. Create a superuser

      docker-compose exec api python manage.py createsuperuser
    
  9. Stop the development services

      docker-compose stop
    

Development

  1. Bring up the development services

      docker-compose up --build
    

    The --build option ensures any new dependencies are included.

  2. Open the development API

      open http://localhost:8080
    
  3. Run tests as needed

      docker-compose exec api python manage.py test
    

Migrations

If you make any changes to the data models, you'll need to commit migrations

docker-compose exec api python manage.py makemigrations
git add */migrations
git commit

Production

  1. Deploy to Heroku

      git push heroku master
    
  2. Open the production API

      heroku open
    

Migrations

If you made any changes to the data models, you'll need to apply migrations

heroku run python manage.py migrate

Importing datasets from the data repo

Development

docker-compose exec api bin/import-dataset development

Production

docker-compose exec api bin/import-dataset production

Documentation

For more information about using Python and Docker on Heroku, see these Dev Center articles:

About

Lighten is a web-based tool for social service providers to store, update, and exchange social services information through a universal standard. We are solving the problem of quickly getting the right help to the right people, by making it easy to get the right information to the right people.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published