Skip to main content

A database administration dashboard for FastAPI applications

Project description

FastAPI DataBoard

A beautiful, intuitive database administration dashboard for FastAPI applications. Similar to Django Admin but designed specifically for FastAPI with support for both synchronous and asynchronous SQLAlchemy engines.

Features

  • Auto-Discovery: Automatically discovers all tables in your database.
  • 📊 Beautiful UI: Clean, modern interface with a responsive layout.
  • 🔍 Query Console: Execute custom SQL queries (SELECT, UPDATE, DELETE) directly from the browser.
  • ✏️ Full CRUD: Create, Read, Update, and Delete records via intuitive modals.
  • 📄 Smart Pagination: Built-in pagination handled at the database level.
  • 🔄 Dual Support: Fully compatible with create_engine (Sync) and create_async_engine (Async).

Installation

pip install fastapi-databoard

For PostgreSQL support:

# For Async (asyncpg)
pip install fastapi-databoard[async] asyncpg

# For Sync (psycopg2)
pip install psycopg2-binary

Quick Start Examples

DataBoard adapts to your engine type automatically.

Asynchronous Setup (main.py)

Ideal for modern FastAPI apps using asyncpg.

from fastapi import FastAPI
from sqlalchemy.ext.asyncio import create_async_engine
from fastapi_databoard import DataBoard, DataBoardConfig

app = FastAPI()

DATABASE_URL = "postgresql+asyncpg://postgres:12345@localhost:5432/postgres"
engine = create_async_engine(DATABASE_URL)

config = DataBoardConfig(
    title="Databoard",
    mount_path="/databoard",
    page_size=50,
    enable_query_execution=True,
    enable_edit=True,
    enable_delete=True,
    enable_create=True,
)

databoard = DataBoard(engine=engine, config=config)
databoard.mount(app)

Synchronous Setup (main2.py)

Ideal for standard applications using psycopg2.

from fastapi import FastAPI
from sqlalchemy import create_engine
from fastapi_databoard import DataBoard, DataBoardConfig

app = FastAPI()

DATABASE_URL = "postgresql+psycopg2://postgres:12345@localhost:5432/postgres"
engine = create_engine(DATABASE_URL)

config = DataBoardConfig(
    title="Databoard",
    mount_path="/databoard",
    page_size=50,
    enable_query_execution=True,
    enable_edit=True,
    enable_delete=True,
    enable_create=True,
)

databoard = DataBoard(engine=engine, config=config)
databoard.mount(app)

Configuration Reference

You can customize the dashboard behavior using the DataBoardConfig class:

Property Default Description
title "DataBoard" Title shown in sidebar and browser tab.
mount_path "/databoard" The URL path to access the UI.
page_size 50 Number of records displayed per page.
enable_query_execution True Shows the SQL console for raw queries.
enable_edit True Allows editing existing table records.
enable_delete True Allows deleting records from the UI.
enable_create True Shows the "+ New Record" button.

Usage Guide

Browsing Tables

Select a table from the sidebar. The dashboard fetches the schema and data dynamically.

Executing Raw SQL

Use the Query Console at the top.

  • SELECT: Results will populate the main data table. To keep "Edit" and "Delete" icons active, ensure you include the table's Primary Key in your column selection.
  • INSERT/UPDATE/DELETE: The UI will report the number of affected rows.

Record Management

  • Click the Pencil Icon (edit) to open the update modal.
  • Click the Trash Icon (delete) to remove a row.
  • Click + New Record to manually insert data.

Security

[!WARNING] Security Risk: DataBoard provides full access to your database. In production environments, always protect the mount path using FastAPI Dependencies (e.g., OAuth2, API Keys, or Basic Auth).


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_databoard-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_databoard-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_databoard-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_databoard-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fastapi_databoard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5509cdf113b843b60ee5711cf830f62ef30acc33952df741e729978e3d4e44e3
MD5 d677a0df3bd5dc1f3b814c72eceb679b
BLAKE2b-256 a71ac4c8c03c988edbb625591a04336cac8922f061da13022e5de5fae81e0903

See more details on using hashes here.

File details

Details for the file fastapi_databoard-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_databoard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42145e2961b3f9cf6e1f692b9407744c3289d0ea12f76f4000e5f31ba8031d7d
MD5 440e2ef76797f79bfdeb257089dc2bd4
BLAKE2b-256 3ddcbd209ee5fa02400c749f5fe51e43ebf8bdcf1a2cfb1775e6f74cf13b15da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page