GSA-TTS / 10x-nad-ch

The National Address Database Collaboration Hub (NAD-CH)
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

10x National Address Database Collaboration Hub (NAD-CH)

Local Development

Install poetry so that you can run tests and scripts locally.

Clone the repostiory:

git clone https://github.com/GSA-TTS/10x-nad-ch/

In order to set up a local development environment, you will need to download Docker.

To set the necessary environment variables, copy the sample.env file to a new file named .env in the same directory:

cp sample.env .env

Update all settings defaulted to <add_a_key_here>.

Install frontend dependencies and run in development mode:

cd nad_ch/controllers/web
npm install
npm run dev

Return to the project's root directory and run the following command to build the app and start up its services:

docker compose up --build

To create database migrations (add comment associated with migration in quotes):

docker exec nad-ch-dev-local poetry run alembic revision --autogenerate -m "ENTER COMMENT"

To run database migrations:

docker exec nad-ch-dev-local poetry run alembic upgrade head

To downgrade database migrations:

docker exec nad-ch-dev-local poetry run alembic downgrade <enter down_revision id>

Testing

Some tests in the test suite are dependent on Minio operations and access key is required. To Create a Minio access key, visit the Minio webui at minio-webui and under User/Access Keys, click Create access key. Save the credentials to your .env file under S3_ACCESS_KEY and S3_SECRET_ACCESS_KEY.

Run the test suite as follows:

poetry run test