Skip to content

mrbrightsides/devflow

Repository files navigation

πŸš€ DevFlow.AI

DevFlow.AI Banner

Autonomous AI-Powered Debugging Platform for Modern Developers

Next.js TypeScript OpenAI Tailwind CSS

Live Demo Β· Report Bug Β· Request Feature


πŸ“‹ Table of Contents


🎯 About

DevFlow.AI is an intelligent productivity platform designed to revolutionize how developers approach debugging. By leveraging cutting-edge AI technology, DevFlow.AI autonomously monitors your codebase, detects bugs in real-time, generates intelligent patches, and automates the entire debugging workflowβ€”allowing developers to focus on what matters most: building great software.

πŸ† Built for Galuxium Nexus Hackathon

DevFlow.AI was created to showcase the power of AI-driven automation in software development, demonstrating how artificial intelligence can significantly enhance developer productivity and code quality.


✨ Key Features

πŸ€– AI-Powered Bug Detection & Fixing

  • Automated Code Analysis: Intelligent detection of syntax errors, logical bugs, and runtime issues
  • Smart Patch Generation: AI generates optimized fixes using GPT-4o-mini
  • Multi-Language Support: Python, JavaScript, TypeScript, Java, C++, and more
  • Confidence Scoring: Each fix comes with a confidence score for transparency

πŸ“Š Real-Time Dashboard

  • Live Activity Feed: Monitor all debugging activities in real-time
  • Productivity Analytics: Track bugs fixed, time saved, and success rates
  • Interactive Visualizations: Beautiful charts and metrics
  • Activity History: Detailed logs of all AI actions and outcomes

πŸ› οΈ Developer-First Experience

  • Code Diff Viewer: Side-by-side comparison of original and fixed code
  • Example Library: Pre-loaded buggy code examples for testing
  • Export Reports: Download detailed debugging reports
  • Responsive Design: Works seamlessly on desktop and mobile

🎨 Modern UI/UX

  • Dark Mode: Eye-friendly interface for long coding sessions
  • Smooth Animations: Pure CSS animations for performance
  • Accessible: Built with accessibility best practices
  • Fast & Lightweight: No heavy dependencies, optimized for speed

πŸ›  Tech Stack

Frontend

Backend & AI

Development Tools

  • Package Manager: npm
  • Code Quality: TypeScript strict mode
  • Build Tool: Next.js built-in compiler

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 18.x or higher
  • npm or yarn
  • OpenAI API Key (for AI functionality)

Installation

  1. Clone the repository

    git clone https://github.com/mrbrightsides/devflow.git
    cd devflow
  2. Install dependencies

    npm install
  3. Set up API Key (Optional - Already configured)

    The OpenAI API key is already integrated into the application. However, if you want to use your own key:

    • Open src/app/api/fix-bug/route.ts
    • Replace the API key in the OpenAI client initialization

Running the App

  1. Development Mode

    npm run dev

    Open http://localhost:3000 in your browser.

  2. Production Build

    npm run build
    npm start
  3. Lint Code

    npm run lint

πŸ“ Project Structure

