thalesmacena / nps

A Net Promoter Score made with Node, Typescript, TypeORM and Express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ—‚ Table of Contents

πŸ“‘ About

Nps is a Net Promoter Score api. That measures the willingness of customers to recommend a company's products or services to others. It is used as a proxy for gauging the customer's overall satisfaction with a company's product or service and the customer's loyalty to the brand. This application was made during the Next Level Week 4 presented by Rocketseat

You can check the api specification by clicking her

The administrator can use requests for the api to create users and surveys. In addition they can create a pivo table to relate a user and a survey and thus send an email with the survey for this user to respond to. It is possible to retrieve the net promoter scores for each of the surveys.

This is the template of the email sent to the user:

email template

πŸ’» Technologies

Yarn

Node.js

Typescript

ESLint

Express

TypeORM

Jest

SQLite

Nodemailer

Handlebars

✨ Installation

Open a terminal and run the following commands:

# To copy this repository
git clone https://github.com/thalesmacena/nps.git

# To move to project directory
cd nps

# To install the dependencies
yarn

βš™οΈ Config

You need to configure some environment variables, so rename the .env.example file to .env. Then you need to change the values for your database variables, I recommend using a docker container with postgres and the following environment variables:

# Database

DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_USER=
DB_PASS=
DB_NAME=

renaming DB_USER, DB_PASS and DB_NAME respectively with the postgres username and password and the name of the database created.

πŸ”₯ Running

First you need to create the tables in the database, by running the following command:

yarn typeorm migration:run

You can run the application in development mode with the command:

# To run
yarn dev

The application will run on localhost:3000

πŸ€” Test

You can also tests the aplication by run:

yarn test

πŸ’‘ API Specification

You can acess the api specification (OAS / Swagger) by clicking her or render the OAS locally using the command:

yarn api

The api will render on localhost:8080

About

A Net Promoter Score made with Node, Typescript, TypeORM and Express

License:MIT License


Languages

Language:TypeScript 85.4%Language:Handlebars 9.8%Language:HTML 2.2%Language:JavaScript 2.1%Language:Shell 0.5%