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.
Dank Docker ist keine lokale Installation von Node.js oder MongoDB erforderlich.
Voraussetzungen: Docker & Docker Desktop gestartet.
-
git clone https://github.com/Nob101/student-course-management.git
-
cp .env.example .env
-
Im Projektverzeichnis folgenden Befehl ausführen:
docker-compose up --build -d
-
Im Browser unter
http://localhost:3000/html/start.htmlzugreifen oder das Scriptwin_start.batim Terminal ausführen. (Öffnet den Standardbrowser und öffnet die HTML-Seite direkt)
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:
- Drücke
Win + R, gib%USERPROFILE%ein und drücke Enter. - Erstelle in diesem Ordner, falls nicht bereits Vorhanden eine Datei namens
.wslconfig( OHNE Dateiendung). - 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
- Starte danach WSL bzw. Docker einmal neu (Terminal: wsl --shutdown).
- 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.
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Backend: Node.js, Express.js
- Datenbank: MongoDB via Mongoose ODM
- Infrastruktur: Docker & Docker Compose
- Filtersuche
- Dashboard-Ansicht
- Automatische Datenbank-Initialisierung
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.
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)
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.
Thanks to Docker, no local installation of Node.js or MongoDB is required.
Prerequisites: Docker & Docker Desktop must be running.
-
Clone the repository:
git clone https://github.com/Nob101/student-course-management.git
-
Configuration:
cp .env.example .env
-
Start the application: Run the following command in the project root:
docker-compose up --build -d
-
Access in your browser:
http://localhost:3000/html/start.htmlor run the scriptwin_start.batin the terminal. (Opens the default browser togehter w/ the HTML page directly)
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:
- Press
Win + R, type%USERPROFILE%and hit Enter. - Inside this folder, create a file named
.wslconfig(make sure it has NO file extension like.txt). - 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
- Afterwards, restart WSL and Docker to apply the changes (run wsl --shutdown in your terminal).
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Backend: Node.js (v22.14.0), Express.js
- Database: MongoDB via Mongoose ODM
- Infrastructure: Docker & Docker Compose
- 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.
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.
For information on how to run experiments locally or details regarding the branching strategy and pull requests, please refer to the CONTRIBUTING.md.