Run artifact

workspace/targets/ReadingList/blueprint/ARCHITECTURE.md

ARCHITECTURE: ReadingList

FieldValue
Version20260815 V1
DescriptionDefines the Flask application structure and module boundaries for the ReadingList web application.
Depends On
Providesapplication_factory, web_entrypoint
Consumes

Intent

ReadingList is a small Flask web application for maintaining an ordered personal list of books to read. The application uses one reader-facing workflow: submit a book, review the ordered list, and remove a book.

Modules and Boundaries

ModuleResponsibility
app/__init__.pyApplication factory and configuration initialization.
app/routes.pyHTTP route registration and request/response orchestration.
app/persistence.pySQLite connection management and the typed book-store boundary.
app/templates/Reader-facing HTML templates.
app/static/Shared CSS presentation.
tests/Automated behavior tests.
bin/test.shPOSIX-compatible complete-suite launcher.

The application factory creates an isolated Flask application, configures the database location, initializes the persistence boundary, and registers routes. Route handlers do not execute raw SQL. Persistence code does not render templates or make HTTP decisions.

Technical Decisions

Technology Stack

TechnologyUse
PythonApplication and test implementation.
FlaskWeb application, routing, templates, and test client.
SQLiteLocal persistent storage for books.
pytestAutomated behavior test runner.
HTML/CSSReader-facing interface and shared presentation.

Module Ownership

BoundaryOwning moduleAllowed low-level access
Application configurationApplication factoryFlask configuration APIs and environment values.
Persistenceapp.persistenceSQLite connections and SQL statements.
HTTPapp.routesFlask request, response, redirect, and rendering APIs.
PresentationTemplates and static assetsHTML, template variables, and CSS only.
Verificationtests/ and bin/test.shTest and process execution APIs.

Programmatic Acceptance

=== AC architecture-factory ===
Intent: The application factory creates a runnable Flask application with an HTTP test client.

from app import create_app

application = create_app({"TESTING": True, "DATABASE": ":memory:"}) client = application.test_client() response = client.get("/") assert response.status_code == 200 === END AC architecture-factory ===

=== AC architecture-isolation ===
Intent: Separate application instances can be created independently for isolated execution.

from app import create_app

first = create_app({"TESTING": True, "DATABASE": ":memory:"}) second = create_app({"TESTING": True, "DATABASE": ":memory:"}) assert first is not second assert first.test_client().get("/").status_code == 200 assert second.test_client().get("/").status_code == 200 === END AC architecture-isolation ===

=== AC architecture-entrypoint ===
Intent: The web entrypoint exposes the application factory without requiring a development server to start during import.

import importlib

module = importlib.import_module("app") assert callable(module.create_app) === END AC architecture-entrypoint ===

User Acceptance

Guardrails