Waterpark's backend API server
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Docker
.env
in the root directory of the monorepo
SERVER_PORT=3001
DB_DATABASE_NAME=clubs
DB_USERNAME=waterpark
DB_PASSWORD=waterpark
DB_PORT=5432
DATABASE_URL=postgresql://waterpark:waterpark@db/clubs
IS_DATABASE_LOCAL=true
- Clone the
waterpark
repository. - In the root directory of
waterpark
, rundocker-compose up
to start the express and postgres servers.
You should see messages in your terminal from the server
and postgres
containers, and finally be greeted with:
We separate our tests into two categories. To run integration tests locally, you must have the entire server running in the background (for now). This might change in the future.
Unit tests: npm run test:unit
Integration tests: npm run test:integration
Here is how to make a migration to our database schemas.
- Make the change to the MikroORM entity of choice. Entities are located in
src/shared/infra/db/entities
. - Run
docker container ls
. Find the container id for the server container. - Run
docker exec -it <CONTAINER_ID> sh
. - Run
npm run migration:create
. - A migration file should now be created in
src/migrations
.
(For Loo Lab members with access to Heroku).
- Login to the Heroku dashboard.
- Click the waterpark pipeline.
- You should see three environments. Review apps, staging, and production. Review apps are automatically created for each PR. Staging is
main
. Any commits merged intomain
will automatically be released to the staging environment. Production is the live environment used for production. - To promote the staging environment to production, simply click the "promote to production" button. You'll be prompted with a modal:
- Click promote
The latest commit (and all the previous commits) in the staging environment will then be promoted to production!
- Typescript - Language
- Express - HTTP Server
- MikroORM - ORM
- Postgres - Database
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the ISC License - see the LICENSE.md file for details