A comprehensive web application for managing employee mileage expense claims with automated distance calculation and PDF report generation.
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.
- 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
- ASP.NET Core 8.0
- Entity Framework Core
- SQL Server / SQLite
- JWT Authentication
- QuestPDF for PDF generation
- Angular 19
- TypeScript
- Tailwind CSS
- RxJS
- .NET 8.0 SDK or later
- Node.js 18+ and npm
- SQL Server (or SQLite for development)
- Navigate to the Backend directory:
cd Backend- Update the connection string in
appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=MileageClaimDb;Trusted_Connection=true;TrustServerCertificate=true"
}
}- Apply database migrations:
dotnet ef database update- Run the API:
dotnet runThe API will be available at https://localhost:5001 or http://localhost:5000
- Navigate to the Frontend directory:
cd Backend/Frontend- Install dependencies:
npm install- Start the development server:
npm startThe application will be available at http://localhost:4200
Once the backend is running, Swagger documentation is available at:
- Development:
https://localhost:5001/swagger
POST /api/Auth/login- User authenticationPOST /api/Auth/register- User registrationGET /api/MileageClaims- Get all claims (filtered by role)POST /api/MileageClaims- Create new claimPUT /api/MileageClaims/{id}/status- Update claim status (Admin only)GET /api/MileageClaims/{id}/pdf- Download claim as PDFGET /api/MileageClaims/stats- Get dashboard statistics
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
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
- JWT token-based authentication
- Password hashing with ASP.NET Core Identity
- Role-based authorization
- HTTPS enforced in production
- CORS configured for Angular frontend
This project is licensed under the MIT License.
Developed by Bless
For issues and questions, please open an issue on GitHub.