web-queue-api / README.md
README.md
Raw

Office Hours Queue Web Server

Project Overview

This is a full-stack command-line web server simulation for managing an Office Hours Queue System, built entirely in modern C++. The project features a custom-built doubly linked list container and a simulated RESTful API backend for managing queue operations in a clean and efficient manner.

The system supports standard HTTP-style request/response interactions and JSON-based communication, simulating real-world backend behavior for managing client-server state.


Technologies & Concepts

  • C++ (Modern C++17)
  • Custom Doubly Linked List (Dynamic Container ADT)
  • Dynamic Memory Management (new, delete)
  • Rule of Three (copy constructor, destructor, assignment operator)
  • Iterators & Abstract Data Types (ADTs)
  • RESTful API Design
  • JSON Serialization/Deserialization
  • HTTP Request/Response Parsing
  • Unit Testing Framework (Lightweight, Custom)

Project Structure

File Description
List.hpp Custom doubly linked list implementation (template-based)
List_tests.cpp Unit tests for validating all list functionality
api.cpp (Optional) RESTful API simulation using the custom list
server.py Simple HTTP wrapper to simulate a web server
json.hpp Header-only JSON parser (nlohmann/json)
index.html Frontend UI to interact with the queue system
*.in / *.out.correct Sample API test inputs and expected outputs

Key Features

  • Custom List Container

    • Doubly linked list with iterator support
    • Full memory-safe implementation with deep copy functionality
    • Clean separation of interface and implementation
    • STL-like usage with .insert(), .erase(), .begin(), .end()
  • Queue Management REST API

    • GET /api/ – API metadata
    • GET /api/queue/ – Full queue list
    • GET /api/queue/head/ – Head of the queue
    • POST /api/queue/tail/ – Enqueue new user
    • DELETE /api/queue/head/ – Dequeue head user
  • Realistic Request/Response Parsing

    • Structured input via HTTP-style commands
    • JSON-formatted response body with computed Content-Length
    • Proper error-handling and status codes (200 OK, 201 Created, 400 Bad Request, etc.)

Usage & Testing

Compile and Run List Tests

make List_tests.exe
./List_tests.exe