This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
You need to install these tools before you can run this project :
git https://github.com/mohamilin/gorry-well
cd gorry-well
Database :
Create database with MongoDB
Install dependencies:
npm install
Set environment variables:
cp .env.example .env
Open .env next setup the environment:
example:
MONGODB_URL=mongodb://127.0.0.1:27017/db_name
JWT_SECRET=ddsdjWWsfln3290V042394gnlgnsdl9324
JWT_ACCESS_EXPIRATION_MINUTES=300
JWT_REFRESH_EXPIRATION_DAYS=2
JWT_RESET_PASSWORD_EXPIRATION_MINUTES=30
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES=30
TOKEN_TYPE_REFRESH=refresh
TOKEN_TYPE_ACCESS=access
TOKEN_TYPE_RESET_PASSWORD=resetPassword
TOKEN_TYPE_VERIFY_EMAIL=verifyEmail
after install dependencies with npm install
Install husky:
npm run prepare
Running localy:
npm run dev
Running DB seed:
npm run dev:seed
Testing:
# run all tests and coverage
npm run test
Linting:
# run ESLint
npm run lint
# fix ESLint errors
npm run lint:fix
# run prettier
npm run prettier:check
# fix prettier
npm prettier:fix
# format code
npm run format
Before Commit:
# running for prettier and test
npm run pre-commit
Docker Support for DEV:
# run docker dev
npm run docker:dev
The requirment for running this documentation, you must running db seed
.
To view the list of available APIs and their specifications, run the server and go to http://localhost:3000/api/v1
in postman.
or use dowload collection and environment :
This project completed with unit test (mocking data) and the coverage 100%.