devflow/
β”œβ”€β”€ public/                           # Static assets
β”‚   └── .well-known/
β”‚       └── farcaster.json            # Farcaster configuration
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                          # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ api/                      # API routes (12 endpoints)
β”‚   β”‚   β”‚   β”œβ”€β”€ analyze-context/      # ✨ Context analysis (Phase 2)
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ explain-code/         # ✨ Code explanation (Option 3)
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ fix-bug/              # AI bug fixing endpoint
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ generate-suggestions/ # ✨ Multiple fixes (Option 3)
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ health/               # Health check endpoint
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ logger/               # Logging endpoint
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ me/                   # User endpoint (Farcaster)
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ proxy/                # API proxy
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ save-feedback/        # ✨ Feedback system (Phase 2)
β”‚   β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”‚   └── scan-security/        # ✨ Security scanner (Option 3)
β”‚   β”‚   β”‚       └── route.ts
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ dashboard/                # Dashboard page
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ fonts/                    # Custom fonts
β”‚   β”‚   β”‚   β”œβ”€β”€ GeistMonoVF.woff
β”‚   β”‚   β”‚   └── GeistVF.woff
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   β”‚   β”œβ”€β”€ page.tsx                  # Landing page
β”‚   β”‚   β”œβ”€β”€ not-found.tsx             # 404 page
β”‚   β”‚   β”œβ”€β”€ globals.css               # Global styles
β”‚   β”‚   └── favicon.ico               # Favicon
β”‚   β”‚
β”‚   β”œβ”€β”€ components/                   # React components (35+ files)
β”‚   β”‚   β”œβ”€β”€ ui/                       # ShadCN UI components (50+ files)
β”‚   β”‚   β”‚   β”œβ”€β”€ accordion.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ alert-dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ alert.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ aspect-ratio.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ avatar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ badge.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ breadcrumb.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ calendar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ carousel.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ chart.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ checkbox.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ collapsible.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ command.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ context-menu.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ drawer.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dropdown-menu.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ form.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ hover-card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input-otp.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ label.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ menubar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ navigation-menu.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ pagination.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ popover.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ progress.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ radio-group.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ resizable.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ scroll-area.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ select.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ separator.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sheet.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sidebar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ skeleton.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ slider.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sonner.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ switch.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ table.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ tabs.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ textarea.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ toggle-group.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ toggle.tsx
β”‚   β”‚   β”‚   └── tooltip.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ FarcasterManifestSigner.tsx    # Farcaster integration
β”‚   β”‚   β”œβ”€β”€ FarcasterToastManager.tsx      # Toast notifications
β”‚   β”‚   β”œβ”€β”€ FarcasterWrapper.tsx           # Farcaster wrapper
β”‚   β”‚   β”œβ”€β”€ activity-detail-modal.tsx      # Activity details
β”‚   β”‚   β”œβ”€β”€ analytics-charts.tsx           # Analytics visualizations
β”‚   β”‚   β”œβ”€β”€ analytics-dashboard.tsx        # ✨ Analytics hub (Option 2)
β”‚   β”‚   β”œβ”€β”€ architecture-diagram.tsx       # Architecture visualization
β”‚   β”‚   β”œβ”€β”€ bug-statistics-chart.tsx       # ✨ Bug stats (Option 2)
β”‚   β”‚   β”œβ”€β”€ code-diff-viewer.tsx           # Basic diff viewer
β”‚   β”‚   β”œβ”€β”€ code-explanation.tsx           # ✨ Bug explanation (Option 3)
β”‚   β”‚   β”œβ”€β”€ code-fixer.tsx                 # 🎯 Main AI code fixer
β”‚   β”‚   β”œβ”€β”€ context-analyzer.tsx           # ✨ Context analysis (Phase 2)
β”‚   β”‚   β”œβ”€β”€ demo-section.tsx               # Demo section
β”‚   β”‚   β”œβ”€β”€ enhanced-code-diff-viewer.tsx  # ✨ Split view diff (Option 1)
β”‚   β”‚   β”œβ”€β”€ enhanced-live-activity-feed.tsx # Live activity feed
β”‚   β”‚   β”œβ”€β”€ export-report-dialog.tsx       # Export dialog
β”‚   β”‚   β”œβ”€β”€ features-grid.tsx              # Features grid
β”‚   β”‚   β”œβ”€β”€ feedback-system.tsx            # ✨ User feedback (Phase 2)
β”‚   β”‚   β”œβ”€β”€ fix-history.tsx                # ✨ Fix history (Option 1)
β”‚   β”‚   β”œβ”€β”€ hero-section.tsx               # Hero section
β”‚   β”‚   β”œβ”€β”€ language-breakdown-chart.tsx   # ✨ Language stats (Option 2)
β”‚   β”‚   β”œβ”€β”€ live-activity-feed.tsx         # Activity feed
β”‚   β”‚   β”œβ”€β”€ mobile-nav.tsx                 # Mobile navigation
β”‚   β”‚   β”œβ”€β”€ model-selector.tsx             # ✨ AI model config (Phase 2)
β”‚   β”‚   β”œβ”€β”€ multi-file-uploader.tsx        # ✨ Multi-file upload (Phase 2)
β”‚   β”‚   β”œβ”€β”€ multiple-suggestions.tsx       # ✨ Multiple fixes (Option 3)
β”‚   β”‚   β”œβ”€β”€ ready-notifier.tsx             # Ready state notifier
β”‚   β”‚   β”œβ”€β”€ response-logger.tsx            # Response logger
β”‚   β”‚   β”œβ”€β”€ security-scanner.tsx           # ✨ Security scan (Option 3)
β”‚   β”‚   β”œβ”€β”€ stats-section.tsx              # Stats section
β”‚   β”‚   β”œβ”€β”€ success-metrics.tsx            # ✨ Success tracking (Option 2)
β”‚   β”‚   └── time-saved-calculator.tsx      # ✨ Time savings (Option 2)
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/                        # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ use-mobile.tsx            # Mobile detection
β”‚   β”‚   β”œβ”€β”€ useAddMiniApp.ts          # Farcaster mini-app
β”‚   β”‚   β”œβ”€β”€ useIsInFarcaster.ts       # Farcaster context
β”‚   β”‚   β”œβ”€β”€ useManifestStatus.ts      # Manifest status
β”‚   β”‚   └── useQuickAuth.tsx          # Quick auth
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                          # Utility libraries
β”‚   β”‚   β”œβ”€β”€ analytics.ts              # ✨ Analytics engine (Option 2)
β”‚   β”‚   β”œβ”€β”€ buggy-examples.ts         # Example buggy code (8 examples)
β”‚   β”‚   β”œβ”€β”€ error-handler.ts          # ✨ Error handling (Option 1)
β”‚   β”‚   β”œβ”€β”€ logger.ts                 # Logging utility
β”‚   β”‚   └── utils.ts                  # Helper functions
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/                        # Additional utilities
β”‚   β”‚   └── manifestStatus.ts         # Manifest status utility
β”‚   β”‚
β”‚   └── middleware.ts                 # Next.js middleware
β”‚
β”œβ”€β”€ .gitignore                        # Git ignore rules
β”œβ”€β”€ .eslintrc.json                    # ESLint configuration
β”œβ”€β”€ components.json                   # ShadCN components config
β”œβ”€β”€ next.config.ts                    # Next.js configuration
β”œβ”€β”€ package.json                      # Dependencies
β”œβ”€β”€ postcss.config.mjs                # PostCSS configuration
β”œβ”€β”€ tailwind.config.ts                # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json                     # TypeScript configuration
β”œβ”€β”€ README.md                         # Main documentation
β”œβ”€β”€ DOCUMENTATION_INDEX.md            # Documentation index
β”œβ”€β”€ SETUP_GUIDE.md                    # Setup guide
β”œβ”€β”€ HOW_TO_BUILD_LOCALLY.md           # Local build guide
└── FILE_STRUCTURE.md                 # File structure guide

