- π Tabela de ConteΓΊdo
- π About
- π» Technologies
- β¨ Installation
- βοΈ Config
- π₯ Running
- π€ Test
- π‘ API Specification
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:
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
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.
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
You can also tests the aplication by run:
yarn test
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