# pallets-eco/flask-admin architecture

> Architecture diagram of the GitHub repository pallets-eco/flask-admin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pallets-eco/flask-admin
- Repository: https://github.com/pallets-eco/flask-admin

## Overview

Flask-Admin is a Flask extension for building customizable web administration interfaces. An application developer registers admin views; administrators use the resulting web UI to browse and edit records, with model views providing CRUD and ORM-specific integrations handling persistence. The package also documents file management, Redis console, and multiple ORM adapters. Relationships between unsampled adapter internals and their stores are documented capabilities, not inspected call paths; those links are therefore dashed.

Main entry points: [`flask_admin/model/base.py`](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/base.py) (Model views), [`flask_admin/model/form.py`](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/form.py) (Model form generation), [`flask_admin/base.py`](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/base.py) (Admin registry), [`flask_admin/blueprints.py`](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/blueprints.py) (View routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin framework"]
  node_admin_registry["Admin registry<br/>[base.py]"]
  node_routing["View routing<br/>[blueprints.py]"]
  node_menus["Menus and themes<br/>[menu.py]"]
  node_shared_helpers["Request helpers<br/>[helpers.py]"]
  node_compat_types["Compatibility and types<br/>[_types.py]"]
  node_translations["Localization<br/>[babel.py]"]
end

subgraph group_model["Model administration"]
  node_model_views["Model views<br/>[base.py]"]
  node_actions["Bulk actions<br/>[actions.py]"]
end

subgraph group_forms["Forms and presentation"]
  node_model_forms["Model form generation<br/>[form.py]"]
  node_model_fields["Model fields<br/>[fields.py]"]
  node_form_core["Form fields and uploads<br/>[fields.py]"]
  node_form_rules["Form layout rules<br/>[rules.py]"]
  node_form_widgets["Form widgets<br/>[widgets.py]"]
  node_model_widgets["Model widgets<br/>[widgets.py]"]
end

subgraph group_integrations["Data integrations"]
  node_sqlalchemy["SQLAlchemy adapter<br/>[view.py]"]
  node_peewee["Peewee adapter<br/>[view.py]"]
  node_mongoengine["MongoEngine adapter<br/>[view.py]"]
  node_pymongo["PyMongo adapter<br/>[view.py]"]
  node_geoalchemy["GeoAlchemy support"]
end

subgraph group_utilities["Additional admin tools"]
  node_file_admin["File management<br/>[__init__.py]"]
  node_cloud_storage["Cloud storage backends"]
  node_redis_console["Redis console<br/>[rediscli.py]"]
end

node_developer(("Application developer"))
node_admin_user(("Admin user"))
node_flask_app["Flask application"]

node_developer -->|"registers views"| node_admin_registry
node_admin_registry -->|"registers blueprints"| node_flask_app
node_admin_registry -->|"creates routes"| node_routing
node_admin_registry -->|"adds menu entries"| node_menus
node_admin_user -->|"uses admin UI"| node_flask_app
node_flask_app -.->|"dispatches requests"| node_routing
node_routing -.->|"routes to views"| node_model_views
node_model_views -->|"generates forms"| node_model_forms
node_model_forms -->|"uses fields"| node_model_fields
node_model_fields -->|"renders with"| node_model_widgets
node_model_forms -->|"builds forms"| node_form_core
node_model_forms -->|"applies layout"| node_form_rules
node_model_views -->|"supports actions"| node_actions
node_model_views -.->|"uses adapter"| node_sqlalchemy
node_model_views -.->|"uses adapter"| node_peewee
node_model_views -.->|"uses adapter"| node_mongoengine
node_model_views -.->|"uses adapter"| node_pymongo
node_sqlalchemy -->|"provides form conversion"| node_model_forms
node_peewee -->|"provides form conversion"| node_model_forms
node_mongoengine -->|"provides form conversion"| node_model_forms
node_model_views -->|"uses request helpers"| node_shared_helpers
node_file_admin -.->|"supports backends"| node_cloud_storage
node_admin_user -->|"manages files"| node_file_admin
node_admin_user -->|"uses console"| node_redis_console
node_admin_user -.->|"edits geo data"| node_geoalchemy
node_admin_registry -->|"uses localization"| node_translations
node_model_views -->|"uses shared types"| node_compat_types

click node_admin_registry "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/base.py"
click node_routing "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/blueprints.py"
click node_menus "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/menu.py"
click node_shared_helpers "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/helpers.py"
click node_model_views "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/base.py"
click node_actions "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/actions.py"
click node_model_forms "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/form.py"
click node_model_fields "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/fields.py"
click node_form_core "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/fields.py"
click node_form_rules "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/rules.py"
click node_form_widgets "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/widgets.py"
click node_model_widgets "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/widgets.py"
click node_sqlalchemy "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/sqla/view.py"
click node_peewee "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/peewee/view.py"
click node_mongoengine "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/mongoengine/view.py"
click node_pymongo "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/pymongo/view.py"
click node_file_admin "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/fileadmin/__init__.py"
click node_cloud_storage "https://github.com/pallets-eco/flask-admin/tree/master/flask_admin/contrib/fileadmin"
click node_redis_console "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/rediscli.py"
click node_geoalchemy "https://github.com/pallets-eco/flask-admin/tree/master/flask_admin/contrib/geoa"
click node_compat_types "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/_types.py"
click node_translations "https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/babel.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_admin_registry,node_routing,node_menus,node_shared_helpers,node_compat_types,node_translations,node_admin_user toneBlue
class node_model_views,node_actions toneAmber
class node_model_forms,node_model_fields,node_form_core,node_form_rules,node_form_widgets,node_model_widgets toneMint
class node_sqlalchemy,node_peewee,node_mongoengine,node_pymongo,node_geoalchemy toneRose
class node_file_admin,node_cloud_storage,node_redis_console,node_developer,node_flask_app toneIndigo
```

## Components

### Admin framework

- [Admin registry](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/base.py): `flask_admin/base.py`
- [View routing](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/blueprints.py): `flask_admin/blueprints.py`
- [Menus and themes](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/menu.py): `flask_admin/menu.py`
- [Request helpers](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/helpers.py): `flask_admin/helpers.py`
- [Compatibility and types](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/_types.py): `flask_admin/_types.py`
- [Localization](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/babel.py): `flask_admin/babel.py`

### Model administration

- [Model views](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/base.py): `flask_admin/model/base.py`
- [Bulk actions](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/actions.py): `flask_admin/actions.py`

### Forms and presentation

- [Model form generation](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/form.py): `flask_admin/model/form.py`
- [Model fields](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/fields.py): `flask_admin/model/fields.py`
- [Form fields and uploads](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/fields.py): `flask_admin/form/fields.py`
- [Form layout rules](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/rules.py): `flask_admin/form/rules.py`
- [Form widgets](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/form/widgets.py): `flask_admin/form/widgets.py`
- [Model widgets](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/model/widgets.py): `flask_admin/model/widgets.py`

### Data integrations

- [SQLAlchemy adapter](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/sqla/view.py): `flask_admin/contrib/sqla/view.py`
- [Peewee adapter](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/peewee/view.py): `flask_admin/contrib/peewee/view.py`
- [MongoEngine adapter](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/mongoengine/view.py): `flask_admin/contrib/mongoengine/view.py`
- [PyMongo adapter](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/pymongo/view.py): `flask_admin/contrib/pymongo/view.py`
- [GeoAlchemy support](https://github.com/pallets-eco/flask-admin/tree/master/flask_admin/contrib/geoa): `flask_admin/contrib/geoa`

### Additional admin tools

- [File management](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/fileadmin/__init__.py): `flask_admin/contrib/fileadmin/__init__.py`
- [Cloud storage backends](https://github.com/pallets-eco/flask-admin/tree/master/flask_admin/contrib/fileadmin): `flask_admin/contrib/fileadmin`
- [Redis console](https://github.com/pallets-eco/flask-admin/blob/master/flask_admin/contrib/rediscli.py): `flask_admin/contrib/rediscli.py`

### Other components

- **Application developer**
- **Admin user**
- **Flask application**

## Connections

- Application developer → Admin registry: registers views
- Admin registry → Flask application: registers blueprints (evidence: `flask_admin/base.py`)
- Admin registry → View routing: creates routes (evidence: `flask_admin/base.py`)
- Admin registry → Menus and themes: adds menu entries (evidence: `flask_admin/base.py`)
- Admin user → Flask application: uses admin UI
- Flask application → View routing: dispatches requests
- View routing → Model views: routes to views
- Model views → Model form generation: generates forms (evidence: `flask_admin/model/base.py`)
- Model form generation → Model fields: uses fields (evidence: `flask_admin/model/form.py`)
- Model fields → Model widgets: renders with (evidence: `flask_admin/model/fields.py`)
- Model form generation → Form fields and uploads: builds forms
- Model form generation → Form layout rules: applies layout (evidence: `flask_admin/model/form.py`)
- Model views → Bulk actions: supports actions (evidence: `flask_admin/model/base.py`)
- Model views → SQLAlchemy adapter: uses adapter
- Model views → Peewee adapter: uses adapter
- Model views → MongoEngine adapter: uses adapter
- Model views → PyMongo adapter: uses adapter
- SQLAlchemy adapter → Model form generation: provides form conversion (evidence: `flask_admin/contrib/sqla/view.py`)
- Peewee adapter → Model form generation: provides form conversion (evidence: `flask_admin/contrib/peewee/view.py`)
- MongoEngine adapter → Model form generation: provides form conversion
- Model views → Request helpers: uses request helpers (evidence: `flask_admin/model/base.py`)
- File management → Cloud storage backends: supports backends
- Admin user → File management: manages files
- Admin user → Redis console: uses console
- Admin user → GeoAlchemy support: edits geo data
- Admin registry → Localization: uses localization (evidence: `flask_admin/base.py`)
- Model views → Compatibility and types: uses shared types (evidence: `flask_admin/model/base.py`)
