Skip to content

MaLoskins/dynadash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

79 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DynaDash

Version 1.0.0 License MIT Python 3.8+ Flask 2.0+ Claude API

A web-based data-analytics platform powered by Claude AI

Upload private datasets β€’ Generate AI-powered visualizations β€’ Share insights β€’ Analyze data with ease

⚑ Quick Start

Prerequisites

  • Python 3.8+
  • pip
  • Git
  • Anthropic API key (for Claude)

Setup & Installation

  1. Clone the repository
git clone https://github.com/MaLoskins/DynaDash.git
cd DynaDash
  1. Create and activate a virtual environment
# For Windows
python -m venv venv
venv\Scripts\activate

# For macOS/Linux
python -m venv venv
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables

Create a .env file based on the provided .env.example:

cp .env.example .env

Edit the .env file with your settings, especially your Anthropic API key (For the purposes of submission a preloaded key is provided in the submitted .env and .env.example):

# Flask settings
FLASK_APP=run.py
FLASK_ENV=development
SECRET_KEY=your_secret_key_here_change_in_production

# Database settings
DYNA_SQLITE_PATH=sqlite:///dynadash.db

# Server settings
HOST=127.0.0.1
PORT=5000

# Anthropic Claude API settings
ANTHROPIC_API_KEY=your_anthropic_api_key_here
  1. Initialize the database
flask db init
flask db migrate -m "Initial migration"
flask db upgrade
  1. Run the application
# Option 1
flask run

# Option 2
python run.py
  1. Access the application

Open your browser and navigate to http://127.0.0.1:5000

πŸ“‹ Table of Contents

πŸ” Overview

DynaDash ("Dynamic Dashboard") is an intelligent data visualization platform that combines the power of Claude AI with intuitive web interfaces. It allows users to upload datasets, automatically generate insightful visualizations, organize them in a personal gallery, and selectively share with collaborators.

DynaDash Overview

✨ Key Features

πŸ” User Authentication

  • Secure registration and login
  • Password management
  • Session management

πŸ“Š Dataset Management

  • Upload CSV and JSON files
  • Preview data content
  • Manage private datasets

πŸ€– AI-Powered Visualization

  • Claude API integration
  • Smart chart selection
  • Automated insights detection

⚑ Real-time Updates

  • Processing status tracking
  • WebSockets (Socket.IO)
  • Live dashboard updates

πŸ”„ Gallery & Sharing

  • Personal visualization gallery
  • Selective sharing with users
  • Permission management

πŸ“± Responsive Design

  • Mobile-friendly interface
  • Interactive dashboards
  • Fullscreen visualization mode

πŸ— Architecture

DynaDash follows a modern web application architecture with a Python Flask backend, SQLite database, and browser-based frontend using Tailwind CSS and JavaScript.

DynaDash Architecture

Workflow

  1. Data Upload: Users upload CSV or JSON data files through the web interface
  2. Processing: The backend validates and processes the data
  3. Claude AI Analysis: The Anthropic Claude API analyzes the data and generates visualizations
  4. Dashboard Creation: Interactive HTML/JS dashboards are created and stored
  5. Gallery Management: Users can view, organize, and share their visualizations
  6. Collaboration: Selected visualizations can be shared with other platform users
graph TD
    %% Authentication flow
    A[User Registers/Logs In] --> B[Dashboard Home]
    
    %% Dataset flow
    B --> C1[Upload CSV/JSON Dataset]
    C1 --> D[DataProcessor Service]
    D -- Real-time progress via Socket.IO --> B
    D -- Saves metadata --> E[(SQLite Database)]
    D -- Saves file --> F[File System]
    
    %% Dashboard generation flow
    B --> G[View Datasets]
    G --> H[Select Dataset]
    H --> I[Generate Dashboard]
    I -- Dataset metadata + User prompts --> J[Claude Client Service]
    J -- Real-time progress via Socket.IO --> I
    J -- API Request --> K[Anthropic Claude API]
    K -- Returns HTML Template --> J
    J -- Saves template --> E
    
    %% Dashboard viewing flow
    B --> L[View My Dashboards]
    L --> M[Select Dashboard]
    M -- Load template from DB --> N[View Route]
    N -- Fetch dataset from disk --> N
    N -- Inject JSON data into template --> O[Render in iframe]
    O --> P{User Actions}
    P -- Toggle --> Q[Fullscreen Mode]
    P -- Download --> R[HTML Export]
    P -- Share --> S[Share Dashboard]
    
    %% Sharing functionality
    S -- Create Share Record --> E
    S --> T[Other User's Dashboard List]
    T --> M
    

    
    style O fill:#c6c,stroke:#333,stroke-width:2px
    style K fill:#77b,stroke:#229,stroke-width:2px
Loading

πŸ“Š Database Schema

The database schema below illustrates how the data is organized and related within the DynaDash application:

erDiagram
    User {
        int id PK
        string name
        string email UK
        string password_hash
        datetime created_at
    }
    
    Dataset {
        int id PK
        int user_id FK
        string filename
        string original_filename
        string file_path
        string file_type
        int n_rows
        int n_columns
        boolean is_public
        datetime uploaded_at
    }
    
    Visualisation {
        int id PK
        int dataset_id FK
        string title
        string description
        text spec
        datetime created_at
    }
    
    Share {
        int id PK
        int owner_id FK
        int target_id FK
        string object_type
        int object_id
        datetime granted_at
    }
    
    User ||--o{ Dataset : "owns"
    Dataset ||--o{ Visualisation : "has"
    User ||--o{ Share : "shares as owner"
    User ||--o{ Share : "receives as target"
Loading

This diagram shows the four main entities in the system and their relationships:

  • User: Represents application users with authentication details
  • Dataset: Contains uploaded data files and their metadata
  • Visualisation: Stores AI-generated visualizations created from datasets
  • Share: Manages access permissions between users for datasets and visualizations

The relationships include:

  • One user can own many datasets (one-to-many)
  • One dataset can have many visualizations (one-to-many)
  • Users can share objects with other users through the Share entity
  • The Share table tracks both the owner and the target user of each sharing action

πŸ“Έ Screenshots

Click to view application screenshots

Welcome Page

Welcome Page

User Dashboard

User Dashboard

Upload Interface

Upload Interface

Visualization Gallery

Visualization Gallery

Generated Dashboard Example

Generated Dashboard

πŸ“š Usage Guide

Creating an Account

  1. Visit the homepage and click "Register"
  2. Fill in your name, email, and password
  3. Submit the form to create your account
  4. Log in with your new credentials

Uploading a Dataset

  1. Navigate to the "Upload" page from the main menu
  2. Drag and drop a CSV or JSON file, or click to select a file
  3. Preview the data and click "Upload"
  4. Wait for the processing to complete

Generating Visualizations

  1. Go to "My Datasets" and select the dataset you want to visualize
  2. Click "Generate Visualization"
  3. Provide a title and description for your dashboard
  4. Click "Generate" and wait for Claude AI to create your dashboard
  5. Once complete, you'll be redirected to view your new dashboard

Managing and Sharing Visualizations

  1. Browse your visualizations in the "My Dashboards" page
  2. Click on any visualization to view it
  3. Use the "Share" button to grant access to other users
  4. Select users to share with and confirm
  5. Shared users will see your visualizations in their "Shared With Me" section

Viewing and Interacting with Dashboards

  1. Click on any dashboard to view it in full detail
  2. Use interactive controls to filter and explore the data
  3. Switch to fullscreen mode for presentations
  4. Download the HTML dashboard for offline viewing or sharing

πŸ”Œ API Documentation

DynaDash provides a RESTful API for programmatic access to your data and visualizations.

Click to view API endpoints

Authentication

POST /api/v1/login
POST /api/v1/logout
POST /api/v1/register
GET  /api/v1/user
GET  /api/v1/users

Visualizations

GET  /api/v1/visualisations
GET  /api/v1/shared-visualisations
GET  /api/v1/visualisations/<id>

πŸ”§ Technology Stack

Backend

  • Flask: Web framework
  • SQLAlchemy: ORM for database operations
  • Flask-SocketIO: Real-time communication
  • Flask-Login: User authentication
  • Flask-Migrate: Database migrations
  • Flask-WTF: Form handling and validation

Frontend

  • HTML/CSS/JavaScript: Base web technologies
  • Tailwind CSS: Styling and UI components
  • jQuery: DOM manipulation and AJAX
  • Socket.IO: Client-side WebSocket communication
  • Chart.js/D3.js: Visualization libraries

Database

  • SQLite: Lightweight SQL database
  • Alembic: Database migration engine

External Services

  • Anthropic Claude API: AI model for data analysis and visualization generation

πŸ“‚ Project Structure

DynaDash/
β”œβ”€β”€ app/                    # Application package
β”‚   β”œβ”€β”€ blueprints/         # Flask blueprints
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication routes
β”‚   β”‚   β”œβ”€β”€ data/           # Dataset management routes
β”‚   β”‚   └── visual/         # Visualization routes
β”‚   β”œβ”€β”€ models.py           # Database models
β”‚   β”œβ”€β”€ services/           # Service classes
β”‚   β”‚   β”œβ”€β”€ claude_client.py # Anthropic Claude API client
β”‚   β”‚   └── data_processor.py # Dataset processing service
β”‚   β”œβ”€β”€ static/             # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ templates/          # Jinja2 templates
β”‚   β”œβ”€β”€ __init__.py         # Application factory
β”‚   β”œβ”€β”€ cli.py              # CLI commands
β”‚   └── errors.py           # Error handlers
β”œβ”€β”€ migrations/             # Database migrations
β”œβ”€β”€ tests/                  # Test suite
β”‚   β”œβ”€β”€ unit/               # Unit tests
β”‚   └── integration/        # Integration tests
β”œβ”€β”€ uploads/                # Uploaded datasets
β”œβ”€β”€ .env.example            # Example environment variables
β”œβ”€β”€ .gitignore              # Git ignore file
β”œβ”€β”€ config.py               # Application configuration
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ run.py                  # Application entry point
└── README.md               # Project documentation

❓ Troubleshooting

Common Issues and Solutions

Installation Problems

Issue: ModuleNotFoundError: No module named 'flask'
Solution: Ensure you've activated your virtual environment and installed requirements:

source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

Issue: Database migration errors
Solution: Reset migrations and initialize again:

rm -rf migrations
flask db init
flask db migrate -m "Initial migration"
flask db upgrade

Runtime Errors

Issue: Claude API errors
Solution: Verify your API key in the .env file and check your API usage limits.

Issue: File upload errors
Solution: Check that the uploads directory exists and has proper write permissions.

Issue: Socket.IO connection issues
Solution: Ensure you're not using an ad-blocker that might be blocking WebSocket connections.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Team

DynaDash was created by:

  • Matthew Haskins - Claude integration & chart renderer
  • Leo Chen - DB model & SQLite ops
  • Jonas Liu - REST API & develop endpoints
  • Ziyue Xu - Security & API gateway

Made with Claude AI

About

Claude-powered analytics dashboard application for data exploration and interactive visual output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors