Git Product home page Git Product logo

api-rest's Introduction

๐Ÿ“ก API REST

The project is composed of two different APIs REST. One is based on a SQL database (Postgres) and the other on a NoSQL database (Mongodb).

PostgreSQL with Sequelize

It makes use of the Node ORM Sequelize. The schema is very simple, only three entities: User, Address and Tech. The one-to-many (User-Address) and many-to-many (User-Tech) relationships are covered. Each controller have all the CRUD operations and one controller more is added to make reports (ReportController), like listing users with gmail accounts living in a specific street and pointing in case they are attached to a technology starting with 'React%'.

Prerequisites

It is neccessary to fill your database configuration at: sql-sequelize/src/config/database.js.

MongoDB with Mongoose

It makes use of the Node ORM Mongoose. The structure is again very simple: User, Task and Project. This API provides "forgot password" funcionality by sending by email a generated token to be used when changing the password. This token is stored at the database as well as one expiry time for security reasons (both will be checked at reset password function). Another security measure is the encryption of the password before being stored at the database (using bcrypt module). Finally, the tokens generated (with jwt module) are signed with the "secret" located at config/auth.json.

Prerequisites

  • To test the API you will need to connect the project to your database, filling the configuration at: config/database.json.
  • Also, in order to send reset password emails, is required to fill the mail configuration document. For testing purpose you can create a free account at Mailtrap.io and use the configuration parameters at config/mail.json.
  • Finally you can choose your own secret to sign the tokens with, at config/auth.json.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.