Skip to content

FreyDv/login-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello this is simple guide how to start up project from scratch

Unfortunately i didn't have time to finished FE part and position was mostly BE that's why I prepare FE template but nothing else in FE directory

In folder ./task you can find Technical and task the I created to myself to have a plan

I am a little bit change initial requirements to make project interesting for me) So sorry that the project does not fully and clearly meet your requirements

There are two-way of run:

  • CONTAINER: whole in docker BE and BD will up thrue docker and docker compose (No ability to run e2e test locally)

  • LOCAL_BE_WITH_DOCKER_DB: db in docker and BE app on local machine (You can go through request with debugger and inspect all part of BE using e2e)

Prerequisite:

  • installed nvm
  • nestjs/cli
  • installed docker and docker compose
  • ability to add config in system file /etc/hosts (Needed only for LOCAL_BE_WITH_DOCKER_DB way)

Get repo locally

git clone https://github.com/FreyDv/login-user.git

Change branch

git git checkout fans-crm

Prepare environment for run

nvm use 20.10.0
npm i @nestjs/cli -g

Create mock .env file fro local demonstration

echo "PORT=3000
JWT_SECRET=XmOLkLnbgUlgdo8768TBbLm3NISVRjxR
DB_HOST=db
DB_PORT=3306
MYSQL_DATABASE=lu
MYSQL_ROOT_PASSWORD=sudolu
MYSQL_USER=lu
MYSQL_PASSWORD=lu
DEBUG=false" >> be/.env

LOCAL_BE_WITH_DOCKER_DB

Change Directory to BE (all next command should run under be dir)

cd be

Install dependency

npm i 

Add this line to your hosts file to allow BE have access to your DB in container

sudo echo "127.0.0.1 db" > /etc/hosts

Or

sudo nano /etc/hosts and add next line manually
127.0.0.1 db

Up Database in container

npm run up:db

Start App in debug mode you can connect to debug process based on you default debug port address

npm run start:debug

Run in CONTAINER

Change Directory to BE (all next command should run under be dir)

cd be

Install dependency

npm i 

Run container with DB

npm run up:db

Run Wait script for DB

npm run wait:db

Run container with BE

npm run up:be

Finally Visit OpenApi Swagger Documentation on local address

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors