- Be sure you have docker/docker-compose and yarn (or npm, if you use it) installed.
- Clone the repository by running
git clone https://github.com/CITi-UFPE/monorepo-boilerplate.git
- Install all the dependencies by running
yarn install
# or
npm install
- Create a .env file and copy the following content to it:
# ###### GENERAL SETTINGS #######
PROJECT_NAME=boilerplate
# ###### SERVER SETTINGS #######
SERVER_PORT=3001
NODE_ENV=development
# ###### DATABASE SETTINGS #######
DATABASE_TYPE=postgres
DATABASE_HOST=${PROJECT_NAME}-db
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=docker
DATABASE_DB=${PROJECT_NAME}
# ###### TEST DATABASE SETTINGS #######
DATABASE_TEST_HOST=localhost
DATABASE_TEST_PORT=5433
DATABASE_TEST_USER=postgres
DATABASE_TEST_PASSWORD=docker
DATABASE_TEST_DB=${PROJECT_NAME}-test
DATABASE_URL=${DATABASE_TYPE}://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_DB}
- To run the development server, run
docker-compose up
- To run the migrations, run the server as described and on a new terminal, run:
yarn migration
- Now the server should be running!