Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Husky Leave Management System

A premium, full-stack leave management application built with Vue 3, Node.js, and MongoDB.

Features

  • 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.

🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB Atlas account (or local MongoDB instance)

Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd HuskyAssignment
  2. Backend Setup:

    cd backend
    npm install
    • Create a .env file in the backend folder:
      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
  3. Frontend Setup:

    cd ../frontend
    npm install
    npm run dev
    • The app will be available at http://localhost:5173.

🛠 API Endpoints

Authentication

  • POST /api/auth/register - Register a new user (name, email, password, role).
  • POST /api/auth/login - Login and receive JWT.

Leave Management

  • 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).

📦 Deployment

Backend

  1. Build the TypeScript files:
    cd backend
    npm run build
  2. Deploy the dist folder to a platform like Heroku, Render, or a VPS.
  3. Ensure Environment Variables are set in the production environment.

Frontend

  1. Build the production bundle:
    cd frontend
    npm run build
  2. The dist folder will contain static assets.
  3. Deploy to Netlify, Vercel, or host as static files on a CDN.

🏗 Tech Stack

  • Frontend: Vue 3, TypeScript, Pinia, Tailwind CSS, Vite.
  • Backend: Node.js, Express, TypeScript, Mongoose.
  • Database: MongoDB Atlas.

About

Assignment for Husky Voice

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages