Open game analytics
This project uses a package.json
file only to run scripts through yarn (preferred) or npm.
-
Create your .env file from the template
cp .env.template .env
-
To build & start containers, run
yarn start
-
To avoid rebuilding containers upon start, run
yarn start-no-build
-
To test docker container by logging into CLI
- Enter/connect to the container
yarn connect-backend
oryarn connect-frontend
- Stop containers
yarn run stop
- Remove containers
yarn run remove
- Enter/connect to the container
-
To run the test suite on the backend, run the container, connect to it, and run
yarn test
-
To run the backend in watch mode, first stop the existing backend container. Then use the command
docker-compose run --service-ports backend yarn watch
.
Migrations are created in TypeScript in the backend/migrations_src
directory and compiled to the standard backend/migrations
directory in JS, before being run.
To build and run the migrations, use npx knex migrate
on the backend.
The adminer
Docker image is useful for examining the database. To connect, open a browser to port http://localhost:9091. Enter the following:
- System:
PostgreSQL
- Server:
db
- User: from
.env
file - Password: from
.env
file - Database: from
.env
file
To create an admin account, run yarn seed
on the backend. It will create an account with the email ADMIN_EMAIL
and ADMIN_PASSWORD
, if they are in the .env
file, or they will use a preset email and random password. The account information will be written to standard out.