πŸ”Œ API Documentation

POST /api/fix-bug

Analyzes and fixes buggy code using AI.

Request Body:

{
  "code": "def divide(a, b):\n    return a / b",
  "language": "python",
  "errorType": "ZeroDivisionError",
  "errorMessage": "division by zero"
}

Response:

{
  "success": true,
  "fixedCode": "def divide(a, b):\n    if b == 0:\n        return 0\n    return a / b",
  "confidence": 0.85,
  "analysis": "Analyzed 2 lines of code. Detected ZeroDivisionError. Generated fix with 4 lines. Modified 2 lines.",
  "model": "gpt-4o-mini",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Parameters:

  • code (string, required): The buggy code to fix
  • language (string, optional): Programming language (default: python)
  • errorType (string, optional): Type of error encountered
  • errorMessage (string, optional): Error message from runtime

Response Fields:

  • success (boolean): Whether the fix was successful
  • fixedCode (string): The AI-generated fixed code
  • confidence (number): Confidence score (0.0 - 1.0)
  • analysis (string): Detailed analysis of the fix
  • model (string): AI model used
  • timestamp (string): ISO timestamp of the fix

GET /api/health

Health check endpoint for monitoring.

Response:

{
  "status": "ok",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "uptime": 3600
}

πŸ“– Usage Guide

1. Landing Page

Navigate to the homepage to learn about DevFlow.AI features and benefits.

2. Dashboard

Access the main dashboard at /dashboard to:

  • View real-time activity feed
  • Monitor debugging statistics
  • Check productivity metrics

3. AI Code Fixer

Use the Code Fixer component to:

  1. Input Code

    • Paste your buggy code into the text area
    • Select the programming language
    • Optionally specify error type and message
  2. Try Examples

    • Click "Load example..." dropdown
    • Select from pre-loaded buggy code examples
    • Test the AI with common bug types
  3. Fix Bugs

    • Click "Fix Bug with AI" button
    • Wait for AI analysis (typically 2-5 seconds)
    • Review the fixed code and analysis
  4. View Results

    • See side-by-side code comparison
    • Check confidence score
    • Read detailed analysis

4. Example Bug Types

  • Division by Zero: Arithmetic errors
  • Syntax Error: Code syntax issues
  • Type Mismatch: Type conversion problems
  • Index Error: Array/list access issues
  • Undefined Variable: Variable scope issues
  • Infinite Loop: Loop condition problems
  • Null Reference: Null pointer issues
  • File Not Found: File I/O errors

πŸ“Š Dashboard Features

Real-Time Activity Feed

Monitor all debugging activities as they happen:

  • Bug detection events
  • Fix generation progress
  • Test execution results
  • Commit status updates

Analytics Charts

Visualize your debugging data:

  • Bugs Fixed Over Time: Track daily bug resolution
  • Success Rate: Monitor fix success percentage
  • Time Saved: Calculate productivity gains
  • Bug Categories: Distribution of bug types

Productivity Metrics

Key performance indicators:

  • Total bugs fixed
  • Average fix time
  • Success rate percentage
  • Time saved vs manual debugging

Export Reports

Generate detailed reports:

  • PDF export of activity logs
  • Custom date range selection
  • Detailed bug analysis
  • Fix recommendations

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Ways to Contribute

  • πŸ› Report bugs
  • πŸ’‘ Suggest new features
  • πŸ“ Improve documentation
  • πŸ”§ Submit pull requests

Development Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Style

  • Follow TypeScript best practices
  • Use Tailwind CSS for styling
  • Write descriptive commit messages
  • Add comments for complex logic
  • Ensure all tests pass

πŸ—Ί Roadmap

Phase 1: Core Features βœ…

  • AI-powered bug detection
  • Code fix generation
  • Real-time dashboard
  • Activity feed
  • Code diff viewer

Phase 2: Enhanced AI 🚧

  • Multi-file bug detection
  • Context-aware fixes
  • Custom AI models
  • Learning from user feedback

Phase 3: Integration πŸ“…

  • GitHub integration
  • VS Code extension
  • CI/CD pipeline integration
  • Slack notifications

Phase 4: Collaboration πŸ“…

  • Team workspaces
  • Shared debugging sessions
  • Code review automation
  • Knowledge base

πŸ“„ License

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


πŸ“ž Contact

Developer: Khudri (mrbrightsides)

Links


πŸ™ Acknowledgments

  • OpenAI for providing the GPT-4o-mini model
  • Vercel for Next.js framework
  • Radix UI for accessible components
  • Tailwind CSS for styling utilities
  • Galuxium Nexus for hosting the hackathon

🌟 Star History

If you find DevFlow.AI helpful, please consider giving it a star ⭐

Star History Chart


Built with ❀️ by developers, for developers

⬆ Back to Top

About

Autonomous AI-Powered Debugging Platform for Modern Developers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages