> For the complete documentation index, see [llms.txt](https://taskflow-1.gitbook.io/taskflow-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://taskflow-1.gitbook.io/taskflow-docs/system-overview.md).

# System overview

TaskFlow is a (fictional) project-management SaaS: teams create projects, break them into tasks, and track work on boards. This document describes the system at the level an engineer — or an AI assistant — needs before touching code or reviewing a change.

## Components

| Component     | Stack                | Responsibility                                                                                  |
| ------------- | -------------------- | ----------------------------------------------------------------------------------------------- |
| `web-app`     | Next.js / TypeScript | Browser UI, board rendering, realtime updates                                                   |
| `api-service` | FastAPI / Python     | REST API, business rules, auth tokens — the demo implementation in this workspace is `demo-app` |
| `worker`      | Python / RQ          | Email digests, webhook delivery, report generation                                              |
| `postgres`    | PostgreSQL 16        | Primary store: users, projects, tasks, comments                                                 |
| `redis`       | Redis 7              | Job queues, board presence, rate-limit counters                                                 |

## Data flow

1. The browser talks only to `api-service` (REST, JSON, bearer tokens).
2. `api-service` writes to PostgreSQL and enqueues side-effect work (notifications, webhooks) to Redis.
3. `worker` processes the queue; a failed job retries with backoff and lands in a dead-letter list after 5 attempts (see `incident-runbook.md`).
4. Board presence is ephemeral: Redis pub/sub, never persisted.

## Boundaries and rules

* `api-service` is the only component allowed to write to PostgreSQL.
* `worker` must never call the public API of `api-service`; it reads the database read-replica and the queue payload.
* Every service exposes a health endpoint per the contract in `taskflow-api-docs` (`api-conventions.md`, "Health checks").
* PII (email addresses) is stored only in the `users` table; logs must use user IDs, never raw emails.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://taskflow-1.gitbook.io/taskflow-docs/system-overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
