This is a web application that allows caregivers to locate accessible universal changing stations.
There are some things you'll want to read through before you get into the project.
- Follow the Developer Setup Guide to get the app up and running locally.
- Follow the Start-Up Learning guide to learn more about the technologies in the app.
Make sure to read everything thoroughly, and try to complete all the steps. Some of it may be somewhat confusing, but stick with it. It may take some time, but we believe in you!
Beyond the basics, there is some advanced tooling that may help with the development of the project.
Create an .env file in the back-end
directory and add the following
SECRET_KEY="<secret key>"
The Secret Key can be any string, its the key for the JWT.
Once the .env file has been created, cd
into the back-end directory, and run these:
npm install
npm run server
The backing database for this project is Postgres. Easiest way to get one of those running locally is simply to use Docker. You can use the following command to get a Postgis enabled Postgres instance up and running.
docker-compose up -d
We also spin up an instance of pgAdmin4 to make querying the database easy. It runs on http://localhost:5050.
Login credentials can be found in the docker-compose.yaml file.
In order to keep databases up-to-date with schema changes, this repo uses sequelize-auto-migrations-v2 to manage and run schema migrations.
Use the following commands for common tasks for schema migrations:
-
Check migrations status for the current db:
npx sequelize-cli db:migrate:status
ornpm run db-status
-
Run any pending migrations:
npx sequelize-cli db:migrate
ornpm run db-up
-
Revert db changes from the last migration:
npx sequelize-cli db:migrate:undo
or ornpm run db-down
-
Add a new migration script by updating your models and then running:
cd back-end NODE_ENV=local npx makemigration --name '<name that describes you changes>'
For the front-end, you should be able to simply cd
into the front-end directory, and run this:
npm install
npm run start
You can also use Nx to build, run, and manage projects in this repository.
First, install Nx with npm install nx --location=global
.
Next, it's possible to run any script for any project anywhere in the repo, with no need to change directories to that project.
Use nx <script-name> <project-name>
where script-name
is the npm script defined in the project's package.json to run, and project-name
is the name specified in the project's package.json
name field.
Here are some examples showing how to run the front-end and back-end.
-
Start UCT Locator Front-End
nx start uct-locator-front-end
-
Start UCT Locator Back-End
nx server uct-locator-back-end