2022-10-31 12:18:25 -04:00
2022-10-28 12:48:22 -04:00
2022-06-29 08:47:36 -07:00
2022-10-25 11:53:24 -04:00
2022-10-28 12:58:07 +00:00
2022-10-28 12:58:07 +00:00
2022-10-28 12:58:07 +00:00
2022-10-28 12:48:22 -04:00

US Notify API

This project is the core of Notify. It's cloned from the brilliant work of the team at GOV.UK Notify, cheers!

This repo contains:

  • A public-facing REST API for Notify, which teams can integrate with using API clients built by UK
  • An internal-only REST API built using Flask to manage services, users, templates, etc., which the admin UI talks to)
  • Asynchronous workers built using Celery to put things on queues and read them off to be processed, sent to providers, updated, etc.

Our other repositories are:

Documentation, here and elsewhere

About Notify

Infrastructure

Common dev work

UK docs that may still be helpful

Local setup

Direct installation

  1. Set up Postgres && Redis on your machine

  2. Install pipenv

  3. Install dependencies into a virtual environment

    make bootstrap

  4. Create the .env file

    cp sample.env .env
    # follow the instructions in .env
    
  5. Run Flask

    make run-flask

  6. Run Celery

    make run-celery

VS Code && Docker installation

If you're working in VS Code, you can also leverage Docker for a containerized dev environment

  1. Create the .env file

    cp sample.env .env
    # follow the instructions in .env
    
  2. Install the Remote-Containers plug-in in VS Code

  3. With Docker running, create the network:

    docker network create notify-network

  4. Using the command palette (shift+cmd+p) or green button thingy in the bottom left, search and select “Remote Containers: Open Folder in Container...” When prompted, choose devcontainer-api folder (note: this is a subfolder of notification-api). This will startup the container in a new window, replacing the current one.

  5. Wait a few minutes while things happen 🍵

  6. Open a VS Code terminal and run the Flask application:

    make run-flask

  7. Open another VS Code terminal and run Celery:

    make run-celery

NOTE: when you change .env in the future, you'll need to rebuild the devcontainer for the change to take effect. Vscode should detect the change and prompt you with a toast notification during a cached build. If not, you can find a manual rebuild in command pallette or just docker rm the notifications-api container.

Description
The API powering Notify.gov
Readme 56 MiB
Languages
Python 98.5%
HCL 0.6%
Jinja 0.5%
Shell 0.3%
Makefile 0.1%