BossaBox-VUTTR-Challenge
Your task is to build an API and database for the VUTTR (Very Useful Tools to Remember) application. The application is a simple repository for managing tools with their names, links, descriptions and tags.
AWS - http://54.233.153.138:3000/
Your task is to build an API and database for the VUTTR (Very Useful Tools to Remember) application. The application is a simple repository for managing tools with their names, links, descriptions and tags. Use a Git repository (public, preferably) for versioning and making the code available.
All the files have comments in the code.
The function of each route is described in the file index.apib.
# yarn
yarn install
# or npm
npm installYou need to edit the file .env, above explains what each option does
-
COOKIES_SECRET (More info)
A random string that will encrypt and sign the cookies 🍪
Example:Vanilla -
DB_AUTH
A string that contains the database protocol, the username, password and host
mongodb+srv://<username>:<password>@cluster0.aaaaa.bbb.mongodb.net/<dbname> -
DB_NAME
The database name
mongodb+srv://<username>:<password>@cluster0.aaaaa.bbb.mongodb.net/<dbname> -
GITHUB_PUBLIC
The GitHub OAuth public key
Example:f5234892909e905f5eee -
GITHUB_SECRET
The GitHub OAuth secret key
Example:6953076013f8e8a79b601781da3ea84a7f70415c -
JWT_SECRET (More info)
A random string that will encrypt and sign the JWT (JSON Web Token)
Example:idk, a random string -
PORT (More info)
"A 16-bit unsigned number, known as the port number" ~ Wikipedia
Default:3000
COOKIES_SECRET=Gradma´s love
JWT_SECRET=1234567890
DB_AUTH=mongodb+srv://user:[email protected]
DB_NAME=database
GITHUB_PUBLIC=f5234892909e905f5eee
GITHUB_SECRET=6953076013f8e8a79b601781da3ea84a7f70415c
PORT=897- Apiary as API Blueprint Editor
- Codacy as Code Grade and Code Coverage analyser
- Travis CI as Continuous Integration (CI)
- Talend API Tester as API Tester
- VS Code Insiders as Integrated Development Environment (IDE), with the extensions:
- ESLint is used to check syntax, find problems and enforce code style in JavaScript
- GitHub Pull Requests and Issues
- Jest is used to automatically execute jest tests and facilitate test debugging
- Jest Snippets adds jest snippets to the VSCode
- markdownlint is used to check syntax, find problems and enforce code style in Markdown
- npm Intellisense autocompletes npm modules in import statements
- Dependencies
- axios is my favourite promise based HTTP client
- cookie-parser is used as a Cookie 🍪 parser that handles signed Cookies 🍪🍪
- dotenv is a simple module to load environment variables from a .env file
- express is my favourite web framework for node
- express-rate-limit is a simple rate limiter to express to prevent DDOS and authentication vulnerabilities (More info)
- helmet is used to protect the server against some web vulnerabilites (More info)
- joi is used to validate the user [POST] request at /tools
- jsonwebtoken is a module that implements Json Web Token (Learn more about) that is used in the proccess of the user authentication
- mongoose is a MongoDB object modeling, that is used as a module to access the MongoDB
- Dev Dependencies
- {@commitlint/config-conventional, @commitlint/cli}, {commitizen, cz-conventional-changelog} and husky are used to enforce a commit style
- @commitlint/travis-cli is used to implement commitlint to Travis CI
- eslint is used to check syntax, find problems and enforce code style, with the standard popular guide
- eslint-plugin-jest is a plugin that implements Jest to the ESLint
- jest is used to make tests
- nodemon is used to facilitate the development, because it restarts the node application when file changes in the directory are detected
- set-cookie-parser is a simple module that parsers the Set-Cookie header to an object that is used in tests
- supertest is used to test routes and middlewares
The only missing tests are errors that are difficult to reproduce, but their results are predictable and tested, and OAuths, that cannot be tested automatically.
