DEV Community

Cover image for Showcase Your DATA - A simple way using Flask / Simple API / Docker and SQLite
Sm0ke
Sm0ke

Posted on • Originally published at blog.appseed.us

12 5

Showcase Your DATA - A simple way using Flask / Simple API / Docker and SQLite

Hello Coders!

This article presents a simple way to showcase your data using Flask, Chartist and Docker. The product that helps us to achieve this is published on Github (MIT License) and the source code can be copied or used in commercial products or eLearning activities. Thanks for reading!


✨ How it works

  • Users can edit an input file
    • Expected fields: product code, product info, price, currency
  • The INPUT file is loaded via the CLI
  • Database and tables are automatically created
  • Charts are updated accordingly using a simple API and Vanilla JS

Using Docker or manual setup, in less then 1 minute our information saved in the CVS file should be parsed and injected in charts.


✨ Input file Processing

The product comes with two options regarding the loaded information:

  • flask load_data - the command that loads the sales information using a randomized transaction date for a nice distribution over 30Days
  • flask load_random_data - this commands will randomize also the values.

✨ Compile the product

The Docker set up is probably the most convenient way to see the codebase in action

👉 Clone the Sources

$ git clone https://github.com/app-generator/boilerplate-code-flask-dashboard.git
$ cd boilerplate-code-flask-dashboard
Enter fullscreen mode Exit fullscreen mode

👉 Start in Docker

$ docker-compose up --build 
Enter fullscreen mode Exit fullscreen mode

Once all commands are executed, we should be able to visit the app in the browser, register new users, authenticate and visualize all metrics provided on main dashboard:

  • Total sales
  • Number of customers, Average order value
  • Timeframe information: report start_date, end_date

Flask Dashboard Boilerplate - Charts.


Sales API Interface

Flask Dashboard Boilerplate - Sales API Interface.


Other Product features

  • Improved authentication
    • Password reset
    • Optional Email confirmation on register
    • Extended User Model
  • Data Tables - paginated information management
  • API via Flast-restX
    • Public API over all items
  • Deployment
    • Docker, HEROKU

For more information, feel free to AMA in the comments section or access the product page. Thank you!


API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (4)

Collapse
 
crearesite profile image
WebsiteMarket

Looks easy.

Collapse
 
sm0ke profile image
Sm0ke

🚀🚀

Collapse
 
uithemes profile image
ui-themes

Really nice! Can I add more fields?

Collapse
 
sm0ke profile image
Sm0ke

For sure. New fields should be saved in the Data and stats extracted by the API router.
For now is not automatized this process.
🚀🚀

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more