Skip to content

Instantly share code, notes, and snippets.

@bigsnarfdude
Created March 16, 2025 19:03
Show Gist options
  • Save bigsnarfdude/79ab29ac5f3d835d34133d77391617cb to your computer and use it in GitHub Desktop.
Save bigsnarfdude/79ab29ac5f3d835d34133d77391617cb to your computer and use it in GitHub Desktop.
claude 3.7 coding in browser prompts and suggestions

I need to refactor my application to better separate concerns between functionality and API endpoints. The project is a Flask-based API that processes and analyzes data.

Currently, I have these related components that need to be decoupled:

  1. Data processing logic
  2. API endpoint handling
  3. Background task management

I'd like help with:

  1. Separating core processing functionality from API endpoint handling
  2. Creating cleaner interfaces between components
  3. Designing endpoints that follow RESTful principles
  4. Organizing related functionality in a logical manner

Please analyze my current implementation and suggest:

  • Which functionality should be extracted into separate modules
  • How to structure the API endpoints to better reflect the domain
  • The most efficient way to implement these changes incrementally

I'll share the key files so you can understand the current structure before we begin planning.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Let's work through the refactoring process file by file.

For each file, I'd like to follow this workflow:

  1. Share the current file location in the project structure (as a tree)
  2. Share the current file content
  3. Discuss its role and issues
  4. Plan specific changes needed
  5. Implement those changes
  6. Visualize where the file will live in the updated structure
  7. Discuss any related files that need to be modified next

Let's start with [specific file path]. Here's where it currently fits in the project:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>

To start a new, efficient conversation about continuing this refactoring work, I would recommend including a brief summary of what we've already accomplished. Here's what I suggest including:

  1. Brief project context: Flask API for BIRS platform that handles data access, processing, and classification

  2. What we've already implemented:

    • Created frame_extractor.py for extracting frames from videos
    • Implemented classification.py for lecture classifications
    • Added video_pipeline.py to process videos from URLs
    • Created frame_extraction.py to separate frame extraction from classification
    • Fixed circular import issues
    • Improved parameter handling for quality control
  3. Current architecture:

    • Separation of data processing from API endpoints
    • Background job system for long-running tasks
    • Configurable frame extraction with multiple methods
  4. Next steps to discuss:

    • Any additional endpoints needed
    • API documentation or testing
    • Further separation of concerns
    • Performance optimizations

use the file-by-file approach with the tree structure visualization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment