- install docker. If brew is installed run
brew install docker
. - install chamber. If brew is installed run
brew install chamber
. (This is needed for running functional tests.) - install happy. If brew is installed run
brew install chanzuckerberg/tap/happy
- Follow the steps in [./REMOTE_DEV.md] under "Remote Dev Pre-requisites".
- Run
happy install
to setup the appropriate DNS entries locally for the local development environment. - From the root of this repository, run
make local-init
to build and run the dev environment. The first build takes awhile, but subsequent runs will use cached artifacts. - Visit http://backend.naparinet.local:5000 to view the backend, and http://frontend.naparinet.local:3000 for the frontend.
- Open the source code and start editing!
- Modify code in the
frontend
directory, save your changes and the browser will update in real time. - Modify code in the
backend
directory, and the api will reload automatically.
The dev environment is a set of containers defined in docker-compose.yml. The backend docker image and frontend docker image are built locally. Update any of these files as necessary and run make local-sync
to sync your dev environment with these configs.
Both the frontend and backend services will automatically reload when their source code is modified, but they won't automatically rebuild when their dependencies (such as npm or pip package lists) change.
To update the dev env to reflect changes to client/package.json or backend/requirements.txt, run make local-sync
The dev environment is initialized with AWS Secrets/S3 data in the backend/setup_dev_data.sh script. To add more data, modify these scripts and run make local-init
to reload the dev environment's data stores.
Command | Description | Notes |
---|---|---|
make local-init |
Launch a new local dev env and populate it with test data. | |
make local-start |
Start a local dev environment that's been stopped. | |
make local-stop |
Stop the local dev environment. | |
make local-logs |
Tail the logs of the dev env containers. | Run make local-logs CONTAINER=backend to tail the logs of a specific container. Dev containers are: backend, frontend |
make local-shell CONTAINER=frontend |
Open a command shell in one of the dev containers | Dev containers are: backend, frontend, localstack |
make local-status |
Show the status of the containers in the dev environment. | |
make local-clean |
Remove everything related to the local dev environment (including db data!) | |
make local-sync |
Re-sync the local-environment state after modifying library deps or docker configs |
The dev environment has no network dependencies, but it launches some extra containers to mock external dependencies:
- LocalStack to mock AWS