Skip to content

shinji-san/MathTrainerDotNet

Repository files navigation

MathTrainerDotNet

Build and Test License: MIT

Math Trainder .NET Demo

πŸ‡©πŸ‡ͺ Deutsche Version | πŸ‡¬πŸ‡§ English Version


Deutsch

Eine Blazor-Webanwendung für Grundschüler zum Üben aller vier Grundrechenarten.

Features

  • 🎲 ZufΓ€llige Aufgabengenerierung mit einstellbarem Zahlenraum
  • βž• Alle Rechenarten: Addition, Subtraktion, Multiplikation, Division
  • πŸ”€ Gemischte Modi:
    • Multiplikation & Division
    • Addition & Subtraktion
    • Alle Rechenarten kombiniert
  • πŸ”’ Variable Operanden: 2-5 Operanden pro Aufgabe (z.B. 3 + 5 + 2 = )
  • πŸ‘€ SchΓΌlerverwaltung: Namen speichern und wiederverwenden
  • βœ… Automatische PrΓΌfung ohne Ergebnis preiszugeben
  • πŸ‘οΈ Ergebnisse anzeigen per Button
  • πŸ“„ PDF-Export mit Seitenzahlen zum Ausdrucken
  • βœ… LΓΆsungs-PDF separat herunterladbar
  • πŸ”‘ Eindeutige ID zum spΓ€teren Abrufen
  • πŸ’Ύ SQLite-Datenbank fΓΌr persistente Speicherung
  • πŸŒ™ Dark/Light Theme
  • 🌍 Deutsch/Englisch umschaltbar

Voraussetzungen

  • .NET 10.0 SDK oder hΓΆher

Installation & Start

Lokal ausfΓΌhren

cd MathTrainerDotNet
dotnet restore
dotnet run --project MathTrainerDotNet

Die Anwendung ist unter http://localhost:5000 erreichbar.

Docker (Image von Docker Hub)

Alternativ kann das offizielle Docker-Image verwendet werden.

Direkt mit Docker:

docker run -d -p 8080:80 -v mathtrainer-data:/app/data shinjisan/mathtrainerdotnet:latest

Mit Docker Compose (Produktiv-Setup):

Nutze die docker-compose.prod.yml, um die Anwendung einfach zu starten:

DOCKERHUB_USERNAME=shinji-san VERSION=latest docker compose -f docker-compose.prod.yml up -d

Die Anwendung ist dann unter http://localhost:8080 erreichbar.

Docker Compose Demo

Tests ausfΓΌhren

dotnet test

English

A Blazor web application for elementary school students to practice all four basic arithmetic operations.

Features

  • 🎲 Random exercise generation with customizable number range
  • βž• All operations: Addition, Subtraction, Multiplication, Division
  • πŸ”€ Mixed modes:
    • Multiplication & Division
    • Addition & Subtraction
    • All operations combined
  • πŸ”’ Variable operands: 2-5 operands per exercise (e.g., 3 + 5 + 2 = )
  • πŸ‘€ Student management: Save and reuse student names
  • βœ… Automatic checking without revealing the answer
  • πŸ‘οΈ Show results with a button
  • πŸ“„ PDF export with page numbers for printing
  • βœ… Solution PDF downloadable separately
  • πŸ”‘ Unique ID for later retrieval
  • πŸ’Ύ SQLite database for persistent storage
  • πŸŒ™ Dark/Light theme
  • 🌍 German/English switchable

Prerequisites

  • .NET 10.0 SDK or higher

Installation & Start

Run locally

cd MathTrainerDotNet
dotnet restore
dotnet run --project MathTrainerDotNet

The application is available at http://localhost:5000.

Docker (Image from Docker Hub)

Alternatively, you can use the official Docker image.

Directly with Docker:

docker run -d -p 8080:80 -v mathtrainer-data:/app/data shinjisan/mathtrainerdotnet:latest

With Docker Compose (Production setup):

Use docker-compose.prod.yml to easily start the application:

DOCKERHUB_USERNAME=shinji-san VERSION=latest docker compose -f docker-compose.prod.yml up -d

The application will be available at http://localhost:8080.

Docker Compose Demo

Run Tests

dotnet test

Solution Structure / Projektstruktur

MathTrainerDotNet/
β”œβ”€β”€ MathTrainerDotNet.slnx              # Solution file (SLNX format)
β”œβ”€β”€ Dockerfile                          # Docker configuration
β”œβ”€β”€ docker-compose.yml                  # Docker Compose setup
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ MathTrainerDotNet/                  # Main application project
β”‚   β”œβ”€β”€ Components/
β”‚   β”‚   β”œβ”€β”€ Pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.razor
β”‚   β”‚   β”‚   └── HomeComponents/         # Sub-components for Home page
β”‚   β”‚   β”œβ”€β”€ App.razor
β”‚   β”‚   └── Routes.razor
β”‚   β”œβ”€β”€ Data/
β”‚   β”‚   β”œβ”€β”€ Helper/
β”‚   β”‚   └── AppDbContext.cs
β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ Exercise.cs
β”‚   β”‚   β”œβ”€β”€ ExerciseSet.cs
β”‚   β”‚   β”œβ”€β”€ OperationType.cs
β”‚   β”‚   └── Student.cs
β”‚   β”œβ”€β”€ Resources/
β”‚   β”‚   β”œβ”€β”€ Strings.resx
β”‚   β”‚   β”œβ”€β”€ Strings.de.resx
β”‚   β”‚   └── Strings.en.resx
β”‚   β”œβ”€β”€ Services/
β”‚   β”‚   β”œβ”€β”€ Backup/                     # SQLite Backup & Restore
β”‚   β”‚   β”œβ”€β”€ Format/                     # Date formatting
β”‚   β”‚   β”œβ”€β”€ Id/                         # Public ID generation
β”‚   β”‚   β”œβ”€β”€ Localization/               # Multi-language support
β”‚   β”‚   β”œβ”€β”€ Pdf/                        # PDF generation (QuestPDF)
β”‚   β”‚   β”œβ”€β”€ Repository/                 # Data access layer
β”‚   β”‚   └── ExerciseGeneratorService.cs # Core business logic
β”‚   β”œβ”€β”€ ViewModels/
β”‚   β”‚   β”œβ”€β”€ ExerciseSetViewModel.cs
β”‚   β”‚   └── ExerciseViewModel.cs
β”‚   └── wwwroot/css/
β”‚       └── app.css
β”‚
└── MathTrainerDotNetTest/              # Unit test project
    β”œβ”€β”€ Models/
    β”œβ”€β”€ Services/
    └── ViewModels/

Technologies / Technologien

  • ASP.NET Core 10.0 with Blazor Server
  • Entity Framework Core 10.0 with SQLite
  • QuestPDF for PDF generation
  • xUnit for unit testing
  • Moq for mocking

License / Lizenz

MIT License - Free to use and modify. MIT-Lizenz - Frei zur Verwendung und Modifikation.

About

A Blazor web application for elementary school students to practice all four basic arithmetic operations.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors