This is a community project. Snake game.
- Angular
- NestJs, Prisma
- Swagger
- Rxjs
- Node
- Npm (version ^7.24.2)
- Npx
- Docker
- Install all dependencies:
npm run installer
- Edit docker compose file in folder docker/{dev,local,test}
- Edit dotnet (.env) file's in backend and frontend project
- See or better rename .env.template to .env
- Start local db docker container:
npm run docker:local:up
- Prepare database with prisma:
npm run be:prisma
- (optional) use backend/prisma/demo-data.sql for mock entries
- Auth0 is the default Identity Provider See more
We use ng-openapi-gen to generator service code for Angular
npm run fe:gen-service
In this project, Auth0 is used as Identity Provider. Click on this link to see how quick and easy you can use Auth0 in your project.
When you have finished all configurations on Auth0, edit the dotenv file (.env) in the frontend project and enter all the necessary data:
API_URL=http://localhost:3000
DOMAIN=DOMAIN
CLIENT_ID=CLIENT_ID
AUDIENCE=AUDIENCE
IS_PRODUCTION=false/true
To complete the configuration, then run the following command
npm run config
In the backend project edit the dotenv file (.env) and enter all the necessary data:
APP_RUN_PORT=3000
DATABASE_URL=mysql://root:dev@localhost:3306/ngx_snake
DOMAIN=DOMAIN
CLIENT_ID=CLIENT_ID
AUDIENCE=AUDIENCE
- Remove all
process.env
references inbackend/src/common/authentication.middleware.ts
and replace them with the original value from auth0
- For the first setup you can find demo data in ./backend/prisma/demo-data.sql
- Just import this script with your DB client
- Backend Swagger: http://localhost:3000/api
- Frontend: http://localhost:4200
- Fork
- Make your changes
- Run the lint and format scripts for BE/FE
- Send a PR
Installation:
npm run installer
Clean all:
npm run clean
Build all:
npm run build
Test all:
npm run test
Lint all:
npm run lint
Start local db docker container:
npm run docker:local:up
Stop local db docker container:
npm run docker:local:down
Start local db docker container for tests:
npm run docker:test:up
Stop local db docker container for tests:
npm run docker:test:down
Start dev stack (db, backend, frontend in docker):
npm run docker:dev:up
Stop dev stack (db, backend, frontend in docker):
npm run docker:dev:down
First Start - generate prisma client and deploy migrations to DB:
npm run be:prisma
Development/Start:
npm run be:watch
Clean:
npm run be:clean
Build:
npm run be:build
Test:
npm run be:test
Lint:
npm run be:lint
For the first setup you can find demo data in /backend/prisma/demo-data.sql
Development/Start:
npm run fe:watch
Clean:
npm run fe:clean
Build:
npm run fe:build
Test:
npm run fe:test
Lint:
npm run fe:lint