Skip to content

Medbenj/Bussiness_Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Business Intelligence Dashboard: Descriptive Analytics

This repository contains a Streamlit application designed to serve as a real-time Business Intelligence (BI) dashboard. It visualizes sales and order data, fetching both aggregate metrics and raw records from a backend workflow engine, n8n. It also includes functionality to generate a detailed AI-powered report on demand.

📁 Repository Structure

PerP/
├── README.md              # Project documentation and setup instructions
├── app.py                 # Main Streamlit application (Frontend)
├── n8n_workflow.json      # n8n workflow configuration (Backend automation)
└── pyproject.toml         # Python dependencies
└──.python-version         # Python version

Key Files:

  • app.py: The main Streamlit dashboard application that handles UI rendering, data visualization, and user interactions
  • n8n_workflow.json: Complete n8n workflow configuration that includes Airtable integration, data processing, and AI-powered insights generation

🚀 Features

  • Key Performance Indicators (KPIs): Real-time display of Total Orders, Total Revenue, Average Order Value, and Items Sold
  • Data Visualization: Bar charts illustrating distributions across Order Status, Payment Method, and geographic breakdown by Country (Orders and Revenue)
  • Dynamic Data Fetching: Data is sourced via a webhook endpoint from an n8n workflow
  • Raw Data View: Ability to switch the view to see the raw records in a sortable table
  • AI Report Generation: A dedicated button to trigger a separate webhook call to generate a text-based, analytical report using the Gemini 2.5 Flash model

🛠️ Prerequisites

To run this application, you need both the Python environment for the dashboard and the running n8n environment for the data source.

1. Python Environment

  • Python 3.8+
  • Dependencies listed in requirements.txt

2. n8n Environment (Backend)

  • A running n8n instance (latest version recommended)
  • The n8n workflow must be configured and active, exposing two webhooks:
    • Data Webhook: (for dashboard data and insights generation)
      Replace with YOUR_DATA_WEBHOOK_URL
    • Report Webhook: (for AI report generation)
      Replace with YOUR_REPORT_WEBHOOK_URL

The n8n workflow relies on the following integrations:

  • Airtable Node: To fetch and process raw data
  • Google Gemini Node (gemini-2.5-flash-lite-preview-06-17): To generate the analytical report text

💻 Installation and Setup

1. Clone the Repository

git clone <repository_url>
cd <project_directory>

2. Install Python Dependencies

Install the required packages using the generated requirements.txt file:

pip install -r requirements.txt

3. Configure n8n Workflows

Ensure your n8n workflows are imported, configured with the correct API keys (Airtable, Gemini), and are activated to listen for webhook calls at the specified URLs.

Important: The Streamlit app assumes the n8n instance is accessible. Adjust the ENDPOINT_URL and REPORT_WEBHOOK_URL variables in the Python script to use your own n8n host URL (e.g., http://localhost:XXXX or your production server domain).

▶️ How to Run the Application

Execute the Streamlit application from your terminal:

streamlit run <your_script_name>.py

The application will automatically open in your default web browser (usually at http://localhost:XXXX).

☁️ Architecture Overview

The application utilizes a split architecture for robustness and capability:

Frontend (Streamlit)

Handles all UI rendering, user interaction (buttons, select boxes), and dashboard visualization.

Backend (n8n Webhooks)

Serves as a data processing and AI/LLM orchestration layer. It is responsible for:

  • Querying the source database (e.g., Airtable)
  • Calculating aggregate metrics (KPIs, distributions)
  • Calling the Gemini API to generate complex text analysis reports

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages