# raunakmali08/task-manager architecture

> Architecture diagram of the GitHub repository raunakmali08/task-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raunakmali08/task-manager
- Repository: https://github.com/raunakmali08/task-manager

## Overview

1. **Project shape**
   - This is a small **single-service Flask application** packaged for **Docker** and wired into a **Jenkins CI/CD pipeline**.
   - The architecture is intentionally simple: one Python app, one SQLite database, one HTML template, and a pipeline that builds/tests/deploys the container.

2. **Primary runtime component**
   - `app.py` is the core application boundary.
   - It serves both the browser UI and the REST API, so there is no separate frontend service or microservice split.

3. **User-facing interface**
   - `templates/index.html` is the only UI template.
   - The browser hits `GET /` for the page, and that page likely uses the API endpoints to manage tasks dynamically.

4. **API boundary**
   - The app exposes CRUD-style endpoints under `/api/tasks`.
   - The API is the main data contract between the browser and the server:
     - list tasks
     - create task
     - update task
     - delete task

5. **Data storage**
   - Persistence is handled by **SQLite** via `tasks.db`.
   - This is a local file-backed database, so the app has a lightweight state layer rather than a separate database server.
   - The README notes the DB is auto-created, which suggests the app initializes storage on startup if needed.

6. **Application flow**
   - Browser requests the landing page from Flask.
   - Client-side interactions go to the JSON API.
   - The Flask app reads/writes task data in SQLite and returns responses to the browser.
   - There is no evidence of message queues, background workers, or external APIs.

7. **Containerization boundary**
   - `Dockerfile` defines the runtime packaging for the app.
   - The app is expected to run inside a container, which isolates dependencies and makes the deployment step reproducible.
   - Port `5000` is the service port used in deployment according to the README.

8. **CI/CD control plane**
   - `Jenkinsfile` defines the automation pipeline.
   - The pipeline is the key DevOps subsystem in this repo and is the main reason the project exists.

9. **Pipeline stages and flow**
   - Source changes in GitHub trigger Jenkins.
   - Jenkins pulls the repo, builds the Docker image, runs tests, then deploys by replacing the running container.
   - The deployment model is “stop old container, start new container,” so the release boundary is the Docker container, not the app process itself.

10. **Testing boundary**
    - `tests/test_app.py` contains the Pytest suite.
    - Tests are executed in the pipeline before deployment, acting as the quality gate between build and release.
    - The README says there are four tests, which suggests coverage is focused on core task CRUD behavior and app routes.

11. **Operational dependencies**
    - Jenkins is run in Docker in the described setup, and it needs access to the Docker socket to build/run app containers.
    - GitHub is the source-of-truth repository and pipeline trigger source.
    - WSL2/Ubuntu is the local environment described in the README, but it is not part of the application architecture itself.

12. **What to draw as the main diagram**
    - A browser/client on one side.
    - A single Flask monolith in the middle.
    - SQLite `tasks.db` as the persistence layer beneath it.
    - Jenkins/GitHub/Docker as the delivery pipeline around it.
    - The key architectural idea is that the repo is as much about **automated build-test-deploy flow** as it is about the task manager application.

