Skip to content

BadhonPain/OOPverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OOPverse 🌌

A premium, interactive, bilingual (C++ & Java) learning workspace covering 14 progressive modules of Object-Oriented Programming β€” from structs and encapsulation all the way to multithreading, networking, and code testing.

C++17 Java 17 CI License: MIT


πŸ“– Table of Contents


🌌 What is OOPverse?

OOPverse is a structured, self-contained OOP learning repository designed for students and developers who want to master Object-Oriented Programming through hands-on, runnable examples. Every concept is demonstrated side-by-side in both C++ and Java, making it easy to understand how the same paradigm is expressed across two of the most widely used languages in the world.

Key highlights:

  • βœ… 14 progressive modules β€” carefully ordered from basics to advanced topics, plus a dedicated code-testing module
  • βœ… Bilingual β€” every module has both C++ and Java implementations
  • βœ… Two runners β€” a modern Web UI (with two execution modes) and a terminal-based CLI runner
  • βœ… Real interactive input support β€” the Web UI can run programs that read from cin / Scanner live, not just batch-style
  • βœ… Zero manual compilation β€” the runners handle compile, execute, and cleanup automatically
  • βœ… CI/CD verified β€” every file in the repo is guaranteed to compile on every commit
  • βœ… Per-module READMEs β€” each module has its own detailed explanation

πŸ“ Project Structure

OOPverse/
β”œβ”€β”€ 01_Basics_and_Structs/
β”‚   β”œβ”€β”€ cpp/                   # C++ source files
β”‚   β”œβ”€β”€ java/                  # Java source files
β”‚   └── README.md              # Module-level explanation
β”œβ”€β”€ 02_Classes_and_Encapsulation/
β”œβ”€β”€ 03_Inheritance/
β”œβ”€β”€ 04_Polymorphism_and_Overloading/
β”œβ”€β”€ 05_Templates_and_Generics/
β”œβ”€β”€ 06_STL_and_Collections/
β”œβ”€β”€ 07_IO_and_Manipulators/
β”œβ”€β”€ 08_Exception_Handling/
β”œβ”€β”€ 09_File_Operations/
β”œβ”€β”€ 10_Nested_Classes_and_Enums/
β”œβ”€β”€ 11_Multithreading/
β”œβ”€β”€ 12_Networking/
β”œβ”€β”€ 13_Command_Line_Arguments/
β”œβ”€β”€ 14_Code_Testing/
β”‚
β”œβ”€β”€ index.html                 # Web UI frontend (markup only)
β”œβ”€β”€ css/
β”‚   └── styles.css             # Web UI styling β€” CSS-variable driven theme (light/dark)
β”œβ”€β”€ js/
β”‚   └── app.js                 # Web UI client logic (module/file browsing, both run modes)
β”œβ”€β”€ play-server.js             # Web UI backend (Node.js + Express + WebSocket)
β”œβ”€β”€ play.sh                    # CLI runner for Linux / macOS
β”œβ”€β”€ play.ps1                   # CLI runner for Windows (PowerShell)
β”œβ”€β”€ package.json               # Node.js dependencies
└── Materials/
    └── OOP QB BUET_TF.pdf     # BUET OOP question bank (reference)

Each numbered module folder follows the same layout: a cpp/ subfolder, a java/ subfolder, and a README.md explaining the concepts covered. Any file you drop directly into a module's cpp/ or java/ folder is picked up automatically by both runners β€” no registration or config needed.


βš™οΈ Prerequisites

Before running OOPverse, make sure the following are installed on your system:

Tool Version Purpose
G++ (GCC) C++17 or later Compile C++ files
JDK (OpenJDK) 17 or later Compile & run Java files
Node.js 16 or later Required for the Web UI runner only

Verify your installations:

g++ --version
java --version
javac --version
node --version    # Only needed for Web UI

Windows only, for Interactive Terminal mode: the Web UI's live/interactive run mode depends on node-pty, which compiles a native addon on install. This requires a C++ build toolchain β€” either Visual Studio Build Tools (with the "Desktop development with C++" workload) or npm install --global windows-build-tools, plus Python 3 for node-gyp. Judge-style mode has no such requirement.


πŸš€ Getting Started

OOPverse provides two ways to browse and run examples. Choose whichever suits your workflow.


Option 1 β€” Web UI Runner (Recommended)

The Web UI is a browser-based interface powered by a Node.js + Express backend. It lets you browse modules, preview source code, and compile & run files β€” all with a single click.

Step 1 β€” Install dependencies (first time only)

npm install

Step 2 β€” Start the server

npm start

Step 3 β€” Open your browser

http://localhost:3000

Web UI Features

Feature Description
πŸ“‚ Module browser Lists all 14 modules in the sidebar
πŸ”€ Language toggle Switch between C++ and Java file lists instantly
πŸ“„ Code preview View the full source code of any file before running it
πŸŒ— Dark mode Full light/dark theme, driven entirely by CSS variables
▢️ One-click run Compiles and executes the selected file on the server
πŸ“Ÿ Live output Displays compiler output and program output in a terminal-style panel
🧹 Auto cleanup Compiled binaries (.exe, .class) are deleted automatically after each run
⏱️ Timeout guard Judge-style runs are terminated after 15s; interactive sessions after 60s

Two Run Modes

The Run panel lets you choose per run how input is supplied:

Mode How it works Best for
Judge style Paste all expected input upfront into a textarea, one value per line. The program runs start-to-finish and returns a single result β€” just like an online judge (Codeforces, etc.) feeding input from a file. Competitive-programming style problems where you already know the input, or any file with no cin/Scanner calls
Interactive terminal Compiles the file, then runs it inside a real pseudo-terminal (PTY) over a WebSocket connection. Output streams in live as it's printed, and you type responses into a live input box exactly as you would in a real console. Programs that print prompts and read cin >> / Scanner.nextInt() etc., especially ones using cin.tie(nullptr); ios::sync_with_stdio(false);, where judge-style buffering would hide prompts until the very end

Why two modes exist: piped (non-interactive) processes default to fully-buffered stdout, so prompts and output can appear all at once at the end rather than as the program runs β€” especially once fast-I/O optimizations are used. A real PTY restores normal line-buffered behavior, so Interactive mode shows prompts exactly when they're printed.

Note on Interactive mode: it streams a raw text feed. It doesn't fully emulate a terminal (no live re-rendering of system("cls"), colored text, or cursor-controlled progress bars) β€” the escape codes for those are stripped for readability. For everything from ordinary cin/Scanner based programs, this makes no difference.

Port conflict? If port 3000 is already in use, open play-server.js and change const PORT = 3000; to any available port number.


Option 2 β€” CLI Runner

The CLI runner is a fully interactive terminal menu β€” no browser or Node.js required. It works on any platform that has a shell, and standard input works exactly as in a normal terminal since there's no buffering to worry about.

On Linux / macOS:

chmod +x play.sh
./play.sh

On Windows (PowerShell):

.\play.ps1

How the CLI runner works:

  1. Select a module β€” an interactive numbered menu lists all 14 modules
  2. Select a language β€” choose C++ or Java
  3. Select a file β€” pick from the available source files in that module
  4. Run β€” the runner compiles the file, prints the output, and cleans up the binary automatically

πŸ“š 14-Module Curriculum

The modules are designed in strict progressive order. Each module builds on the previous one and presents concepts in both C++ and Java for direct comparison.

# Module Core Concepts C++ Highlights Java Highlights
01 Basics & Structs Primitive types, scopes, basic I/O, type casting, arrays Struct layouts, pointers, namespaces BasicIO, loops, ArrayDemo, MethodDemo, multidimensional arrays
02 Classes & Encapsulation Classes, encapsulation, object lifetimes, constructors, destructors Rule of Three/Five, move semantics, smart pointers, this pointer, shallow vs deep copy ClassBasics, static blocks, AccessModifiers, CopyConstructor
03 Inheritance Single, multilevel, hierarchical, multiple, and hybrid inheritance Virtual destructors, constructor chaining, all four type casts (static_cast, dynamic_cast, const_cast, reinterpret_cast) SingleInheritance, Interfaces (default, static, private methods), AbstractClass, super keyword
04 Polymorphism & Overloading Function/method overloading, method overriding, virtual dispatch, abstraction Operator overloading (unary & binary), conversion functions, vtables MethodOverloading, runtime polymorphism, upcasting, autoboxing
05 Templates & Generics Compile-time generic programming Class templates, function templates, template inheritance, monomorphization Generic classes, generic methods, generic interfaces, wildcards (extends/super), multi-type generics
06 STL & Collections Containers, iterators, standard algorithms vector, list, deque, map, set, unordered containers, lambda sorting, STL algorithms ArrayList, LinkedList, HashMap, HashSet, Vector, iterators, custom comparators, Streams API
07 I/O & Manipulators Standard streams, text formatting, string operations Stream format flags, manipulators, width/precision/fill, inline functions FormattedOutput, ScannerIO, StringBuilder, string operations, type conversion
08 Exception Handling Error propagation, exception hierarchies, safe program teardown try/catch/throw, custom exceptions, noexcept, polymorphic exceptions TryCatchDemo, checked vs unchecked exceptions, try-with-resources, custom exception classes
09 File Operations Read/write text and binary files, serialization Sequential & random access (seekg/seekp), stream buffers FileReadDemo, FileWriteDemo, BufferedReader, serialization & deserialization, random access files
10 Nested Classes & Enums Scoped structures, inner type encapsulation Nested structs, scoped enum class Static/non-static inner classes, anonymous classes, enums with constructors and fields
11 Multithreading Parallel execution, thread synchronization, inter-thread communication std::thread, mutex, lock_guard, condition_variable, lambda threads Thread class, Runnable, synchronized, wait()/notify(), join(), producer-consumer pattern
12 Networking Socket programming, client-server architecture, network I/O POSIX sockets (Linux/macOS), Winsock2 (Windows), TCP server setup ServerSocket, Socket, client-server message exchange, input/output streams over network
13 Command-Line Arguments Runtime input via CLI flags and arguments argc/argv parsing, CLI config structures String[] args parsing, argument validation, input handling
14 Code Testing Applying OOP + DS/A fundamentals to solved problems Checking & Testing code Checking & Testing code

