# prshntkrr/form_builder architecture

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

- Interactive diagram: https://gitdiagram.com/prshntkrr/form_builder
- Repository: https://github.com/prshntkrr/form_builder

## Overview

e-Agrology is a modular agricultural data-collection platform: users define forms, deploy them to project participants, collect and review answers, and report on the resulting data. The graph combines the README’s documented capabilities with the supplied source excerpts; several domain connections are documented rather than directly visible in sampled implementations, so uncertain call-level wiring is omitted.

Main entry points: [`backend/app/modules/forms/routers/forms.py`](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/routers/forms.py) (Form routes), [`backend/app/modules/forms/submission_service.py`](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/submission_service.py) (Submission processing), [`backend/app/main.py`](https://github.com/prshntkrr/form_builder/blob/master/backend/app/main.py) (FastAPI entry point), [`backend/app/modules/forms/form_schema.py`](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/form_schema.py) (Form definition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application core"]
  node_frontend["React application<br/>[App.jsx]"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_api["FastAPI entry point<br/>[main.py]"]
  node_postgres[("PostgreSQL<br/>[database.py]")]
end

subgraph group_forms["Forms and collection"]
  node_form_ui["Form builder and renderer<br/>[index.jsx]"]
  node_form_api["Form routes<br/>[forms.py]"]
  node_form_definition["Form definition<br/>[form_schema.py]"]
  node_submission["Submission processing"]
  node_channels["Channel ingestion<br/>[ingestion.py]"]
end

subgraph group_reference["Standards and catalogues"]
  node_standards["Standards services"]
  node_catalogues["Client catalogues<br/>[catalog_service.py]"]
end

subgraph group_projects["Projects and review"]
  node_projects["Project management<br/>[project_service.py]"]
  node_assignment["Form assignment"]
  node_review["Submission review"]
end

subgraph group_data["Reporting and integrations"]
  node_dashboards["Dashboard reporting"]
  node_query["Dashboard query<br/>[query_service.py]"]
  node_external_db["External data import<br/>[import_service.py]"]
end

node_user(("Platform user"))
node_external_source[("External database")]
node_mcdc["MCDC platform"]
node_openai["OpenAI service"]

node_user -->|"uses"| node_frontend
node_frontend -->|"REST requests"| node_api
node_api -->|"mounts auth routes"| node_auth
node_api -->|"initializes pool"| node_postgres
node_api -->|"mounts module routes"| node_form_api
node_form_ui -->|"form requests"| node_form_api
node_form_api -->|"normalizes definitions"| node_form_definition
node_form_definition -->|"uses standards"| node_standards
node_form_definition -->|"uses catalogues"| node_catalogues
node_form_api -->|"handles submissions"| node_submission
node_channels -->|"normalizes answers for"| node_submission
node_submission -->|"stores answers"| node_postgres
node_user -->|"manages projects"| node_projects
node_projects -->|"assigns forms"| node_assignment
node_assignment -->|"targets collection"| node_submission
node_submission -->|"enters workflow"| node_review
node_user -->|"views reports"| node_dashboards
node_dashboards -->|"requests data"| node_query
node_query -->|"reads collected data"| node_postgres
node_external_source -->|"provides tables"| node_external_db
node_external_db -->|"copies data"| node_postgres
node_form_definition -.->|"drafts from prompts"| node_openai
node_form_api -.->|"exports published forms"| node_mcdc

click node_frontend "https://github.com/prshntkrr/form_builder/blob/master/frontend/src/App.jsx"
click node_auth "https://github.com/prshntkrr/form_builder/blob/master/backend/app/core/auth_service.py"
click node_api "https://github.com/prshntkrr/form_builder/blob/master/backend/app/main.py"
click node_postgres "https://github.com/prshntkrr/form_builder/blob/master/backend/app/core/database.py"
click node_form_ui "https://github.com/prshntkrr/form_builder/blob/master/frontend/src/modules/forms/index.jsx"
click node_form_api "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/routers/forms.py"
click node_form_definition "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/form_schema.py"
click node_submission "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/submission_service.py"
click node_channels "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/ingestion.py"
click node_standards "https://github.com/prshntkrr/form_builder/tree/master/backend/app/modules/standards"
click node_catalogues "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/client_catalog/catalog_service.py"
click node_projects "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/projects/project_service.py"
click node_assignment "https://github.com/prshntkrr/form_builder/tree/master/backend/app/modules/projects"
click node_review "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/projects/submission_workflow.py"
click node_dashboards "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/dashboards/services/dashboard_service.py"
click node_query "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/dashboards/services/query_service.py"
click node_external_db "https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/external_db/import_service.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_frontend,node_auth,node_api,node_postgres,node_user toneBlue
class node_form_ui,node_form_api,node_form_definition,node_submission,node_channels,node_external_source toneAmber
class node_standards,node_catalogues toneMint
class node_projects,node_assignment,node_review toneRose
class node_dashboards,node_query,node_external_db,node_mcdc,node_openai toneIndigo
```

## Components

### Application core

- [React application](https://github.com/prshntkrr/form_builder/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication](https://github.com/prshntkrr/form_builder/blob/master/backend/app/core/auth_service.py): `backend/app/core/auth_service.py`
- [FastAPI entry point](https://github.com/prshntkrr/form_builder/blob/master/backend/app/main.py): `backend/app/main.py`
- [PostgreSQL](https://github.com/prshntkrr/form_builder/blob/master/backend/app/core/database.py): `backend/app/core/database.py`

### Forms and collection

- [Form builder and renderer](https://github.com/prshntkrr/form_builder/blob/master/frontend/src/modules/forms/index.jsx): `frontend/src/modules/forms/index.jsx`
- [Form routes](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/routers/forms.py): `backend/app/modules/forms/routers/forms.py`
- [Form definition](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/form_schema.py): `backend/app/modules/forms/form_schema.py`
- [Submission processing](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/submission_service.py): `backend/app/modules/forms/submission_service.py`
- [Channel ingestion](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/forms/ingestion.py): `backend/app/modules/forms/ingestion.py`

### Standards and catalogues

- [Standards services](https://github.com/prshntkrr/form_builder/tree/master/backend/app/modules/standards): `backend/app/modules/standards`
- [Client catalogues](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/client_catalog/catalog_service.py): `backend/app/modules/client_catalog/catalog_service.py`

### Projects and review

- [Project management](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/projects/project_service.py): `backend/app/modules/projects/project_service.py`
- [Form assignment](https://github.com/prshntkrr/form_builder/tree/master/backend/app/modules/projects): `backend/app/modules/projects`
- [Submission review](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/projects/submission_workflow.py): `backend/app/modules/projects/submission_workflow.py`

### Reporting and integrations

- [Dashboard reporting](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/dashboards/services/dashboard_service.py): `backend/app/modules/dashboards/services/dashboard_service.py`
- [Dashboard query](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/dashboards/services/query_service.py): `backend/app/modules/dashboards/services/query_service.py`
- [External data import](https://github.com/prshntkrr/form_builder/blob/master/backend/app/modules/external_db/import_service.py): `backend/app/modules/external_db/import_service.py`

### Other components

- **Platform user**
- **External database**
- **MCDC platform**
- **OpenAI service**

## Connections

- Platform user → React application: uses
- React application → FastAPI entry point: REST requests
- FastAPI entry point → Authentication: mounts auth routes
- FastAPI entry point → PostgreSQL: initializes pool
- FastAPI entry point → Form routes: mounts module routes
- Form builder and renderer → Form routes: form requests
- Form routes → Form definition: normalizes definitions
- Form definition → Standards services: uses standards
- Form definition → Client catalogues: uses catalogues
- Form routes → Submission processing: handles submissions
- Channel ingestion → Submission processing: normalizes answers for
- Submission processing → PostgreSQL: stores answers
- Platform user → Project management: manages projects
- Project management → Form assignment: assigns forms
- Form assignment → Submission processing: targets collection
- Submission processing → Submission review: enters workflow
- Platform user → Dashboard reporting: views reports
- Dashboard reporting → Dashboard query: requests data
- Dashboard query → PostgreSQL: reads collected data
- External database → External data import: provides tables
- External data import → PostgreSQL: copies data
- Form definition → OpenAI service: drafts from prompts
- Form routes → MCDC platform: exports published forms
