Skip to content

web-dave/ngx-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NgxSnake

This is a community project. Snake game.

Techstack

  • Angular
  • NestJs, Prisma
  • Swagger
  • Rxjs

Requirements

  • Node
  • Npm (version ^7.24.2)
  • Npx
  • Docker

Installation/Development

  1. Install all dependencies:
npm run installer
  1. Edit docker compose file in folder docker/{dev,local,test}
  2. Edit dotnet (.env) file's in backend and frontend project
    1. See or better rename .env.template to .env
  3. Start local db docker container:
npm run docker:local:up
  1. Prepare database with prisma:
npm run be:prisma
  1. (optional) use backend/prisma/demo-data.sql for mock entries
  2. Auth0 is the default Identity Provider See more

Generate Frontend Service's

We use ng-openapi-gen to generator service code for Angular

npm run fe:gen-service

Identity provider Auth0

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

FAQ

I can't sign in / user is undefined

  • Remove all process.env references in backend/src/common/authentication.middleware.ts and replace them with the original value from auth0

I have questions about this project


DB Demo Data

URLs

Work with us.

  1. Fork
  2. Make your changes
  3. Run the lint and format scripts for BE/FE
  4. Send a PR

DEV Setup

Installation:

npm run installer

Clean all:

npm run clean

Build all:

npm run build

Test all:

npm run test

Lint all:

npm run lint

Docker

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

Backend

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

Frontend

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published