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-serviceIn 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/trueTo complete the configuration, then run the following command
npm run configIn 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.envreferences inbackend/src/common/authentication.middleware.tsand 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 installerClean all:
npm run cleanBuild all:
npm run buildTest all:
npm run testLint all:
npm run lintStart local db docker container:
npm run docker:local:upStop local db docker container:
npm run docker:local:downStart local db docker container for tests:
npm run docker:test:upStop local db docker container for tests:
npm run docker:test:downStart dev stack (db, backend, frontend in docker):
npm run docker:dev:upStop dev stack (db, backend, frontend in docker):
npm run docker:dev:downFirst Start - generate prisma client and deploy migrations to DB:
npm run be:prismaDevelopment/Start:
npm run be:watchClean:
npm run be:cleanBuild:
npm run be:buildTest:
npm run be:testLint:
npm run be:lintFor the first setup you can find demo data in /backend/prisma/demo-data.sql
Development/Start:
npm run fe:watchClean:
npm run fe:cleanBuild:
npm run fe:buildTest:
npm run fe:testLint:
npm run fe:lint