CRUD App with React Hooks (+Axios)
A simple CRUD (Create, Retrieve, Update, Delete) app with React Hooks (+Axios) consuming a simple Node.js API server (+Sequelize Sqlite).

Install Dependencies
Shell
x
1
1
npm init -y
Shell
1
1
1
npm i express
Shell
1
1
1
npm i sequelize
Shell
1
1
1
npm i sqlite3
Shell
1
1
1
npm i cors
Shell
1
1
1
npm i --save-dev sequelize-cli
React.js Express SQLite3 CRUD App Using Sequelize & Node.js
index.js
JavaScript
1
15
15
1
const express = require('express');
2
const cors = require('cors');
3
4
const app = express();
5
const PORT = 3333;
6
7
app.use(express.urlencoded({ extended: false }));
8
9
app.use(cors());
10
11
app.use(require('./routes'));
12
13
app.listen(PORT, () => {
14
console.log(`Server started at: http://localhost:${PORT}`);
15
});
Frontend Dependencies
CSS Style – (HTML tags on index.html): Materialize
Shell
1
1
1
npm start
Start react app. Port: http://localhost:3000
Backend Dependencies
Shell
1
1
1
npm start
Start API server. Port: http://localhost:3333
Database in: database/database.sqlite
The database.sqlite already contains some data.
Api routes:
VERB | ROUTE |
---|---|
get | /api |
post | /api |
put | /api/:id |
delete | /api/:id |