Introduction to Kantinator

Welcome to the Kantinator documentation. This guide will help you understand the architecture and features of the canteen management system.

What is Kantinator?

Kantinator is a modern canteen management system built with .NET 10 that provides:

  • Menu Management: Create and manage weekly menus with daily variations
  • Order System: Allow users to preorder meals
  • Authentication: Secure JWT-based authentication with role-based permissions
  • Multi-tier Architecture: Separated API service and web frontend

Architecture

The solution consists of several projects:

Kantinator.ApiService

The backend REST API built with ASP.NET Core that provides:

  • RESTful endpoints for all canteen operations
  • MySQL database integration via Entity Framework Core
  • JWT token-based authentication
  • Role and permission management
  • OpenAPI/Swagger documentation

Key components:

  • Controllers: Handle HTTP requests and responses
  • Services: Contain business logic
  • Repositories: Data access layer
  • Models: Entity Framework entities
  • DTOs: Data transfer objects for API communication

Kantinator.Web

The frontend application built with Blazor providing a modern, responsive user interface.

Kantinator.ServiceDefaults

Shared configuration and service defaults used across the solution.

Authentication & Security

The API uses JWT (JSON Web Tokens) for authentication:

  1. Users authenticate via the /api/auth endpoints
  2. Receive a JWT access token and refresh token
  3. Include the access token in subsequent requests
  4. Refresh tokens when they expire

The system includes:

  • Role-based access control
  • Permission management
  • Secure password hashing
  • Refresh token rotation for enhanced security

Database

The system uses MySQL with Entity Framework Core for data persistence:

  • Code-first migrations for database schema management
  • Repository pattern for data access
  • Entities for Users, Menus, Orders, Roles, and Permissions

See the Database Structure article for detailed schema diagrams and entity relationships.

Getting Started with the API

See the API Reference for detailed documentation of all endpoints, services, and models.

Common Use Cases

  1. Authentication: Use AuthController to login and get JWT tokens
  2. View Menus: Use MenuController to retrieve weekly and daily menus
  3. Place Orders: Submit preorders through the API
  4. User Management: Manage users, roles, and permissions

Development

Prerequisites

  • .NET 10 SDK
  • MySQL Server
  • Your favorite IDE (Visual Studio, Rider, or VS Code)

Building the Documentation

This documentation is generated using DocFX. To build it locally:

cd docs
docfx --serve

Then navigate to http://localhost:8080