Skip to content
/ nps Public

will an api there? πŸš€ Calculation NPS (evaluations of something) of a registered user ⭐ ⭐ ⭐

License

Notifications You must be signed in to change notification settings

FelipePDS/nps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NPS

NPS API (Net Promoter Score)
Calculation of the NPS of a company, in which it is provided based on the evaluation of the users. The company can calculate the NPS for the diverses subjects it selects. Learn more




πŸ“Œ Topics


πŸ’‘ Project

know the project, the technologies used for its construction and if you want to use the API, see how to use it.


πŸ’­ About

The construction of this NPS API (Net Promoter Score) was to facilitate the evaluation process of a company for example. This questionnaire will be sent to the user's e-mail (which may have the text and style you want), where he will give his rating in relation to the subject and thus the NPS will be calculated based on the evaluation of all users.

The process is based on 3 things as a basis:
πŸ‘€ πŸ” ⭐ The survey, the user, and the user evaluation,
Survey email for evaluation (Title and description) β†’ User β†’ User evaluation β†’ Saved evaluation correlating the user, the survey and the evaluation β†’ Total NPS calculation, see an example:

Example of How it Works


πŸ’» Techs

Backend

β†’ Check the file: package.json

For Dev


πŸ’¬ Use API

Before we see how to use the API, let's understand a little bit about some things about it

🎲 See data modeling to understand a little about its structure:


πŸ“‚ How to Clone

To perform your cloning we need the Gitbash terminal, which we will do using commands that already automate some processes...

# To clone repository
$ git clone https://github.com/FelipePDS/nps.git

# Open
$ cd nps

πŸ”§ How to Configure

Before all install the dependencies (technologies used):

$ yarn add
# OR
$ npm install

Run the Database:

# Execution made with Typeorm (run the migrations and the database)

$ yarn typeorm migration:run
# OR
$ npm run typeorm migration:run
If you want to change the server's execution port: Go to the .env file, change 3333 from both the PORT and USER_ANSWER_URL_MAIL to the port you want

πŸ”‘ How to Run

Before all execute the server:

$ yarn dev
# OR
$ npm dev

# If you have not changed the port, the access URL will be http://localhost:3333/

To perform the execution tests (API Rest) install the Insomnia. Thus it will be possible to send requests for routes...

Take a look at the router.ts file to check the routes and make requests

See what are the parameters needed to make each type of request (and the routes)

  • User
  • Survey
  • Send Mail
  • NPS Calculate

πŸ‘€ User

/* baseURL/users (POST Method) */
{
   "name": "User Example",
   "email": "[email protected]"
}

πŸ” Survey

/* baseURL/surveys (POST Method) */
{
   "title": "Give your evaluation:",
   "description": "From 0 to 10, how much would you recommend Rocketseat?"
}

πŸ“§ Send Mail

/* baseURL/sendMail (POST Method) */
{
   "email": "[email protected]",
   "survey_id": "idOfSomeSearchSavedInTheSystem"
}

⭐ NPS Calculate

baseURL/nps/:survey_id (GET Method)


See better how it works

πŸ“š Documentation (to learn about developing an API)

Documentation about the development. To download the documentation follow the commands in Gitbash :octocat:

# create a folder with the name of the directorie and enter it
$ mkdir documentation && cd documentation

# start a git repository to access the repository
$ git init

# crawl the repositorie
$ git remote add -f origin https://github.com/FelipePDS/nps

# active sparse checkout
$ git config core.sparseCheckout true

# Create a file in the path: .git/nps/sparse-checkout
# And insert the name of the subdirectory you want to clone
$ echo '.github/documentation/' >> .git/nps/sparse-checkout

# pull the subdirectory
$ git pull origin master
Font: terminalroot.com.br

βš“ References (materials)

The entire project was developed during the πŸš€ RocketSeat NLW event, and was aided through documentation as well...


πŸ‘¨ Author

This repository and documentation was made by FelipePDS 🌟


πŸ“‘ License

MIT License Β β€’Β  Β© FelipePDS

About

will an api there? πŸš€ Calculation NPS (evaluations of something) of a registered user ⭐ ⭐ ⭐

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published