A full-stack web app where students can apply for leave, and teachers/admins can view, accept or reject requests. Built using the MERN stack with a modern, clean UI powered by TailwindCSS + Vite + TypeScript.
- 👤 Role-based Auth (Student & Teacher)
- 📝 Leave Application by Students
- 📋 Admin Panel for Teachers to View & Manage Requests
- ✅ Accept / ❌ Reject Leave Requests
- 🔐 JWT-based Protected Routes
- 💻 Fully Responsive & Clean UI
git clone https://github.com/Hari-hara7/CampusLeave.git
cd backend
npm install
# Create a .env file and add the following:
# MONGO_URI=your_mongodb_connection_string
# JWT_SECRET=your_jwt_secret_key
# PORT=5000
npm run devcd frontend/app
npm install
npm run devCreate a .env file inside the backend folder with the following values:
MONGO_URI=your_mongo_connection_string
JWT_SECRET=your_jwt_secret_key
PORT=5000| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register as Student or Teacher |
| POST | /api/auth/login |
Login and receive JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/leaves/apply |
Apply for leave (Student only) |
| GET | /api/leaves/mystatus |
Get student's own leave status |
| GET | /api/leaves |
Get all leave requests (Teacher only) |
| PATCH | /api/leaves/:id/status |
Accept or Reject leave request (Teacher) |