This project is a RESTful API for a blog system, where you may sign in to make a post.
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.
JavaScript | Express | Sequelize | Node.JS | MySQL | JWT | Joi | Docker | Insomnia |
---|---|---|---|---|---|---|---|---|
- Clone the repository and enter it
git clone git@github.com:ImVictorM/Blog-API.git && cd Blog-API
You must have docker installed
- Get the containers running
docker-compose up -d
- Enter the server's container
docker exec -it blogs_api bash
- Install the dependencies
npm install
- Start the server
npm run start
---- or ----
npm run prestart
npm run debug
You must have node and MySQL installed
- Install the dependencies
npm install
-
Rename the file
.env.example
to.env
-
Start the server
npm run start
---- or ----
npm run prestart
npm run debug
Click here to export automatically:
Or just import the file insomniaEndpoints.json
inside your environment: https://docs.insomnia.rest/insomnia/import-export-data