https://github.com/larissaperinoto/blogs-api
The Blogs API is an APIRest and database for managing the production of blog content.iamento da produção de conteúdo de um blog.
https://github.com/larissaperinoto/blogs-api
express javascript joi jwt mysql nodejs sequelize sql swagger
Last synced: about 2 months ago
JSON representation
The Blogs API is an APIRest and database for managing the production of blog content.iamento da produção de conteúdo de um blog.
- Host: GitHub
- URL: https://github.com/larissaperinoto/blogs-api
- Owner: larissaperinoto
- Created: 2022-10-31T19:03:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T11:37:17.000Z (over 3 years ago)
- Last Synced: 2025-01-12T09:41:01.114Z (over 1 year ago)
- Topics: express, javascript, joi, jwt, mysql, nodejs, sequelize, sql, swagger
- Language: JavaScript
- Homepage:
- Size: 539 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blogs API
[Trybe](https://www.betrybe.com/) is a technology school focused on training Web Developers and the Blogs API project was proposed as an activity to improve studies on back-end development.
## Description
The application is an API and a database with the content of a blog. It must allow creating, reading, updating and removing blog information from the database. It also performs authentication to grant permissions to users.
## Technologies and Tools
In the elaboration of the RESTful API, the **Model-Service-Controller(MSC)** architecture was used.The other technologies and tools were:
- [Node.JS](https://nodejs.org/en/)
- [Express](https://expressjs.com/pt-br/)
- [MySQL](https://www.mysql.com/)
- [Docker](https://www.docker.com/)
- [Sequelize](https://sequelize.org/)
- [Swagger](https://swagger.io/)
## ⚙️ How to use
To run the application start with the repositorie clone using the command bellow.
git clone git@github.com:larissaperinoto/blogs-api.git
Navigate to the project root
cd blogs-api/
Running locally
Obs: To run the application this way you must have [Node](https://nodejs.org/en/) installed on your machine.
In the root of the project run the command below to install the dependencies.
npm install
Login to the database using your credentials.
mysql -u -p
Run the commands to create the **BlogsApi** database
npm prestart
Start the application with nodemon using the command bellow.
npm debug
Running with Docker
Obs: To run the application this way you must have [Docker](https://www.docker.com/) installed on your machine.
In the root of the project, upload the blogs_api and blogs_api_db containers using docker-compose.
docker-compose up -d
Open the blogs_api container terminal.
docker exec -it blogs_api bash
Once in the container terminal, run the command below to install the dependencies.
npm install
To connect with database, open the blogs_api_db container terminal.
docker exec -it blogs_api_db bash
Login to the database using the credentials described in the docker-compose.yaml.
mysql -r root -p
To create the database, run the command bellow in the blogs_api container terminal.
npm prestart
To start the server with nodemon use the command bellow in the terminal of the blogs_api container.
npm run debug
## Routes
You can check all routes by accessing the /docs endpoint in your browser when running the application.
Routes preview


---
Developed by [Larissa Perinoto](www.linkedin.com/in/larissaperinoto), © 2022.