Imported from mrinshad/Reach (
src/AGENTS.md). Install upstream withnpx skills add mrinshad/Reach --skill src. Copyright stays with the author.
Reach Backend & Automation Architecture (src/AGENTS.md)
This directory contains the FastAPI server, background Playwright automation, database abstraction, and web presentation layer.
Subsystem Navigation Matrix
| Subsystem / Directory | Responsibility | Primary Entrypoints & Modules | Designated Agent Guide |
|---|---|---|---|
src/api/ |
FastAPI REST API routers decomposed by domain (posts, tasks, stats, settings). | posts.py, tasks.py, stats.py, settings.py, models.py |
src/api/AGENTS.md |
src/services/ |
Sequential FIFO task queue engine, Playwright browser connectors, ChatGPT Custom GPT generator, Gmail automation, and health probes. | automation_tasks.py, chatgpt_service.py, gmail_service.py, firefox_connector.py, health_service.py, experience_extractor.py |
src/services/AGENTS.md |
src/db/ |
PostgreSQL database models, connection pooling, migrations, post queries, settings, and analytics. | connection.py, posts.py, settings.py, analytics.py |
src/db/AGENTS.md |
src/static/ |
Frontend UI assets: modular stylesheets (css/), client scripts (js/), component partials (partials/), and Service Worker (sw.js). |
index_layout.html, app.js, style.css, sw.js |
src/static/AGENTS.md |
src/app.py |
Master FastAPI application root. Configures CORS, development no-cache middleware, dynamic template compiler, and mounts api_router. |
app, serve_index, get_rendered_index_html |
Root Entrypoint |
src/config.py |
Configuration manager for persistent database settings and local fallback defaults. | load_config, save_config, is_headless |
Global Config |
Agent Directives for Backend
- Sequential Task Execution: Automation operations must be enqueued via
task_manager.enqueue_task(...). Never launch concurrent Playwright browser sessions on the persistent Firefox profile. - Clean Modular Imports: All subsystems and CLI scripts in
scripts/import directly from designated packages (src.services.*,src.db.*,src.api.*). No legacy shims are used. - Database-First Data Operations: Multi-parameter search, pagination, and sorting must be executed in PostgreSQL queries (
src/db/posts.py), never filtered in-memory in Python.