Phase 1 — Understanding the Application Before Touching the Infrastructure
What This Post Is
Section titled “What This Post Is”This is the first post in the Homelab to Production series — a structured DevOps portfolio built around a real full-stack application, running on real home lab hardware.
Before writing a single line of infrastructure code, the first step was to understand exactly what the application does, how it is built, and what dependencies it has. This post covers that phase.
The application used throughout this series is the Humor Memory Game — a card-matching memory game built with Node.js, PostgreSQL, and Redis, originally developed by Osomudeya. It serves as the vehicle for demonstrating the full DevOps lifecycle.
Why Start Here
Section titled “Why Start Here”A common mistake in DevOps portfolio work is jumping straight to the infrastructure — spinning up containers or writing Kubernetes manifests before understanding what is actually being deployed.
That approach creates fragile systems. If something breaks, there is no baseline understanding to reason from.
The deliberate choice here was to start with the application itself — read the code, understand the architecture, map the dependencies, and document what was found. Only then does the infrastructure work begin.
What the Application Is
Section titled “What the Application Is”The Humor Memory Game is a full-stack web application with four distinct layers:
- Frontend — Vanilla JavaScript served by Nginx, communicating with the backend via a reverse proxy
- Backend — Node.js and Express providing a RESTful API across three route groups: game, scores, and leaderboard
- Database — PostgreSQL managing persistent game state, user records, scores, and match history
- Cache — Redis handling volatile session data and leaderboard caching to reduce database load
The architecture is intentionally straightforward — no framework overhead, no abstraction layers that obscure what is happening. This makes it an ideal subject for learning infrastructure work, because every dependency is visible and every failure is traceable.
What the Analysis Covered
Section titled “What the Analysis Covered”Architecture and Data Flow
Section titled “Architecture and Data Flow”The first task was mapping how a request flows through the system — from the browser, through Nginx, to the Express API, and into PostgreSQL or Redis depending on the operation.
Understanding this flow is what makes infrastructure decisions defensible. When deciding how containers should communicate, or how persistent storage should be configured, the data flow is the reference point.
Database Schema
Section titled “Database Schema”The PostgreSQL schema includes five tables — users, games, game_matches, daily_challenges, and leaderboard_cache — along with triggers, indexes, and views. Understanding the schema before containerisation meant knowing exactly what initialisation the database requires and what the application expects to find on startup.
API Surface
Section titled “API Surface”The full API was mapped across three route files — fourteen endpoints covering game lifecycle, score submission, and leaderboard retrieval. Knowing the complete API surface matters when configuring health checks, reverse proxy rules, and monitoring.
Known Issues in the Source
Section titled “Known Issues in the Source”The analysis also revealed issues in the original source that would cause failures at runtime. These were documented before any fixes were applied, establishing a clear baseline. The fixes themselves are covered in Phase 2.
What Was Produced
Section titled “What Was Produced”The output of Phase 1 is a technical reference document — CODEBASE.md — covering the full architecture, data flow, API reference, and database schema. It lives in the developer repository and serves as the reference point for all subsequent phases.
What This Phase Demonstrates
Section titled “What This Phase Demonstrates”- Ability to onboard to an unfamiliar codebase and reason about it independently
- Structured technical documentation written for both developer and non-technical audiences
- Deliberate sequencing — understanding before building
What Is Next
Section titled “What Is Next”Phase 2 covers getting the application running from source on a native Linux environment — installing dependencies, configuring the database, diagnosing and fixing runtime issues, and committing the working state to GitHub with a reviewable diff.
Repository: sjchristie/humor-memory-game Full documentation: docs/CODEBASE.md