LeaveFlow is a full-stack leave management system built for organizations to streamline employee leave requests and employer approvals. Employees can submit leave applications, track their status, and view history. Employers can review, approve, or reject leave requests from a centralized dashboard.
The application uses role-based access control to separate employee and employer functionalities.
| Layer | Technology |
|---|---|
| Frontend | Vue.js 3, Vue Router, Pinia, Vite |
| Styling | Tailwind CSS |
| Backend | Node.js, Express.js |
| Database | MongoDB (Atlas M0 - Free Tier) |
| Auth | JWT (JSON Web Tokens), bcrypt |
| Hosting | AWS EC2 (t3.micro), Nginx, PM2 |
http://13.201.35.53
Employee Login
Email : coppisetty.venkat2024@vitstudent.ac.in
Password : Ujwal@2311
Employer Login
Email : srinu23.coppisetty@gmail.com
Password : srinu@123
- Node.js v18+
- npm
- MongoDB Atlas account (or local MongoDB instance)
git clone https://github.com/ujwal2311/Leave-Management-System-.git
cd Leave-Management-System-cd backend
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secret
npm install
npm startThe backend runs on http://localhost:5000.
cd frontend
cp .env.example .env
# Edit .env with your backend API URL
npm install
npm run devThe frontend runs on http://localhost:5173.
backend/.env
PORT=5000
MONGO_URI=your_mongodb_atlas_uri
JWT_SECRET=your_jwt_secret
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
frontend/.env
VITE_API_BASE_URL=http://localhost:5000/api
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
| POST | /api/auth/register | No | Register a new user |
| POST | /api/auth/login | No | Login and receive JWT |
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
| GET | /api/leaves/mine | Employee | Get all leaves for logged-in user |
| POST | /api/leaves/apply | Employee | Submit a new leave application |
| GET | /api/leaves/all | Employer | Get all leave applications |
| PATCH | /api/leaves/:id | Employer | Approve or reject a leave request |
| Method | Endpoint | Auth Required | Description |
|---|---|---|---|
| GET | /api/health | No | API status check |
Browser --> Nginx (:80) --> Vue.js /dist (static files)
--> proxy_pass /api/* --> Node.js (:5000) --> MongoDB Atlas
- Instance: AWS EC2 t3.micro (Free Tier), Ubuntu 22.04 LTS
- Region: ap-south-1 (Mumbai)
- Web Server: Nginx - serves frontend static files and reverse proxies API requests
- Process Manager: PM2 - keeps the Node.js backend running with auto-restart
- Database: MongoDB Atlas M0 (Free Tier) - managed cloud database
- Security: Port 5000 is not exposed publicly; API is only accessible through Nginx
# System setup
sudo apt update && sudo apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs nginx git
sudo npm install -g pm2
# Clone and install
git clone https://github.com/ujwal2311/Leave-Management-System-.git
cd Leave-Management-System-/backend && npm install
cd ../frontend && npm install && npm run build
# Start backend with PM2
cd ../backend
pm2 start server.js --name leaveflow-backend
pm2 save && pm2 startup
# Configure Nginx
# - Serve frontend/dist on port 80
# - Reverse proxy /api/* to localhost:5000
# - Enable try_files for Vue Router history mode
sudo systemctl restart nginx && sudo systemctl enable nginxLeave-Management-System-/
├── backend/
│ ├── config/
│ │ └── db.js
│ ├── controllers/
│ │ ├── auth.controller.js
│ │ └── leave.controller.js
│ ├── middleware/
│ │ └── auth.js
│ ├── models/
│ │ ├── Leave.js
│ │ └── User.js
│ ├── routes/
│ │ ├── auth.routes.js
│ │ └── leave.routes.js
│ ├── server.js
│ ├── package.json
│ └── .env.example
├── frontend/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├── router/
│ │ ├── store/
│ │ ├── views/
│ │ ├── App.vue
│ │ └── main.js
│ ├── package.json
│ ├── vite.config.js
│ └── .env.example
└── README.md
MIT License - Ujwal Coppisetty




