https://github.com/francislagares/node-code-assessment
This is a Node.js REST API assessment to evaluate tech skills.
https://github.com/francislagares/node-code-assessment
express mongodb nodejs oop prisma redis-cache rest-api typescript
Last synced: 2 months ago
JSON representation
This is a Node.js REST API assessment to evaluate tech skills.
- Host: GitHub
- URL: https://github.com/francislagares/node-code-assessment
- Owner: francislagares
- Created: 2023-05-06T12:39:00.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-14T18:33:26.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T13:21:26.326Z (about 1 year ago)
- Topics: express, mongodb, nodejs, oop, prisma, redis-cache, rest-api, typescript
- Language: TypeScript
- Homepage:
- Size: 11.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Node TypeScript Express Boilerplate
Starter Node.js project with TypeScript, MongoDB, Prisma ORM, ESlint, Prettier and Husky.
Features
--------
- **OOP**
- **Typescript**
- **MongoDB**
- **Prisma ORM**
- **Redis in-memory cache**
- **Swagger documentation**
- **class-validator** for validating controller json input
- **ES6 next features**
Prerequisites
-------------
- [Node.js 20 or higher](http://nodejs.org)
- [NPM 9.5.6 or higher](https://www.npmjs.com/)
- [MongoDB](https://www.mongodb.org/downloads)
- [Docker](https://docs.docker.com/desktop/install/linux-install/)
- [Docker Compose](https://docs.docker.com/compose/install/)
# Docker
- First create MongoDB database
```bash
$ docker compose -f docker-compose-mongodb.yaml up -d
```
- Right after create a Redis instance
```bash
$ docker compose -f docker-compose-redis.yaml up -d
```
## Run the Project
----------------
- Install the dependencies by running the following command.
```bash
yarn install
```
- Start the development server:
```bash
yarn start:dev
```
- Start the test suites:
```bash
yarn test
```
## Run the Project with PM2
----------------------------
PM2 is a Node.js process manager that comes with a built-in load balancer. It helps facilitate production deployments and enables you to keep running applications alive indefinitely.
These are the commands to run the application with PM2:
- Start development environment:
```bash
yarn deploy:dev
```
- Start production environment:
```bash
yarn deploy:prod
```
A logs folder will automatically be created at root level for all your running applications.
You can check the logs by with the following command:
```bash
npx pm2 logs
```
For a more detailed information check the docs -- [PM2](https://pm2.keymetrics.io/)
## API Docs
------------
You can check all API endpoints auto-generated by Swagger docs:
[http://localhost:4000/api-docs](http://localhost:4000/api-docs)
# Author
Created by [@francislagares](https://www.linkedin.com/in/francislagares/) - feel free to contact me!
*