Skip to content

AI-assisted migration of DEV.to analytics from CLI to production web platform using GitHub Copilot CLI

License

Notifications You must be signed in to change notification settings

pcescato/devto_githubcopilotcli_challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEV.to Analytics Platform

PostgreSQL 18 SQLAlchemy Python License: MIT

AI-assisted migration of DEV.to analytics from CLI to production web platform using GitHub Copilot CLI

📖 Overview

A comprehensive analytics platform for tracking and analyzing DEV.to content performance, migrating from a SQLite-based CLI tool to a production-ready web application with PostgreSQL 18 and modern web technologies.

Challenge Entry: GitHub Copilot CLI Challenge

🏗️ Tech Stack

  • Backend: FastAPI (Python 3.10+)
  • Database: PostgreSQL 18
  • ORM: SQLAlchemy Core (NOT ORM models)
  • Advanced Features: pgvector for embeddings, JSONB, partitioning
  • Analytics: Apache Superset
  • API Integration: DEV.to Forem API

📊 Current Status

Phase 2 Complete: PostgreSQL 18 Schema Migration ✅

  • ✅ Complete technical documentation (2,218 lines)
  • ✅ 18 SQLAlchemy Core table definitions
  • ✅ Business logic preservation (quality scores, attribution, sentiment)
  • ✅ PostgreSQL 18 features (JSONB, ARRAY, Vector, partitioning)
  • ✅ Migration guide and validation scripts

Next Phase: FastAPI REST API development

🚀 Quick Start

Prerequisites

  • Python 3.10+
  • PostgreSQL 18
  • pip

Installation

# 1. Clone repository
git clone https://github.com/YOUR_USERNAME/devto_githubcopilotcli_challenge.git
cd devto_githubcopilotcli_challenge

# 2. Install dependencies
cd app
pip install -r requirements.txt

# 3. Configure database
cp .env.example .env
# Edit .env with your PostgreSQL credentials

# 4. Initialize database
python3 init_database.py

# 5. Verify installation
python3 validate_schema.py

📁 Project Structure

devto_githubcopilotcli_challenge/
├── app/                          # PostgreSQL schema & backend
│   ├── db/
│   │   ├── tables.py             # 18 SQLAlchemy Core tables
│   │   ├── connection.py         # Connection pooling
│   │   ├── queries.py            # Business logic
│   │   └── README.md             # Usage guide
│   ├── init_database.py          # Database setup
│   ├── validate_schema.py        # Schema validation
│   └── requirements.txt          # Python dependencies
│
├── TECHNICAL_DOCUMENTATION.md    # Complete system analysis
├── README_SCHEMA.md              # Schema migration details
├── README.md                     # This file
│
└── [Original CLI tools]          # SQLite-based scripts
    ├── devto_tracker.py
    ├── content_collector.py
    ├── nlp_analyzer.py
    └── ...

🎯 Features

Current (CLI Tools)

  • Article metrics tracking
  • Follower attribution analysis
  • Sentiment analysis on comments
  • Quality scoring system
  • Content collection and NLP analysis

Planned (Web Platform)

  • RESTful API with FastAPI
  • Real-time dashboards
  • Apache Superset integration
  • Semantic search with pgvector
  • Advanced analytics and reporting

📚 Documentation

🔑 Key Components

Database Schema (18 Tables)

Core Tables: snapshots, article_metrics, follower_events, comments, followers
Analytics: daily_analytics (partitioned), referrers
Content: article_content, code_blocks, links
Analysis: comment_insights, article_history, milestones
Intelligence: author_themes, theme_mapping, stats_cache

Business Logic Preserved

  • Follower Attribution: 7-day window with 6-hour tolerance
  • Quality Score: (completion × 0.7) + (min(engagement, 20) × 1.5)
  • Sentiment: Positive ≥0.3, Negative ≤-0.2
  • Proximity Search: 6-hour tolerance for timestamp matching

🤖 AI-Assisted Development

This project was developed with assistance from GitHub Copilot CLI, demonstrating:

  • Comprehensive codebase analysis (7 Python files, 13 tables)
  • SQLite → PostgreSQL migration patterns
  • SQLAlchemy Core table definitions
  • Business logic preservation
  • Complete documentation generation

📄 License

MIT License - see LICENSE file for details

🙏 Acknowledgments

🔗 Links

About

AI-assisted migration of DEV.to analytics from CLI to production web platform using GitHub Copilot CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published