Main entry points: [`app.py`](https://github.com/raunakmali08/task-manager/blob/main/app.py) (Flask app), [`Jenkinsfile`](https://github.com/raunakmali08/task-manager/tree/main/Jenkinsfile) (Deploy stage), [`Dockerfile`](https://github.com/raunakmali08/task-manager/tree/main/Dockerfile) (Image build), [`tests/test_app.py`](https://github.com/raunakmali08/task-manager/blob/main/tests/test_app.py) (Test gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_flask_app["Flask app<br/>python service<br/>[app.py]"]
  node_ui_route["Landing page<br/>http route<br/>[app.py]"]
  node_api_routes["Task API<br/>rest endpoints<br/>[app.py]"]
  node_task_store["Task store<br/>persistence layer<br/>[app.py]"]
  node_tasks_db[("tasks.db<br/>sqlite database<br/>[tasks.db]")]
  node_index_html["index.html<br/>template<br/>[index.html]"]
end

subgraph group_delivery["Delivery pipeline"]
  node_dockerfile["Dockerfile<br/>container spec"]
  node_jenkinsfile["Jenkinsfile<br/>pipeline spec"]
  node_tests["Pytest<br/>test suite<br/>[test_app.py]"]
  node_image_build["Image build<br/>pipeline stage"]
  node_test_gate["Test gate<br/>pipeline stage<br/>[test_app.py]"]
  node_deploy_stage["Deploy stage<br/>pipeline stage"]
end

subgraph group_external["External systems"]
  node_browser(("Browser<br/>client"))
  node_github(("GitHub<br/>source control"))
  node_jenkins(("Jenkins<br/>ci/cd runner"))
  node_docker_engine(("Docker runtime<br/>container host"))
end

node_browser -->|"GET /"| node_ui_route
node_browser -->|"CRUD JSON"| node_api_routes
node_ui_route -->|"renders"| node_index_html
node_flask_app -->|"hosts"| node_ui_route
node_flask_app -->|"hosts"| node_api_routes
node_api_routes -->|"uses"| node_task_store
node_task_store -->|"persists"| node_tasks_db
node_dockerfile -->|"defines"| node_image_build
node_jenkinsfile -->|"runs on"| node_jenkins
node_jenkins -->|"pulls source"| node_github
node_jenkins -->|"builds"| node_image_build
node_jenkins -->|"executes"| node_test_gate
node_tests -->|"provides"| node_test_gate
node_jenkins -->|"executes"| node_deploy_stage
node_deploy_stage -->|"starts container"| node_docker_engine
node_docker_engine -->|"runs"| node_flask_app

click node_flask_app "https://github.com/raunakmali08/task-manager/blob/main/app.py"
click node_ui_route "https://github.com/raunakmali08/task-manager/blob/main/app.py"
click node_api_routes "https://github.com/raunakmali08/task-manager/blob/main/app.py"
click node_task_store "https://github.com/raunakmali08/task-manager/blob/main/app.py"
click node_tasks_db "https://github.com/raunakmali08/task-manager/blob/main/tasks.db"
click node_index_html "https://github.com/raunakmali08/task-manager/blob/main/templates/index.html"
click node_dockerfile "https://github.com/raunakmali08/task-manager/tree/main/Dockerfile"
click node_jenkinsfile "https://github.com/raunakmali08/task-manager/tree/main/Jenkinsfile"
click node_tests "https://github.com/raunakmali08/task-manager/blob/main/tests/test_app.py"
click node_image_build "https://github.com/raunakmali08/task-manager/tree/main/Dockerfile"
click node_test_gate "https://github.com/raunakmali08/task-manager/blob/main/tests/test_app.py"
click node_deploy_stage "https://github.com/raunakmali08/task-manager/tree/main/Jenkinsfile"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flask_app,node_ui_route,node_api_routes,node_task_store,node_tasks_db,node_index_html toneBlue
class node_dockerfile,node_jenkinsfile,node_tests,node_image_build,node_test_gate,node_deploy_stage toneAmber
class node_browser,node_github,node_jenkins,node_docker_engine toneMint
```

## Components

### Application runtime

Flask task manager and its local persistence

- [Flask app](https://github.com/raunakmali08/task-manager/blob/main/app.py): python service · Single-service task manager boundary · `app.py`
- [Landing page](https://github.com/raunakmali08/task-manager/blob/main/app.py): http route · Serves the browser entry page · `app.py`
- [Task API](https://github.com/raunakmali08/task-manager/blob/main/app.py): rest endpoints · CRUD endpoints under /api/tasks · `app.py`
- [Task store](https://github.com/raunakmali08/task-manager/blob/main/app.py): persistence layer · App-side database access and task CRUD logic · `app.py`
- [tasks.db](https://github.com/raunakmali08/task-manager/blob/main/tasks.db): sqlite database · Local file-backed task data · `tasks.db`
- [index.html](https://github.com/raunakmali08/task-manager/blob/main/templates/index.html): template · Single HTML UI template · `templates/index.html`

### Delivery pipeline

Container build, test, and deploy automation

- [Dockerfile](https://github.com/raunakmali08/task-manager/tree/main/Dockerfile): container spec · Builds the application image · `Dockerfile`
- [Jenkinsfile](https://github.com/raunakmali08/task-manager/tree/main/Jenkinsfile): pipeline spec · Defines build, test, and deploy stages · `Jenkinsfile`
- [Pytest](https://github.com/raunakmali08/task-manager/blob/main/tests/test_app.py): test suite · Validates app routes and task behavior · `tests/test_app.py`
- [Image build](https://github.com/raunakmali08/task-manager/tree/main/Dockerfile): pipeline stage · Packages the Flask app into a Docker image · `Dockerfile`
- [Test gate](https://github.com/raunakmali08/task-manager/blob/main/tests/test_app.py): pipeline stage · Runs automated tests before release · `tests/test_app.py`
- [Deploy stage](https://github.com/raunakmali08/task-manager/tree/main/Jenkinsfile): pipeline stage · Replaces the running container with the new release · `Jenkinsfile`

### External systems

Clients and services outside the repository

- **Browser**: client · User-facing client that loads the page and calls the API
- **GitHub**: source control · Repository source and pipeline trigger
- **Jenkins**: ci/cd runner · Executes the build-test-deploy pipeline
- **Docker runtime**: container host · Builds and runs the application container

## Connections

- Browser → Landing page: GET / · Loads the single-page UI
- Browser → Task API: CRUD JSON · Client-side task operations
- Landing page → index.html: renders · Flask serves the HTML template
- Flask app → Landing page: hosts · Application boundary includes the landing page route
- Flask app → Task API: hosts · Application boundary includes task API endpoints
- Task API → Task store: uses · API handlers read and write tasks through the storage layer
- Task store → tasks.db: persists · SQLite file stores task records
- Dockerfile → Image build: defines · Container image packaging for the app
- Jenkinsfile → Jenkins: runs on · Jenkins executes the pipeline definition
- Jenkins → GitHub: pulls source · Pipeline starts from repository changes
- Jenkins → Image build: builds · Creates the app container image
- Jenkins → Test gate: executes · Runs the Pytest suite before release
- Pytest → Test gate: provides · Test suite acts as the quality gate
- Jenkins → Deploy stage: executes · Controls release and replacement of the running container
- Deploy stage → Docker runtime: starts container · Deployment runs the new image in Docker
- Docker runtime → Flask app: runs · Container hosts the Flask service on port 5000
