Explanation of Files
Tech Stack:
- Client Side - ReactJS
- Server Side - NodeJS, Express
Features:
- GET, POST from Database
- Overall List of Leaves
- Individual Leave History
- Config.js
- Contains all the env variables required
- dboperations.js
- Contains all queries
- Connects to SQL Server
- server.js
- Express Server
- Contains all routes
NPM Installs and scripts
//for the entry point put to server.js instead of index.js
npm init
npm i -D nodemon concurrently
npm i mssql dotenv express body-parser cors
npm install http-errors --save
To add into package.json "scripts" (Root) NOT BACKEND FOLDER
"type": "module"
"start": "node backend/server",
"server": "nodemon backend/server",
"client": "npm start --prefix frontend",
"dev": "concurrently \"npm run server\" \"npm run client\""
"data:import": "node backend/seeder -d",
"data:export": "node backend/seeder",
Root to also include .env (Root)
PORT = ... 3002 etc.
SERVER = ...
USER = ...
PASSWORD = ...
DB = ...
NPM Installs and scripts
//for the entry point put to server.js instead of index.js
npm i react-bootstrap axios react-router-dom react-bootstrap-table-next react-dates moment
To add into package.json "scripts" (Frontend)
frontend localhost:3000 & backend on port 3002, need to proxy
"proxy": "http://127.0.0.1:3002",