Skip to content

Nob101/student-course-management

Repository files navigation

Kurs- & Schülerverwaltungssystem

Disclaimer Übungsprojekt

Dieses Repository enthält ein Management-System für Schüler und Kurse. Das Ziel war die Implementierung einer sauberen Architektur mit Trennung von Frontend, Backend und Datenbank. (Geschäftslogik und Datenbankzugriff mittels DAO-Pattern)

DAO-Patterns (Data Access Object) containerisierte NoSQL-Architektur

Dieses Projekt wurde im Rahmen meiner Ausbildung zum Informatiker zu Übungszwecken erstellt. Es dient der Demonstration einer modernen Fullstack-Entwicklung und ist nicht für den produktiven Einsatz vorgesehen.


Quick Start (Dockerized)

Dank Docker ist keine lokale Installation von Node.js oder MongoDB erforderlich.

Voraussetzungen: Docker & Docker Desktop gestartet.

  1. git clone https://github.com/Nob101/student-course-management.git

  2. cp .env.example .env

  3. Im Projektverzeichnis folgenden Befehl ausführen:

    docker-compose up --build -d
  4. Im Browser unter http://localhost:3000/html/start.html zugreifen oder das Script win_start.bat im Terminal ausführen. (Öffnet den Standardbrowser und öffnet die HTML-Seite direkt)


Performance-Tipp (Windows / WSL2 RAM-Begrenzung)

Da Docker Desktop unter Windows das WSL2-Backend nutzt, kann es vorkommen, dass der vmmem-Prozess sehr viel Arbeitsspeicher (RAM) bei Bedarf beansprucht. (Früher 50%, mittlerweile 8GB) Um die Ressourcen-Nutzung deines PCs zu deckeln, wird empfohlen, eine globale Konfigurationsdatei anzulegen:

  1. Drücke Win + R, gib %USERPROFILE% ein und drücke Enter.
  2. Erstelle in diesem Ordner, falls nicht bereits Vorhanden eine Datei namens .wslconfig ( OHNE Dateiendung).
  3. Füge folgenden Inhalt ein, um WSL2 beispielsweise auf 4 GB RAM zu begrenzen:
[wsl2]
memory=4GB   # Begrenzt den RAM für Docker/WSL2
processors=2 # Begrenzt die genutzten CPU-Kerne
  1. Starte danach WSL bzw. Docker einmal neu (Terminal: wsl --shutdown).

Frontend HTML5CSS3JavaScript

Backend Node.jsExpress.jsJavaScript

Infrastruktur & Database MongoDBDockerCI Status


Key Features

  • Migration auf MongoDB: Flexibles, dokumentenbasiertes Datenschema statt starrer Tabellen.
  • Mongoose ODM: Typsichere Modellierung der Daten in JavaScript.
  • Docker Orchestrierung: Vollständige Isolierung von Applikation und Datenbank.
  • DAO-Architektur: Erleichtert die Wartbarkeit und Testbarkeit des Codes.

Technologie Stack

  • Frontend: HTML5, CSS3, JavaScript (Vanilla)
  • Backend: Node.js, Express.js
  • Datenbank: MongoDB via Mongoose ODM
  • Infrastruktur: Docker & Docker Compose

Features

  • Filtersuche
  • Dashboard-Ansicht
  • Automatische Datenbank-Initialisierung

Testdaten (Seeding)

Das Projekt verfügt über einen automatisierten Seeding-Mechanismus. Beim ersten Start der Anwendung (wenn die MongoDB noch leer ist) werden automatisch Testdaten angelegt, um die Funktionalität sofort testen zu können.

Enthaltene Testdaten:

  • Kurs: Musik_101 (Lehrer: John F.)
  • Schüler: John Doe (SV-Nr: 1111039A)
  • Verknüpfung: Der Schüler John Doe ist automatisch im Kurs Musik_101 eingeschrieben.

Die Logik hierfür befindet sich in database/seed.js und wird beim Serverstart in der server.js aufgerufen, sofern schuelerCount === 0.


Verzeichnisstruktur (MVC-Pattern)


