A web application where employees can apply for leave and the employers can either approve or reject the requests.
Tech Stack: Vue.js + Tailwind CSS (Frontend), Node.js + Express (Backend), MongoDB Atlas (Database)
Live URL: http://16.16.186.125/
- Sign up / Log in
- Apply for leave (type, start date, end date, reason)
- View all own leave requests with status (Pending / Approved / Rejected)
- Overlap detection — cannot apply for duplicate date ranges
- Dashboard stats (total, pending, approved, rejected)
- Sign up / Log in
- View all employee leave requests (with filter by status)
- Approve or Reject requests with an optional review note
- Dashboard stats overview
- Go to cloud.mongodb.com and create a free account
- Create a cluster -> M0 Free Tier
- Create a database user with a username and password
- Network Access → Add IP Address → enter
0.0.0.0/0 - Connect → Drivers → copy the connection string
- Go to aws.amazon.com
- Go to EC2 and Launch Instance
- AMI: Ubuntu 24.04 LTS
- Instance type: t3.micro
- Key pair: Create new → download
.pemfile - Firewall: enable HTTP
- Once running → connect to EC2 instance
sudo apt update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs nginx unzip
sudo npm install -g pm2- Upload the project zip file to EC2 and then unzip it
- backend folder -> create a .env file for environment variables with MongoDB URI and JWT secret.
- Run npm install and start with PM2.
- frontend folder -> run npm install and npm run build.
- Configure Nginx to serve the frontend and proxy API requests to the backend.
- Access the app at http://16.16.186.125/
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register as employee or employer |
| POST | /api/auth/login | Login and receive JWT token |
| GET | /api/auth/me | Get current logged in user |
| Method | Endpoint | Role | Description |
|---|---|---|---|
| POST | /api/leaves | Employee | Apply for leave |
| GET | /api/leaves/my | Employee | View own leave requests |
| GET | /api/leaves | Employer | View all leave requests |
| PATCH | /api/leaves/:id/review | Employer | Approve or reject a leave |
| GET | /api/leaves/stats | Employer | Get counts by status |
User's Browser
↓
AWS EC2 (Ubuntu 24.04, t3.micro)
├── Nginx (port 80)
│ ├── /* → Vue.js frontend
│ └── /api/* → Node.js backend (port 5000)
└── Node.js + Express (managed by PM2)
↓
MongoDB Atlas