πŸ”„ v1 vs v2 β€” What Changed

v1 v2
User input (cin, Scanner) ❌ Not supported β€” any program waiting on input would hang for 15s and time out βœ… Supported via two modes: paste input upfront (Judge style) or type live while the program runs (Interactive terminal, real PTY)
Frontend code Inline <style> and <script> inside one index.html Split into index.html, css/styles.css, js/app.js
Dark mode Every component had a duplicated body.dark-mode .x { } rule Single set of CSS variables in :root; dark mode just overrides the variables
Modules 13 14 (added 14_Code_Testing)
Backend Express only (/api/run, one-shot exec()) Express + WebSocket (ws) + node-pty for live sessions

  • Interactive Terminal mode is Windows-only as currently implemented. Both /api/run (judge mode) and the interactive PTY path shell out via cmd.exe. On Linux/macOS, judge-style CLI usage still works fine through play.sh, but the Web UI's compile/run commands need to be ported to a POSIX shell to work cross-platform.
  • Interactive mode streams raw text, not a full terminal emulation. ANSI/VT escape sequences (cursor positioning, clear, colors) are stripped for readability rather than rendered β€” fine for standard cin/Scanner programs, not suitable for anything relying on live-redrawn output (e.g. a console progress bar).
  • node_modules/ is currently committed to the repository. This is typically unintentional β€” recommend adding a .gitignore and running git rm -r --cached node_modules to slim down the repo.

πŸ› οΈ Tech Stack

Layer Technology Purpose
Language C++17 Primary systems programming language
Language Java 17 Primary object-oriented language
Compiler GCC Compiles C++ source files (-std=c++17)
Compiler javac Compiles and runs Java source files
Backend Node.js Powers the Web UI runner server
Framework Express REST API for judge-style compile & run
Realtime WebSocket Live streaming for Interactive Terminal mode
PTY node--pty Real pseudo-terminal for live cin/Scanner input
Frontend HTML/CSS/JS Vanilla web UI, split into index.html / css/styles.css / js/app.js
CI/CD GitHub Actions Auto-compiles all files on every push
Shell Bash CLI runner for Linux / macOS
Shell PowerShell CLI runner for Windows

πŸ›‘οΈ CI/CD Pipeline

Every commit pushed to main or master automatically triggers a GitHub Actions workflow that compiles every single source file in the repository.

What gets checked:

  • All .cpp files are compiled with g++ -std=c++17 -fsyntax-only
  • All .java files are compiled with javac (JDK 17)
  • Compiled .class files are cleaned up after each check
  • The workflow fails immediately if any file does not compile

This ensures OOPverse is always in a 100% build-safe state and can be trusted as a reliable reference.

Workflow file: .github/workflows/compile_check.yml


πŸ™ Acknowledgements

The code examples, concepts, and learning structure throughout OOPverse are largely inspired by and in many cases directly derived from the lecture materials, slides, and teachings of the faculty members of the Department of Computer Science & Engineering, Bangladesh University of Engineering and Technology (BUET). Their structured and rigorous approach to teaching Object-Oriented Programming formed the academic foundation upon which this entire repository is built.

Sincere gratitude to all the instructors whose guidance β€” both inside and outside the classroom β€” made this work possible.


πŸ“„ Reference Material

The repository includes Materials/OOP QB BUET_TF.pdf β€” a curated OOP question bank made by BUET CSE'24 students. It is useful for exam preparation and self-assessment alongside the code examples.


πŸ‘¨β€πŸ’» Creator

Name Badhon Pain
Institution Bangladesh University of Engineering and Technology (BUET)
Department Computer Science & Engineering
GitHub @badhonpain
LinkedIn Badhon Pain

OOPverse was designed and developed as a structured reference workspace with a focus on pedagogical clarity, bilingual coverage, and production-quality tooling. Every module, example, and runner in this repository reflects a commitment to making OOP concepts accessible, comparable, and immediately runnable.

About

A premium, interactive, bilingual (C++ & Java) learning workspace covering 13 progressive modules of Object-Oriented Programming with practical usage and core concepts followed by CSE_107 coursework.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors