Employee salary management webapp
Client: React, TypeScript
Server: Node, Express
Database: MySQL
Database Configurations
- Create a new MySQL database called backend
backend
- Inside the backend folder change the config/db.js for database configurarions
module.exports = {
HOST: 'localhost',
USER: 'root',
PASSWORD: '',
DB: 'backend',
dialect: 'mysql',
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
}
}
Backend Configurations
- Do you want to change backend port, change the index.js PORT variable
const PORT = 8081;
- Do you want to change frontend cross URL, change the index.js coreOptions variable
let coreOptions = {
origin: "http://localhost:3000",
};
Frontend Configurations
- Do you want to change backend cross URL, change the .env file REACT_APP_API_URL
REACT_APP_API_URL=http://localhost:8081
To run backend, run the following command
cd backend
npm install
npm start
To run frontend, run the following command
cd frontend
npm install
npm start
GET /api/employees
POST /api/employees/upload
PUT /api/employees/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of item to fetch |
DELETE /api/employees/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of item to fetch |