Skip to content

ImVictorM/Blog-API

Repository files navigation

Blog API πŸ“

Project Context πŸ’‘

This project is a RESTful API for a blog system, where you may sign in to make a post.

Acquired Knowledge πŸ“–

In this project, I was able to:

  • Use Sequelize to integrate the database with the application;
  • Create migrations using Sequelize;
  • Create associations M:N, 1:N and 1:1 between tables with Sequelize;
  • Use Sequelize transactions to do atomic operations in the database;
  • Authenticate users using JWT token.

Main Technologies used 🧰

JavaScript Express Sequelize Node.JS MySQL JWT Joi Docker Insomnia
javascript express sequelize nodejs mysql jwt joi docker insomnia

Running the application βš™οΈ

  1. Clone the repository and enter it
git clone git@github.com:ImVictorM/Blog-API.git && cd Blog-API

Methods

πŸ‹ Running with docker (recommended)

You must have docker installed

  1. Get the containers running
docker-compose up -d
  1. Enter the server's container
docker exec -it blogs_api bash
  1. Install the dependencies
npm install
  1. Start the server
npm run start
---- or ----
npm run prestart
npm run debug

πŸ–₯️ Running locally

You must have node and MySQL installed

  1. Install the dependencies
npm install
  1. Rename the file .env.example to .env

  2. Start the server

npm run start
---- or ----
npm run prestart
npm run debug

Endpoints 🌐

Click here to export automatically:

Run in Insomnia}

Or just import the file insomniaEndpoints.json inside your environment: https://docs.insomnia.rest/insomnia/import-export-data