- Python 53.5%
- JavaScript 28.1%
- CSS 14.3%
- Dockerfile 3.2%
- HTML 0.9%
| .archive/task-1-car-simulator | ||
| .forgejo/workflows | ||
| .vscode | ||
| Checkers | ||
| Labs | ||
| Showcase | ||
| .dockerignore | ||
| .gitignore | ||
| PROJECT_IDEAS.md | ||
| README.md | ||
Object-Oriented Programming 2
Course projects and assignments for Object-Oriented Programming 2.
Author: Adrian Kowalczyk Course: Object-Oriented Programming 2 Semester: 2025/2026
🌐 Live Demo
Showcase Platform: oop2.vzkn.eu
The Showcase aggregates all Labs and Checkers stages in a single platform with automatic stage discovery.
Structure
OOP2/
├── Labs/ # Laboratory assignments (stage-1 to stage-7)
│ ├── stage-1/ # Domain Skeleton - Basic car simulator with Observer pattern
│ ├── stage-2/ # Kinematics - Physics-based movement with 1D motion
│ ├── stage-3/ # Fuel System
│ ├── stage-4/ # Transmission
│ ├── stage-5/ # Brakes & ABS
│ ├── stage-6/ # Environment
│ └── stage-7/ # Dashboard
├── Checkers/ # Checkers game assignments
│ ├── stage-1/ # Analysis & Planning
│ ├── stage-2/ # Basic Implementation
│ ├── stage-3/ # Extended Features
│ └── stage-4/ # Final Version
└── Showcase/ # Platform aggregating all stages
├── backend/ # FastAPI backend with WebSocket proxy
└── frontend/ # React + Vite frontend with dynamic stage discovery
Requirements
- Python 3.13+
- Node.js 22+
- Docker & Docker Compose (for containerized deployment)
- uv package manager (for Python)
- npm (for frontend)
Quick Start
Local Development
Labs Stage (any stage, e.g., stage-1 or stage-2)
# Backend
cd Labs/stage-1/backend # or stage-2
uv sync
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Frontend (in another terminal)
cd Labs/stage-1/frontend # or stage-2
npm install
npm run dev
Visit: http://localhost:5173
Showcase Platform
# Backend
cd Showcase/backend
uv sync
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8080
# Frontend (in another terminal)
cd Showcase/frontend
npm install
npm run dev
Visit: http://localhost:5173
Docker Deployment
Single Stage
cd Labs/stage-1
docker-compose up --build
Visit: http://localhost:3001
Showcase (All Stages)
cd Showcase
docker-compose up --build
Visit: http://localhost:8080
Architecture
Each stage is a single container with:
- Backend: Python FastAPI serving WebSocket API and static files
- Frontend: React + Vite (built during Docker image creation)
- Deployment: Docker multi-stage build (Node builder + Python runtime)
The Showcase platform:
- Uses Vite
import.meta.glob()to import all stage components - Imports stage components directly from source (zero code duplication)
- Dynamic routing with React Router
- Single aggregated view of all Labs and Checkers stages
Development
Install Dependencies
Python (using uv):
cd Labs/stage-1/backend # or Showcase/backend
uv sync
Frontend (using npm):
cd Labs/stage-1/frontend # or Showcase/frontend
npm install
Run Tests
Python:
cd Labs/stage-1/backend
uv run pytest tests/ -v --cov=. --cov-report=term-missing
Linting:
# Python
uv run ruff check .
uv run ruff format --check .
# Frontend
npm run lint
CI/CD
Forgejo Actions workflows (.forgejo/workflows/):
all-stages.yml- Auto-discovers and builds all changed Labs/Checkers stagesshowcase.yml- Tests and builds Showcase platform
Each workflow includes:
- Python linting (ruff) and testing (pytest)
- Frontend linting (ESLint) and building
- Docker build verification
- Automatic Docker image push to Forgejo Container Registry (on main branch)
Technology Stack
- Backend: Python 3.13, FastAPI 0.121.1, uvicorn 0.38.0, WebSockets 15.0.1
- Frontend: React 19.2.0, React Router 7.9.5, Vite 7.2.2
- Testing: pytest 9.0.0, pytest-cov 7.0.0, ESLint 9.39.1
- Linting: ruff 0.14.4, ESLint + React plugins
- Containerization: Docker multi-stage builds, Docker Compose
- Orchestration: Kubernetes (production)
Project Structure Details
- Single Container per Stage: Each stage builds frontend during Docker image creation, backend serves both API and static files
- Component Imports: Showcase uses Vite
import.meta.glob()to import stage components from source - Zero Duplication: Stage code is reused directly, no copying or duplication
- Development/Production Parity: Same Docker setup for local testing and production deployment
- WebSocket Proxy: Showcase backend proxies WebSocket connections to internal stage services with automatic reconnection
- Observer Pattern: Car simulation uses Observer pattern for real-time state updates to Dashboard
Future Ideas
Battle Royale / Multiplayer Mode would make a great standalone hobby project for learning distributed systems, real-time communication, and scaling. It's beyond the scope of this OOP course project but might appear as a separate repository under @vrozaksen in the future.
Note: Battle Royale was removed from this project as it doesn't belong in the OOP2 course scope. See PROJECT_IDEAS.md for technical details.