# ericgichuri/worklane architecture

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

- Interactive diagram: https://gitdiagram.com/ericgichuri/worklane
- Repository: https://github.com/ericgichuri/worklane

## Overview

Worklane is an in-development business workflow platform. The visible user path is initial setup or sign-in, session-aware navigation, and access to the dashboard and user/role administration; the backend provides authentication, password reset, and user/role APIs backed by SQLAlchemy models. The README and model definitions also identify customer requests, tasks, approvals, workflow stages, documents, activity logs, and automation as product capabilities, though their runtime flows are not shown. Those capabilities are represented without asserting unsampled execution paths.

Main entry points: [`frontend/src/App.jsx`](https://github.com/ericgichuri/worklane/blob/main/frontend/src/App.jsx) (Page routing), [`backend/routes/auth.py`](https://github.com/ericgichuri/worklane/blob/main/backend/routes/auth.py) (Authentication API), [`backend/routes/users.py`](https://github.com/ericgichuri/worklane/blob/main/backend/routes/users.py) (User and role API), [`frontend/src/context/AuthContext.jsx`](https://github.com/ericgichuri/worklane/blob/main/frontend/src/context/AuthContext.jsx) (Auth context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_entry["App bootstrap<br/>[main.jsx]"]
  node_routes["Page routing<br/>[App.jsx]"]
  node_auth_context["Auth context<br/>[AuthContext.jsx]"]
  node_auth_hook["Session and setup<br/>[useAuthAndSetup.js]"]
  node_login["Login and setup<br/>[Login.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_users_ui["User administration<br/>[Users.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_sidebar["Sidebar<br/>[Sidebar.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_user_api["User and role API<br/>[users.py]"]
  node_password_email["Reset email<br/>[email_password.py]"]
  node_response["API responses<br/>[response.py]"]
end

subgraph group_business["Workflow domain"]
  node_domain_models["Workflow domain models<br/>[models.py]"]
end

subgraph group_persistence["Backend and persistence"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_extensions["ORM and login extensions<br/>[extensions.py]"]
  node_config["Backend configuration<br/>[config.py]"]
  node_db[("SQLite database")]
end

node_operator(("Business user"))

node_operator -->|"uses"| node_entry
node_entry -->|"renders"| node_routes
node_entry -->|"provides auth"| node_auth_context
node_routes -->|"reads session"| node_auth_context
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_users_ui
node_routes -->|"renders"| node_navbar
node_routes -->|"renders"| node_sidebar
node_auth_context -->|"uses"| node_auth_hook
node_auth_hook -->|"calls API"| node_auth_api
node_login -->|"uses auth"| node_auth_context
node_navbar -->|"uses auth"| node_auth_context
node_navbar -->|"requests profile"| node_auth_api
node_users_ui -->|"calls API"| node_user_api
node_flask_app -->|"loads config"| node_config
node_flask_app -->|"initializes"| node_extensions
node_flask_app -->|"registers routes"| node_auth_api
node_flask_app -->|"registers routes"| node_user_api
node_auth_api -->|"queries and updates"| node_domain_models
node_auth_api -->|"commits changes"| node_extensions
node_auth_api -->|"formats replies"| node_response
node_auth_api -->|"sends reset link"| node_password_email
node_user_api -->|"queries and updates"| node_domain_models
node_user_api -->|"commits changes"| node_extensions
node_user_api -->|"formats replies"| node_response
node_domain_models -->|"uses ORM"| node_extensions
node_config -.->|"configures store"| node_db

click node_entry "https://github.com/ericgichuri/worklane/blob/main/frontend/src/main.jsx"
click node_routes "https://github.com/ericgichuri/worklane/blob/main/frontend/src/App.jsx"
click node_auth_context "https://github.com/ericgichuri/worklane/blob/main/frontend/src/context/AuthContext.jsx"
click node_auth_hook "https://github.com/ericgichuri/worklane/blob/main/frontend/src/hooks/useAuthAndSetup.js"
click node_login "https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Login.jsx"
click node_home "https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Home.jsx"
click node_dashboard "https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Dashboard.jsx"
click node_users_ui "https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Users.jsx"
click node_navbar "https://github.com/ericgichuri/worklane/blob/main/frontend/src/components/Navbar.jsx"
click node_sidebar "https://github.com/ericgichuri/worklane/blob/main/frontend/src/components/Sidebar.jsx"
click node_auth_api "https://github.com/ericgichuri/worklane/blob/main/backend/routes/auth.py"
click node_user_api "https://github.com/ericgichuri/worklane/blob/main/backend/routes/users.py"
click node_password_email "https://github.com/ericgichuri/worklane/blob/main/backend/utils/email_password.py"
click node_response "https://github.com/ericgichuri/worklane/blob/main/backend/utils/response.py"
click node_domain_models "https://github.com/ericgichuri/worklane/blob/main/backend/models/models.py"
click node_flask_app "https://github.com/ericgichuri/worklane/blob/main/backend/app.py"
click node_extensions "https://github.com/ericgichuri/worklane/blob/main/backend/extensions.py"
click node_config "https://github.com/ericgichuri/worklane/blob/main/backend/config.py"

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_entry,node_routes,node_auth_context,node_auth_hook,node_login,node_home,node_dashboard,node_users_ui,node_navbar,node_sidebar,node_operator toneBlue
class node_auth_api,node_user_api,node_password_email,node_response toneAmber
class node_domain_models toneMint
class node_flask_app,node_extensions,node_config,node_db toneRose
```

## Components

### Web client

- [App bootstrap](https://github.com/ericgichuri/worklane/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Page routing](https://github.com/ericgichuri/worklane/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/ericgichuri/worklane/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Session and setup](https://github.com/ericgichuri/worklane/blob/main/frontend/src/hooks/useAuthAndSetup.js): `frontend/src/hooks/useAuthAndSetup.js`
- [Login and setup](https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Home page](https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Dashboard](https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [User administration](https://github.com/ericgichuri/worklane/blob/main/frontend/src/pages/Users.jsx): `frontend/src/pages/Users.jsx`
- [Navigation](https://github.com/ericgichuri/worklane/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Sidebar](https://github.com/ericgichuri/worklane/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`

### Identity and access

- [Authentication API](https://github.com/ericgichuri/worklane/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [User and role API](https://github.com/ericgichuri/worklane/blob/main/backend/routes/users.py): `backend/routes/users.py`
- [Reset email](https://github.com/ericgichuri/worklane/blob/main/backend/utils/email_password.py): `backend/utils/email_password.py`
- [API responses](https://github.com/ericgichuri/worklane/blob/main/backend/utils/response.py): `backend/utils/response.py`

### Workflow domain

- [Workflow domain models](https://github.com/ericgichuri/worklane/blob/main/backend/models/models.py): `backend/models/models.py`

### Backend and persistence

- [Flask application](https://github.com/ericgichuri/worklane/blob/main/backend/app.py): `backend/app.py`
- [ORM and login extensions](https://github.com/ericgichuri/worklane/blob/main/backend/extensions.py): `backend/extensions.py`
- [Backend configuration](https://github.com/ericgichuri/worklane/blob/main/backend/config.py): `backend/config.py`
- **SQLite database**

### Other components

- **Business user**

## Connections

- Business user → App bootstrap: uses (evidence: `frontend/src/main.jsx`)
- App bootstrap → Page routing: renders (evidence: `frontend/src/main.jsx`)
- App bootstrap → Auth context: provides auth (evidence: `frontend/src/main.jsx`)
- Page routing → Auth context: reads session (evidence: `frontend/src/App.jsx`)
- Page routing → Login and setup: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Home page: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → User administration: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Page routing → Sidebar: renders (evidence: `frontend/src/App.jsx`)
- Auth context → Session and setup: uses (evidence: `frontend/src/context/AuthContext.jsx`)
- Session and setup → Authentication API: calls API (evidence: `frontend/src/hooks/useAuthAndSetup.js`)
- Login and setup → Auth context: uses auth (evidence: `frontend/src/pages/Login.jsx`)
- Navigation → Auth context: uses auth (evidence: `frontend/src/components/Navbar.jsx`)
- Navigation → Authentication API: requests profile (evidence: `frontend/src/components/Navbar.jsx`)
- User administration → User and role API: calls API (evidence: `frontend/src/pages/Users.jsx`)
- Flask application → Backend configuration: loads config (evidence: `backend/app.py`)
- Flask application → ORM and login extensions: initializes (evidence: `backend/app.py`)
- Flask application → Authentication API: registers routes (evidence: `backend/app.py`)
- Flask application → User and role API: registers routes (evidence: `backend/app.py`)
- Authentication API → Workflow domain models: queries and updates (evidence: `backend/routes/auth.py`)
- Authentication API → ORM and login extensions: commits changes (evidence: `backend/routes/auth.py`)
- Authentication API → API responses: formats replies (evidence: `backend/routes/auth.py`)
- Authentication API → Reset email: sends reset link (evidence: `backend/routes/auth.py`)
- User and role API → Workflow domain models: queries and updates (evidence: `backend/routes/users.py`)
- User and role API → ORM and login extensions: commits changes (evidence: `backend/routes/users.py`)
- User and role API → API responses: formats replies (evidence: `backend/routes/users.py`)
- Workflow domain models → ORM and login extensions: uses ORM (evidence: `backend/models/models.py`)
- Backend configuration → SQLite database: configures store
