A lightweight, plug-and-play SQLite administration panel UI for FastAPI.
Project description
fastapi-sqlite-ui
A lightweight, plug-and-play SQLite administration panel UI for FastAPI applications.
Giao diện quản lý SQLite Admin Panel gọn nhẹ, cắm-là-chạy dành cho các ứng dụng FastAPI.
Design & Layout (Thiết kế & Bố cục)
English
The user interface utilizes standard modern design practices:
- Dark Theme: High-contrast dark mode (
#0b0f19) featuring subtle borders and glassmorphism. - Icons & Typography: Uses Google Font Inter for readability and Lucide Icons for user interface control mapping.
- Transitions: Smooth micro-interactions for modal triggers and status notifications.
Tiếng Việt
Giao diện người dùng sử dụng các nguyên lý thiết kế hiện đại:
- Chủ đề tối (Dark Theme): Chế độ tối độ tương phản cao (
#0b0f19) kết hợp đường viền mỏng và hiệu ứng mờ kính (glassmorphism). - Biểu tượng & Font chữ: Sử dụng font chữ Inter để tối ưu khả năng đọc và Lucide Icons để mô tả điều hướng trực quan.
- Hiệu ứng chuyển động: Các tương tác nhỏ (micro-interactions) mượt mà cho các sự kiện mở modal và thông báo trạng thái.
Features (Tính năng)
English
- Plug & Play: Single function call to mount the APIRouter.
- Data Browser: Paginated table view with search filters on text columns.
- Schema Inspector: Structured view of columns, data types, primary keys, and foreign keys.
- Full CRUD: Complete row insert, update, and delete support with schema-aware input fields.
- Raw SQL Console: Text-area input for executing arbitrary raw SQL statements with elapsed time metrics.
- Read-Only Mode: Toggle option to restrict database modifications.
- Self-contained SPA: No asset build steps required by the parent Python server.
Tiếng Việt
- Tích hợp nhanh: Chỉ cần gọi một hàm để gắn APIRouter vào ứng dụng.
- Duyệt dữ liệu: Hiển thị bảng dạng phân trang kèm bộ lọc tìm kiếm trên các cột văn bản.
- Kiểm tra cấu trúc: Xem cấu trúc cột, kiểu dữ liệu, khóa chính và khóa ngoại.
- Hỗ trợ CRUD: Thao tác thêm, sửa, xóa các dòng dữ liệu thông qua các biểu mẫu tự động tương thích theo cấu trúc bảng.
- Trình chạy SQL Raw: Nhập và thực thi trực tiếp các câu lệnh SQL tự do có đo lường thời gian phản hồi.
- Chế độ chỉ đọc (Read-Only): Cấu hình tùy chọn để chặn các thao tác ghi dữ liệu.
- SPA tự đóng gói: Không yêu cầu bước biên dịch tài nguyên tĩnh từ phía server Python.
Installation (Cài đặt)
pip install fastapi-sqlite-ui
Make sure you have fastapi and uvicorn installed.
Usage (Cách dùng)
from fastapi import FastAPI
from fastapi_sqlite_ui import mount_sqlite_ui
app = FastAPI()
# Mount the SQLite UI at /admin
mount_sqlite_ui(
app,
db_path="./mydb.sqlite",
mount_path="/admin",
read_only=False
)
Options (Cấu hình)
The mount_sqlite_ui function takes the following parameters:
| Parameter | Type | Default | Description / Mô tả |
|---|---|---|---|
app |
FastAPI |
Required | The FastAPI application instance. / Đối tượng ứng dụng FastAPI. |
db_path |
str |
Required | Path to the SQLite database file. / Đường dẫn đến tệp cơ sở dữ liệu SQLite. |
mount_path |
str |
"/admin" |
URL prefix for the administration dashboard. / Tiền tố đường dẫn URL cho trang quản trị. |
read_only |
bool |
False |
Hides CRUD actions and blocks write queries if True. / Nếu là True, ẩn giao diện CRUD và chặn các câu lệnh ghi dữ liệu. |
License
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_sqlite_ui-1.0.0.tar.gz.
File metadata
- Download URL: fastapi_sqlite_ui-1.0.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f00dd638196362655c98d8ef4a0e152cb9b5a0eff4eb93245ab923d5fdbea561
|
|
| MD5 |
74f1d460873cb581e63d42ed8c95802b
|
|
| BLAKE2b-256 |
16befb468771c46b03b5562b9e05287da707b3a71158476e728ba11918d57e1a
|
File details
Details for the file fastapi_sqlite_ui-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fastapi_sqlite_ui-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c30ec25a3c2162e39959d9cb24d6a6dd4cfaaeab4119ac313ab4f2c7db9918dc
|
|
| MD5 |
483447dfbc33ba6fdc668a91cc26adc1
|
|
| BLAKE2b-256 |
69d3a1bc60d42beaeb343e18075c4832f044f85e0108775f09168c844234338e
|