How k-forghani/mysterious-family works
Project type and purpose
• From the file tree and README we see a C++-based web application (“Mysterious Family”) that implements a secure family-tree data structure.
• It uses the Crow C++ microframework to serve HTML templates and static assets, JSONCpp for JSON handling, plus custom libraries for DAG, secure family-tree (SFT), SHA-256 hashing, and a trie.
• It has two main modes: run the web application (app.cpp) or run tests (test.cpp).
File structure
• Top-level files:
• app.cpp – main HTTP server & controller logic
• test.cpp – test harness
• run.sh / clean.sh – build/run scripts
• Dockerfile / .dockerignore – containerization (optional)
• data/ – sample data and a Python generator (data/generate.py)
• libs/ – core data-structure libraries (dag, sft, sha256, trie)
• static/ – CSS & JS assets for client-side visualization (uses cytoscape-dagre, toastify, etc.)
• templates/ – HTML templates (index, explore, view)
• schema/ – UML and project description (not runtime)
README for insights
• Dependencies: Crow, JSONCpp, Boost, g++
• Run modes: ./run.sh app (launch server), ./run.sh test (self-tests)
• Architecture hint: the UML (schema/uml.md) sketches classes for nodes, trees, hashing
Main components & their interactions
a. Frontend (Browser)
• HTML templates (templates/*.html)
• Static CSS/JS (static/assets)
• Renders family-tree graphs, CSS styling, client-side controls
b. Web Server (app.cpp using Crow)
• HTTP routing (REST endpoints for index, explore, view)
• Controller layer: parses requests, invokes business logic
c. Business Logic / Model (libs/)
• dag: generic directed-acyclic-graph functions
• sft: secure family-tree operations (add member, query relationships)
• trie: optional indexing (e.g., name lookup)
• sha256: hashing for data integrity/security
d. Data Layer
• data/*.json (or in-memory structures built at startup)
• generate.py: offline data generation for demos/testing
e. External Dependencies
• Crow (HTTP framework)
• JSONCpp (JSON parsing/serialization)
• Boost (utilities)
Architectural patterns & design principles
• MVC-like separation: templates/views ↔ controller (app.cpp) ↔ model (libs)
• Single monolithic service (no microservices)
• In-process data storage (no external DB server)
• Test mode demonstrates CLI-based test harness