Flask Data Tables - Open-Source Sample
Hello! This article presents an open-source project that provides paginated access to information using Flask and Simple-DataTables, a Vanilla JS library. Information can be accessed in three different ways: loaded from the database, exposed by an API, and loaded from the file system. The sources can be downloaded
from Github (MIT License) without a registration lock and used in commercial projects or eLearning activities. Thanks for reading!
- 👉 Flask Datatables - source code
- 🎁 Free Support via email (issues tracker) and Discord (1k+ community)
✨ How it works
The information provided in CSV format is loaded via a custom Flask CLI command and saved in the database. From this point, the app serves the information using different techniques:
- Loaded from
Data
table by a controller (route) - Served by
/api/data
API node and consumed from JS - Loaded without any processing from a static file
✨ Project features
- Data Tables managed by
Simple-DataTables
(Vanilla) JS Stack
: Flask, SqlAlchemy, Flask-Migrate, Flask-RestX
Implementations
- Loaded from
Data
table by a controller (route) - Served by
/api/data
API node and consumed from JS - Loaded without any processing from a file:
app/static/datatables/data.json
Search
over the data
✨ Quick Start
Probably the easier way is to use the Docker set up shipped with the source code and start the project using a minimum amount of work
Get the code
Start in Docker
Visit http://localhost:85
in your browser. The app should be up & running.
✨ Implementation
The input file is mirrored to the tables (model) used for persistence:
Input file Sample (CSV format)
Model That saves the data
The API Node (powered by Flask-RestX)
This simple project will be updated (soon) with more features:
- Inline edit
- Different Charts generated from loaded information: Bar Chart, Pie, and Line Chart.
Thanks for reading! For more resources, feel free to access:
- ✨ Free Dashboards crafted in Django, Flask, and React
- ✨ Admin Dashboards - a huge index with products