Skip to content

bchelinje/MileageClaimSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Mileage Claim System

A comprehensive web application for managing employee mileage expense claims with automated distance calculation and PDF report generation.

Overview

This system allows employees to submit mileage claims for reimbursement and administrators to review and approve them. It features automatic distance calculation between UK postcodes, role-based access control, and professional PDF report generation.

Features

  • User Authentication: JWT-based authentication with role-based authorization (Admin/Employee)
  • Mileage Claims Management: Create, view, update, and delete mileage claims
  • Automated Distance Calculation: Automatic calculation of distances between UK postcodes
  • PDF Generation: Generate professional PDF reports for approved claims
  • Dashboard Analytics: Track claims statistics, amounts, and status
  • Role-Based Access:
    • Employees can manage their own claims
    • Admins can review and approve all claims

Technology Stack

Backend

  • ASP.NET Core 8.0
  • Entity Framework Core
  • SQL Server / SQLite
  • JWT Authentication
  • QuestPDF for PDF generation

Frontend

  • Angular 19
  • TypeScript
  • Tailwind CSS
  • RxJS

Getting Started

Prerequisites

  • .NET 8.0 SDK or later
  • Node.js 18+ and npm
  • SQL Server (or SQLite for development)

Backend Setup

  1. Navigate to the Backend directory:
cd Backend
  1. Update the connection string in appsettings.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=MileageClaimDb;Trusted_Connection=true;TrustServerCertificate=true"
  }
}
  1. Apply database migrations:
dotnet ef database update
  1. Run the API:
dotnet run

The API will be available at https://localhost:5001 or http://localhost:5000

Frontend Setup

  1. Navigate to the Frontend directory:
cd Backend/Frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm start

The application will be available at http://localhost:4200

API Documentation

Once the backend is running, Swagger documentation is available at:

  • Development: https://localhost:5001/swagger

Main Endpoints

  • POST /api/Auth/login - User authentication
  • POST /api/Auth/register - User registration
  • GET /api/MileageClaims - Get all claims (filtered by role)
  • POST /api/MileageClaims - Create new claim
  • PUT /api/MileageClaims/{id}/status - Update claim status (Admin only)
  • GET /api/MileageClaims/{id}/pdf - Download claim as PDF
  • GET /api/MileageClaims/stats - Get dashboard statistics

Project Structure

MileageClaimSystem/
├── Backend/
│   ├── Controllers/          # API endpoints
│   ├── Data/                 # Database context
│   ├── Dto/                  # Data transfer objects
│   ├── Models/               # Domain models
│   ├── Services/             # Business logic
│   └── Program.cs            # Application entry point
└── Frontend/
    └── src/
        ├── app/
        │   ├── components/   # Angular components
        │   ├── models/       # TypeScript models
        │   └── services/     # API services
        └── assets/           # Static assets

Default Users

After initial setup, you can create users through the registration endpoint or add them directly to the database:

  • Admin: Full access to all claims and approval rights
  • Employee: Access to personal claims only

Security

  • JWT token-based authentication
  • Password hashing with ASP.NET Core Identity
  • Role-based authorization
  • HTTPS enforced in production
  • CORS configured for Angular frontend

License

This project is licensed under the MIT License.

Author

Developed by Bless

Support

For issues and questions, please open an issue on GitHub.

About

A comprehensive web application for managing employee mileage expense claims with automated distance calculation and PDF report generation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors