A premium, full-stack leave management application built with Vue 3, Node.js, and MongoDB.
- Employee Portal: Apply for leave, track application status, and view history.
- Employer Portal: Dashboard with stats, review employee requests, and approve/reject with feedback.
- Secure Auth: JWT-based authentication with role-based access control.
- Modern UI: Dark-themed, responsive design using Tailwind CSS and Lucide icons.
- Node.js (v18 or higher)
- MongoDB Atlas account (or local MongoDB instance)
-
Clone the repository:
git clone <your-repo-url> cd HuskyAssignment
-
Backend Setup:
cd backend npm install- Create a
.envfile in thebackendfolder:PORT=5000 MONGODB_URI=your_mongodb_atlas_connection_string JWT_SECRET=your_super_secret_key NODE_ENV=development
- Start the dev server:
npm run dev
- Create a
-
Frontend Setup:
cd ../frontend npm install npm run dev- The app will be available at
http://localhost:5173.
- The app will be available at
POST /api/auth/register- Register a new user (name,email,password,role).POST /api/auth/login- Login and receive JWT.
POST /api/leave/apply- Submit a leave request (Employee only).GET /api/leave/my-requests- View own requests (Employee only).GET /api/leave/all-requests- View all employee requests (Employer only).PATCH /api/leave/status/:id- Approve or reject a request (Employer only).
- Build the TypeScript files:
cd backend npm run build - Deploy the
distfolder to a platform like Heroku, Render, or a VPS. - Ensure Environment Variables are set in the production environment.
- Build the production bundle:
cd frontend npm run build - The
distfolder will contain static assets. - Deploy to Netlify, Vercel, or host as static files on a CDN.
- Frontend: Vue 3, TypeScript, Pinia, Tailwind CSS, Vite.
- Backend: Node.js, Express, TypeScript, Mongoose.
- Database: MongoDB Atlas.