Skip to content

Latest commit

 

History

History
116 lines (102 loc) · 2.92 KB

README.md

File metadata and controls

116 lines (102 loc) · 2.92 KB

Back-End Project

Table of Contents
  1. About the project
  2. APIs
  3. Installation
  4. Built With
  5. Framework
  6. Check APIs
  7. Contact

About the project

The project consists in the creation of 7 APIs or endpoints, three for registration, login and logout; and the other 4 allow a user to create, edit, delete or view all posts.

APIs

APIs for registration, login and logout

  • Registration :
(Method:POST)   http://127.0.0.1:8080/auth/register
  • Login :
(Method:POST)   http://127.0.0.1:8080/auth/login
  • Logout :
(Method:DELETE) http://127.0.0.1:8080/auth/logout

APIs for posts

  • Create a post :
(Method:POST)  http://127.0.0.1:8080/feed/posts
  • Edit a post :
(Method:PUT)   http://127.0.0.1:8080/feed/posts/:id
  • List all posts :
(Method:GET)   http://127.0.0.1:8080/feed/posts
  • Delete a post :
(Method:DELETE) http://127.0.0.1:8080/feed/posts/:id

Installation

  1. Clone the repo :
git clone https://github.com/pierre1590/Back-end_project_start2impact
  1. Setup a MySQL Database;
  2. Import the migration file migration_script.sql
  3. Create a nodemon.json file and fill it with your DB data:
{
    "env" : {
        "NODE_PORT" : "",
        "NODE_DATABASE" : "",
        "NODE_DATABASE_USER" : "",
        "NODE_DATABASE_PW" : "",
        "NODE_DATABASE_URL" : "" 
    }
}
  1. In the root folder, create a directory named Public and in this last folder create another folder called img to allocate the images.

  2. Install project dependencies :

     npm install 
  1. Start the server :
     npm start

Built with

  • Body-parser
  • Express-validator
  • Node.js
  • MySQL
  • Sequelize
  • JSON Web Tokens
  • Bcryptjs
  • Multer
  • uuid
  • nodemon

Framework

  • Express.js

Check APIs

To verify that the end-points worked I used Talend API Tester - Free edition, but you can also use other apps like Postman.

  1. Create a project.
  2. Add a request.
  3. Select the method(GET,POST,...) and type the link in the address bar:
http://localhost:port/
  1. Click on the "save" button and then on the "send" button.
  2. You will see the response.

Contact

Piero Sabino - @SabinoPiero - P137ru590 - Piero Sabino - [email protected]

Project Link: https://github.com/pierre1590/Back-end_project_start2impact