Project description
The app is built using Docker. On Intel Macs, Docker can be used natively or from within a Linux environment, which can be virtualized using Vagrant, VirtualBox, and Ansible:
On Apple Silicon Macs, and on Linux hosts, all you need is Docker.
Install the application and all required dependencies. For Vagrant-based development, use:
./scripts/setup --vagrant
For Docker-based development, use:
./scripts/setup --docker
Municipal data can be downloaded with a script:
./scripts/fetch-data
A pre-commit hook that runs the format script before any commit will be
installed but can always be ignored with git commit --no-verify
.
Rebuild Docker images and run application.
vagrant up
vagrant ssh
./scripts/update
./scripts/server
After running setup
(or resetdb
), three test users are created:
User | Password | Role |
---|---|---|
a1@azavea.com | password | administrator |
v1@azavea.com | password | validator |
c1@azavea.com | password | contributor |
Service | Port |
---|---|
Webpack Dev Server | 4545 |
Gunicorn for Django app | 8181 |
./scripts/test
For Vagrant-based development environments, run setup
on your host, and all
other scripts inside the Vagrant VM. For Docker-based development environments,
all scripts should be run from the host.
Name | Description |
---|---|
cibuild |
Build project for CI |
clean |
Free disk space by cleaning up dangling Docker images |
console |
Run interactive shell inside application container |
lint |
Lint source code |
server |
Run Docker Compose services |
setup |
Provision Vagrant VM and run update and resetdb |
test |
Run unit tests |
update |
Build Docker images |
resetdb |
Restore development database to defaults (with test data) |
To add a new NPM package to the project:
package.json
file, ensuring that you
pin it to a specific version../scripts/update
in the VM.package.json
yarn.lock
package.json
,
manually add the package name to the vendor
array in webpack.config.json