project/
│
├── controller/          # Brains: Verarbeitet API-Requests & Validierung
│   ├── kursController.js
│   └── schuelerController.js
│
├── dao/                 # Data Access Objects: Mongoose-Logik (CRUD)
│   ├── kursDao.js
│   └── schuelerDao.js
│
├── database/            # Connection Logic: Mongoose-Initialisierung & seeding
│   └── database.js
│   └── seed.js
│
├── models/              # Mongoose Schemas: Definition der Datenstruktur
│   ├── kurs.js
│   └── schueler.js
│
├── public/              # Statische Dateien (Frontend)
│   ├── css/             # Stylesheets (Gojo-Blue Design & Animationen)
│   │   ├── nav_style.css
│   │   └── style.css
│   ├── html/            # Views
│   │   └── start.html
│   └── javascript/      # Modulare Client-side Logik
│   |   ├── animation.js  # UI-Effekte & Overlays
│   |   ├── apiService.js # API-Kommunikation (Fetch-Calls)
│   |   ├── main.js       # App-Initialisierung & Event-Listener
│   |   ├── utils.js      # Hilfsfunktionen
│   |   └── view.js       # DOM-Manipulation & UI-Updates
│   └── config.js      # API_BASE_URL 
│
├── routes/              # Express-Router: API-Endpunkt-Definitionen
│   ├── kursRouter.js
│   └── schuelerRouter.js
│
├── .dockerignore        # Optimiert den Docker-Build
├── .gitignore           # Verhindert Upload von node_modules & Secrets
├── .env.example           # Beispiel .env Datei   (Port & Path)
├── CONTRIBUTING.md        # Leitfaden für Branching & lokale Entwicklung 
├── docker-compose.yml   # Orchestrierung von Node-App & MongoDB
├── Dockerfile           # Bauanleitung für das Node.js-Image (slim)
├── LICENSE              # Rechtliche Rahmenbedingungen (MIT)
├── package.json         # Projekt-Metadaten & Abhängigkeiten
├── package-lock.json    # Fixierte Versionsstände der npm-Pakete
├── server.js            # Entry Point: Express-Server Start & DB-Connect
└── win_start.bat        # Startskript für Windows (Docker, Browser)


English

Student & Course Management System

Student Project Disclaimer This repository contains a management system for students and courses. The primary goal was to implement a clean architecture with a strict separation of frontend, backend, and database logic (Business logic and database access via the DAO pattern).

Key Architectural Features:

  • DAO Pattern (Data Access Object)
  • Containerized NoSQL Architecture

This project was created for educational purposes as part of my computer science education. It serves as a demonstration of modern full-stack development and is not intended for production use.


Quick Start (Dockerized)

Thanks to Docker, no local installation of Node.js or MongoDB is required.

Prerequisites: Docker & Docker Desktop must be running.

  1. Clone the repository:

    git clone https://github.com/Nob101/student-course-management.git
  2. Configuration:

    cp .env.example .env
  3. Start the application: Run the following command in the project root:

    docker-compose up --build -d
  4. Access in your browser: http://localhost:3000/html/start.html or run the script win_start.bat in the terminal. (Opens the default browser togehter w/ the HTML page directly)


Performance Tip (Windows / WSL2 RAM Limitation)

Since Docker Desktop on Windows utilizes the WSL2 backend, the vmmem process can consume a large amount of RAM when needed. (Previously capped at 50% of host RAM, now standardly limited to 8GB).

To cap the resource usage on your PC, it is highly recommended to create a global configuration file:

  1. Press Win + R, type %USERPROFILE% and hit Enter.
  2. Inside this folder, create a file named .wslconfig (make sure it has NO file extension like .txt).
  3. Insert the following content to limit WSL2 (for example, to 4 GB of RAM and 2 CPU cores):
[wsl2]
memory=4GB   # Limits RAM for Docker/WSL2
processors=2 # Limits the number of utilized CPU cores
  1. Afterwards, restart WSL and Docker to apply the changes (run wsl --shutdown in your terminal).

Tech Stack

  • Frontend: HTML5, CSS3, JavaScript (Vanilla)
  • Backend: Node.js (v22.14.0), Express.js
  • Database: MongoDB via Mongoose ODM
  • Infrastructure: Docker & Docker Compose

Key Features

  • MongoDB Integration: Flexible, document-based data schema.
  • Mongoose ODM: Type-safe data modeling in JavaScript.
  • Docker Orchestration: Full isolation of application and database.
  • DAO Architecture: Enhances code maintainability and testability.
  • Automated Seeding: The project includes a seeding mechanism (database/seed.js) that automatically populates the database with initial test data (students and courses) on the first start.

Project Structure (MVC/DAO Pattern)

The project follows a modular structure to ensure a high level of organization:

  • controller/: Handles API requests and validation.
  • dao/: Data Access Objects containing the Mongoose/CRUD logic.
  • models/: Mongoose schemas defining the data structures.
  • public/: Static frontend files (Gojo-Blue design and modular JS).
  • routes/: Definition of Express API endpoints.

Contributing

For information on how to run experiments locally or details regarding the branching strategy and pull requests, please refer to the CONTRIBUTING.md.


About

Docker-basiertes Kursverwaltungssystem mit Node.js Backend und NoSQL-Datenbank. Implementierung einer sauberen Trennung von Geschäftslogik und Datenbankzugriff (DAO)

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors