Skip to content
View DataDudeAI's full-sized avatar

Block or report DataDudeAI

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
DataDudeAI/README.md

πŸš€ Overview

DataDude is a cutting-edge web-based analytics and campaign tracking platform designed to:

  • Track visits in real-time.
  • Manage and monitor campaigns effortlessly.
  • Enable deep linking with precision.

Powered by Flask (Python) for backend and vanilla JavaScript for frontend, DataDude delivers a seamless user experience with actionable insights.


πŸ—‚οΈ Project Structure

πŸ“ datadude
β”œβ”€β”€ app.py              # Main Flask application
β”œβ”€β”€ database.py         # Database operations and schema
β”œβ”€β”€ geo_service.py      # User agent and device detection
β”œβ”€β”€ check_db.py         # Database testing utility
β”œβ”€β”€ services/
β”‚   └── tracking_service.py # Visit tracking logic
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ campaign.py     # Campaign data model
β”‚   └── deeplink.py     # Deep link data model
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css   # Global styles
β”‚   └── js/
β”‚       β”œβ”€β”€ analytics.js
β”‚       β”œβ”€β”€ campaign.js
β”‚       β”œβ”€β”€ dashboard.js
β”‚       β”œβ”€β”€ deeplink.js
β”‚       └── track.js
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ analytics.html
β”‚   β”œβ”€β”€ campaigns.html
β”‚   β”œβ”€β”€ index.html
β”‚   └── deeplink.html
└── visits.db           # SQLite database

πŸ”‘ Core Components

1. Backend (Python/Flask)

πŸ› οΈ Database

  • SQLite with tables for campaigns and visits.
  • Campaign tracking and visit data storage.
  • Schema highlights:
CREATE TABLE campaigns (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    short_code TEXT UNIQUE NOT NULL,
    original_url TEXT NOT NULL,
    type TEXT NOT NULL,
    status TEXT DEFAULT 'active',
    utm_source TEXT,
    utm_medium TEXT,
    utm_campaign TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE visits (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    campaign_code TEXT,
    session_id TEXT,
    ip_address TEXT,
    user_agent TEXT,
    referrer TEXT,
    visit_data TEXT,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY(campaign_code) REFERENCES campaigns(short_code)
);

πŸ› οΈ Tracking Service

  • Handles real-time tracking.
  • Processes user agent, browser, and device detection.

πŸ› οΈ Geo Service

  • Extracts geographic and device-specific data from user agents.

2. Frontend (JavaScript)

πŸ“Š Dashboard (dashboard.js)

  • Real-time statistics and mini charts.
  • Displays recent activity feed.

πŸ“ˆ Analytics (analytics.js)

  • Advanced data visualizations.
  • Includes timeline views and filtering.

πŸ“‹ Campaign Management (campaign.js)

  • CRUD operations for campaigns.
  • URL shortening and campaign performance stats.

🌟 Key Features

1. πŸ“‘ Campaign Tracking

  • URL shortening.
  • Campaign attribution.
  • Real-time updates and statistics.

2. 🧩 Analytics

  • Device and browser detection.
  • Geographic insights.
  • Time-based analysis.

3. πŸ’» User Interface

  • Interactive and responsive.
  • Error-handling for smoother user experience.

πŸ› οΈ Development Setup

  1. Clone the repository:

    git clone https://github.com/your-username/datadude.git
  2. Install dependencies:

    pip install -r requirements.txt
  3. Initialize the database:

    python check_db.py
  4. Run the development server:

    python app.py

🌍 API Endpoints

🟒 Campaign Endpoints

  • GET /api/campaigns - List all campaigns.
  • POST /api/campaigns - Create a new campaign.
  • GET /api/campaigns/<short_code> - Fetch campaign details.
  • PUT /api/campaigns/<short_code> - Update a campaign.
  • DELETE /api/campaigns/<short_code> - Delete a campaign.

🟒 Analytics Endpoints

  • GET /api/stats - Fetch analytics overview.
  • GET /api/visits - Retrieve visit details.
  • POST /track - Record a new visit.

πŸ’‘ Best Practices

1. Code Organization

  • Group related functionality in services.
  • Maintain a clear separation of concerns.

2. Error Handling

  • Implement robust try-catch blocks.
  • Log errors for troubleshooting.

3. Frontend Development

  • Use descriptive naming conventions.
  • Ensure responsive and accessible designs.

πŸ§ͺ Testing

  1. Database Testing:

    python check_db.py
  2. API Testing:

    • Use tools like Postman.
    • Test CRUD operations and validate error handling.

πŸš€ Deployment

  1. Update Configuration:

    • Set DEBUG = False in production.
    • Configure logging and secret keys.
  2. Database:

    • Initialize and regularly back up.
  3. Server Setup:

    • Use a reverse proxy (e.g., Nginx).
    • Enable SSL for secure communication.

πŸ“… Maintenance

Regular Tasks

  • Database backups.
  • Performance monitoring.
  • Log rotation.

Updates

  • Regularly update dependencies.
  • Monitor security advisories.

πŸ“© Support

For technical queries or support:

  • Review the documentation.
  • Report issues on the issue tracker.
  • Contact the development team.

πŸŽ‰ Animation Suggestion

For a better user experience, consider integrating animations using libraries like Lottie or CSS Animations for:

  1. Page loading transitions.
  2. Button hover effects.
  3. Real-time chart updates.

DataDude – Your all-in-one AI-powered campaign tracking and analytics platform. Harness the power of data with ease!

  • πŸ‘― I’m looking to collaborate on ...
  • πŸ€” I’m looking for help with ...
  • πŸ’¬ Ask me about ...
  • πŸ“« How to reach me: ...
  • πŸ˜„ Pronouns: ...
  • ⚑ Fun fact: ... -->

Pinned Loading

  1. Nandan-Dutta Nandan-Dutta Public

    Exploring advanced AI Engineering, concepts, including NLP, Generative AI, and MLOps