Back

The Build Room / Notes

Engineering Notes

Problems I’ve investigated, the fixes I made, and the lessons I’m carrying into future projects.

Filter by technology or topic

Showing 12 notes

BR-012

Verifying an OpenAPI security fix

PartsPilot v3 · 18 Oct 2026

Fixed / Learned

Verified an OpenAPI security fix on the separate PartsPilot v3 branch against the existing tests and endpoint regression checks.

BackendSecurityTestingOpenAPI
Read the engineering breakdown

Problem

The OpenAPI security fix needed to be checked against existing endpoint behaviour.

Cause

A security-related change can risk introducing regressions elsewhere in the API.

Fix

Verified the fix on the separate v3 branch; all 70 tests and 55 endpoint regression checks passed. The change has been committed and pushed, but hasn’t been merged into main.

Lesson

Check security changes against the broader API regression suite.

BR-011

From interaction modes to app structure

Bloom v3 · 16 Oct 2026

Learned

Locked Bloom’s interaction mode specification and mapped it into the app’s information architecture and routes.

Information ArchitectureRoutingQA
Read the engineering breakdown

Problem

Bloom’s modes needed to be reflected in the app’s information architecture and routes.

Cause

The mode specification needed to be settled before the route structure could be finalised.

Fix

Completed and locked the mode specification, mapped it into the information architecture and routes, then QA-checked the routes.

Lesson

Define the experience modes before finalising routes, so the app’s structure follows the intended experience.

BR-010

Keeping .NET Build Output Out of Git

PartsPilot v3 · 28 Sept 2026

Fixed / Learned

Cleaned up generated .NET build files that were appearing in Git changes during the ongoing PartsPilot v3 migration.

BackendDockerGit
Read the engineering breakdown

Problem

Generated files in the bin/ and obj/ folders were showing up alongside the source changes, making the repository status harder to review.

Cause

The generated build output was not fully excluded from Git tracking.

Fix

Updated the ignore rules and removed the generated files from Git tracking. This kept the cleanup focused on repository contents; it did not complete the PartsPilot v3 migration.

Lesson

Ignore build output early. If generated files are already tracked, updating .gitignore alone is not enough; remove them from the index, then check Git status before staging source changes.

BR-009

Fixing React API Response-Shape Rendering

PartsPilot v2 · 21 Aug 2026

Fixed / Learned

Fixed a React rendering failure caused by storing an API response wrapper object in state instead of the parts array contained inside it.

FrontendReactJavaScriptFastAPIDebuggingFull-Stack
Read the engineering breakdown

Problem

The PartsPilot frontend successfully received data from the backend, but the interface failed when it attempted to run parts.map(). React expected parts to be an array, but the state contained the complete response object.

Cause

The FastAPI endpoint returned an object containing an items property rather than returning an array directly. The frontend used setParts(data), which stored the wrapper object in state. Array methods such as map could not be used on that object.

Fix

Inspected the returned JSON structure and changed the state update to setParts(data.items). Confirmed the data path by working through the response as object, property, array index, and item property before rendering it in JSX.

Lesson

A successful API request does not guarantee that the returned data has the shape a component expects. Before updating React state, inspect the response structure and store the specific value the interface needs.

BR-008

Pinned

Debugging Docker Port Mapping and CORS

PartsPilot v2 · 21 Aug 2026

Fixed / Learned

Diagnosed a failed React-to-FastAPI connection by separating the container’s internal port from the port exposed to the host and then correcting the backend CORS configuration.

DockerReactFastAPICORSDebuggingFull-Stack
Read the engineering breakdown

Problem

The React frontend could not load parts from the FastAPI backend. Requests targeted localhost:8000 even though Docker exposed the API to the host on port 8001. Browser requests also required permission to cross from the frontend origin to the backend origin.

Cause

The Docker mapping 8001:8000 meant FastAPI listened on port 8000 inside its container but was accessed through port 8001 from the host browser. The frontend and backend also ran on different origins, so the browser applied CORS restrictions.

Fix

Changed the frontend request URL to use http://localhost:8001/api/parts and configured FastAPI to allow requests from the frontend development origin. Used the browser error and HTTP response type to distinguish connection, route, authentication, server, and CORS failures.

Lesson

Docker port mappings have a container side and a host side. Browser-based frontend code must use the host port, while cross-origin permission must be configured by the backend rather than bypassed in the frontend.

BR-007

Fixing PartsPilot Tests Outside Docker

PartsPilot v2 · 04 Aug 2026

Fixed / Learned

Separated the PartsPilot test environment from its Docker-only PostgreSQL hostname by introducing an isolated test database and FastAPI dependency overrides.

BackendFastAPIPytestSQLAlchemyPostgreSQLDocker
Read the engineering breakdown

Problem

Backend tests failed when they were run directly from the host machine because the application attempted to connect to PostgreSQL using the hostname db.

Cause

The hostname db was the Docker Compose service name. It could be resolved by containers on the Compose network, but it was not a valid PostgreSQL hostname for pytest processes running directly on the Mac.

Fix

Configured the tests to use an isolated SQLite database and overrode the application’s database dependency during test execution. This allowed endpoint tests to run independently without connecting to the development PostgreSQL container or changing its data.

Lesson

Application and test environments should not share hidden infrastructure assumptions. Dependency injection makes it possible to test FastAPI routes against a controlled database while preserving PostgreSQL for development and production.

BR-006

Safely Renaming a Dockerised Backend Project

AccessHub · 01 Aug 2026

Fixed / Learned

Reviewed code, Docker configuration, environment settings and documentation while renaming the Secure User Management project and removing stale project references.

BackendDockerSecurityGitFastAPIPostgreSQL
Read the engineering breakdown

Problem

Renaming the project involved more than changing its repository title. Old names remained in Docker Compose configuration, build paths, database settings and documentation, while sensitive configuration also needed to be reviewed.

Cause

A project identity can be repeated across source files, container configuration, environment variables, volumes, documentation and deployment settings. Updating only visible names leaves inconsistent configuration behind.

Fix

Applied the rename one area at a time, searched for stale references, corrected Docker Compose project and build configuration, reviewed the local database implications and rotated exposed secret configuration. Validated the Compose file before rebuilding and retesting authentication, CRUD and health endpoints.

Lesson

Repository renames should be treated as controlled configuration migrations. Search globally, protect secrets, understand whether database volumes need migration or recreation, and validate each layer before considering the rename complete.

BR-005

Pinned

Fixing Inventory Dashboard Analytics

PartsPilot v2 · 26 Jul 2026

Fixed / Learned

Diagnosed and resolved an analytics issue where dashboard totals were calculated from a paginated ten-item response instead of the full PostgreSQL inventory.

ReactTypeScriptFastAPIPostgreSQLDebuggingAnalytics
Read the engineering breakdown

Problem

As new products were added, the inventory table updated correctly, but the dashboard continued to report totals for only ten items. Product count, quantity, inventory value, and stock-status metrics were therefore inaccurate.

Cause

The React frontend calculated global dashboard metrics directly from the /items response. That endpoint intentionally returns a paginated dataset with a default limit of ten records, while the backend aggregation endpoints already calculated statistics across the full database.

Fix

Separated paginated inventory data from reporting data. The inventory preview continued using /items, while dashboard KPIs and category analytics were connected to /items/stats, /items/category-summary, and /items/category-value. Added dedicated React state and refreshed aggregate data after create, update, and delete operations.

Lesson

Paginated operational data should not be reused for global analytics. When frontend totals do not match database records, trace the complete data flow and verify which endpoint supplies each part of the interface.

BR-004

Pinned

Fixing Bloom Routine Synchronisation

Bloom v2 · 13 Jul 2026

Fixed / Learned

Diagnosed and resolved a routine persistence issue where authenticated users were unknowingly using localStorage instead of the backend API.

ReactFastAPIDebuggingFull-Stack
Read the engineering breakdown

Problem

Routines created on the Routines page did not appear on Home or Progress, and authenticated users were not persisting routine changes to PostgreSQL.

Cause

Routines.jsx imported backend CRUD functions but never called them. The page always used localStorage regardless of authentication state, creating two separate data sources.

Fix

Implemented backend CRUD flows for authenticated users, preserved localStorage behaviour for demo users, added cross-page synchronisation events, and connected routine operations to FastAPI.

Lesson

When multiple features fail together, trace the complete data flow before fixing individual symptoms. Often a single architectural issue is responsible for several visible bugs.

BR-003

Fixing Frontend CI TypeScript Errors

HR Management Platform · 05 Jul 2026

Fixed / Learned

GitHub Actions caught hidden TypeScript issues involving JSX/TSX imports, named/default exports, and inconsistent component props.

FrontendTypeScriptCI/CDReact
Read the engineering breakdown

Problem

Frontend CI failed during the production build even though the app had worked during development.

Cause

Dashboard components used inconsistent import/export styles and different prop names for the same stat card component.

Fix

Created a typed AdminStatCard component, updated StatCard exports, and allowed StatCard to accept either title or label props.

Lesson

CI/CD can catch hidden frontend type issues before deployment. Reusable TypeScript components need consistent imports, exports, and props.

BR-002

Pinned

Fixing an Astro Build Hang

Developer Portfolio · 05 Jul 2026

Fixed / Learned

Fixed a local Astro build hang by clearing stale processes and disabling Astro telemetry during builds.

FrontendAstroBuild Tools
Read the engineering breakdown

Problem

The Astro build appeared to stick before producing normal build output.

Cause

The issue was likely caused by stale Astro/Vite/Node processes, cache state, or telemetry hanging before the build output.

Fix

Stopped old processes, cleared build cache, and updated the build command to disable Astro telemetry.

Lesson

Build issues are not always code errors. Sometimes the local tooling environment needs to be reset.

BR-001

Fixing Backend Tests for HR Management Platform

HR Management Platform · 28 Jun 2026

Fixed / Learned

Cleaned up the backend testing checkpoint until the HR Management Platform test suite passed successfully.

BackendFastAPIPytestPostgreSQL
Read the engineering breakdown

Problem

The backend needed a stable testing checkpoint before larger features like authentication, role-based access, and CI/CD.

Cause

The app was becoming more realistic, with FastAPI routes, PostgreSQL logic, SQLAlchemy models, schemas, and ticket workflows.

Fix

Validated the backend test setup until the suite reached 11 passing tests.

Lesson

Backend tests make a project stronger because they confirm the API works beyond manual testing.