This is a project made with NodeJS, Express, Sequelize and Swagger to make the interactions with the API more intuitive
Create a SQL database that will store the data (you'll have to update the config.json file later for the connection to be successful)
MySQL example
CREATE DATABASE database_name;
Clone the project
git clone git@github.com:gabrielsimplicio00/SQL-CRUD-API.git
Enter in the project's directory
cd SQL-CRUD-API
Install dependencies
npm install
Run the server with node
npm start
Or nodemon
npm run dev
In this project I used a local MySQL database, fill this projects's config.json file with your SQL account's login, password and database name to be able use this API properly
{
"development": {
"username": "your_username",
"password": "your_password",
"database": "database_name",
"host": "127.0.0.1",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
}
Since the migrations and seeders files are already created, you will only have to run these commands in order to create tables in your database and fill them with data
Run Migrations
npx sequelize-cli db:migrate
Seeding
npx sequelize-cli db:seed:all
Front-end: Swagger
Back-end: Node, Express, Sequelize/MySQL