Skip to content

Latest commit

 

History

History
406 lines (314 loc) · 12.6 KB

File metadata and controls

406 lines (314 loc) · 12.6 KB

📑 CodeMentor AI - Complete Index & Navigation Guide

🗺️ Quick Navigation

📖 Start Here

🔧 Setup & Deployment

🏗️ Architecture & Design

📚 Dependencies


📂 Project Structure

CodeMentorAI/
│
├── 📋 DOCUMENTATION (Start Here!)
│   ├── README.md ..................... Main documentation
│   ├── QUICK_START.md ................ 5-minute setup guide
│   ├── SETUP_GUIDE.md ................ Detailed installation
│   ├── ARCHITECTURE.md ............... System design
│   ├── PROJECT_SUMMARY.md ............ Implementation details
│   ├── COMPLETION_REPORT.md .......... Project completion summary
│   └── INDEX.md (this file) .......... Navigation guide
│
├── ⚙️ CONFIGURATION
│   ├── .env .......................... API keys & settings (configured)
│   ├── .env.example .................. Template for .env
│   ├── .gitignore .................... Git ignore rules
│   ├── requirements.txt .............. Python dependencies (67 packages)
│   └── docker-compose.yml ............ Docker container setup
│
├── 🔙 BACKEND (FastAPI + Python)
│   ├── Dockerfile .................... Backend container definition
│   └── app/
│       ├── __init__.py ............... Package initialization
│       ├── main.py ................... Main FastAPI application
│       ├── config.py ................. Configuration management
│       ├── api/
│       │   ├── routes/ ............... API route handlers
│       │   └── middleware/ ........... Request/response middleware
│       ├── services/
│       │   ├── groq_service.py ....... Groq API integration
│       │   ├── mcp_client.py ......... MCP server client
│       │   └── analysis_service.py ... Code analysis logic
│       ├── models/
│       │   ├── schemas.py ............ Pydantic data models
│       │   └── mongodb.py ............ MongoDB models
│       └── utils/
│           ├── prompts.py ............ LLM prompts
│           └── helpers.py ............ Utility functions
│
├── 🎨 FRONTEND (React + TypeScript)
│   ├── Dockerfile .................... Frontend container definition
│   ├── index.html .................... HTML entry point
│   ├── package.json .................. NPM dependencies (20+ packages)
│   ├── vite.config.ts ................ Vite build configuration
│   ├── tsconfig.json ................. TypeScript configuration
│   ├── tailwind.config.js ............ Tailwind CSS configuration
│   ├── postcss.config.js ............. PostCSS configuration
│   ├── .eslintrc.cjs ................. ESLint configuration
│   └── src/
│       ├── main.tsx .................. React entry point
│       ├── App.tsx ................... Main application component
│       ├── components/
│       │   ├── Header.tsx ............ Navigation header
│       │   ├── CodeEditor.tsx ........ Code input component
│       │   ├── ReviewPanel.tsx ....... Results display component
│       │   ├── History.tsx ........... Review history table
│       │   └── Analytics.tsx ......... Analytics dashboard
│       ├── hooks/
│       │   └── useReview.ts .......... Custom review hook
│       ├── services/
│       │   └── api.ts ................ API client
│       ├── store/
│       │   └── reviewStore.ts ........ Zustand state store
│       ├── styles/
│       │   └── globals.css ........... Global styles
│       └── types/
│           └── index.ts .............. TypeScript interfaces
│
└── 🔧 MCP SERVER (Future)
    └── mcp_server/
        ├── server.py ................. MCP server
        ├── tools/
        │   ├── code_parser.py ........ Code parsing
        │   └── vulnerability_rules.py  Security rules
        └── resources/
            └── rules/ ................ Analysis rules

🎯 What Each File Does

Core Application Files

Frontend Components

  • Header.tsx - Navigation tabs and branding
  • CodeEditor.tsx - Monaco editor with language selection
  • ReviewPanel.tsx - Display vulnerabilities and suggestions
  • History.tsx - Table of past reviews
  • Analytics.tsx - Dashboard with metrics

Backend Files

  • main.py - FastAPI server with all endpoints
  • config.py - Configuration from environment variables

State Management

  • reviewStore.ts - Zustand store for UI state
  • useReview.ts - Custom hook for review logic
  • api.ts - Axios API client with streaming

Styling

  • globals.css - Tailwind CSS + animations
  • tailwind.config.js - Tailwind configuration
  • postcss.config.js - PostCSS plugins

Configuration

  • .env - Your API keys and settings
  • requirements.txt - Python package versions
  • package.json - Node.js dependencies
  • docker-compose.yml - Container orchestration

🚀 Getting Started by Role

I'm a Developer

  1. Read README.md for overview
  2. Follow QUICK_START.md to run locally
  3. Check ARCHITECTURE.md for system design
  4. Explore frontend/src/ for React code
  5. Check backend/app/main.py for API logic

I'm DevOps

  1. Review SETUP_GUIDE.md for deployment
  2. Check docker-compose.yml for containers
  3. Read ARCHITECTURE.md for infrastructure
  4. Configure .env for your environment
  5. Use Dockerfile files for custom builds

I'm a Data Scientist

  1. Check PROJECT_SUMMARY.md for ML strategy
  2. Review backend/app/main.py for Groq integration
  3. Check ARCHITECTURE.md for data flow
  4. Explore requirements.txt for ML packages

I'm a Product Manager

  1. Read README.md for features
  2. Check COMPLETION_REPORT.md for status
  3. Review ARCHITECTURE.md for capabilities
  4. See PROJECT_SUMMARY.md for roadmap

📖 Documentation by Topic

Getting Started

  • Quick Setup: QUICK_START.md
  • Detailed Setup: SETUP_GUIDE.md
  • Project Overview: README.md

Understanding the System

  • Architecture: ARCHITECTURE.md
  • Implementation: PROJECT_SUMMARY.md
  • Completion Status: COMPLETION_REPORT.md

Using the Application

  • API Endpoints: ARCHITECTURE.md (API Specifications section)
  • Running Locally: QUICK_START.md
  • Deployment: SETUP_GUIDE.md (sections 8-10)

Development

  • Frontend Code: frontend/src/
  • Backend Code: backend/app/main.py
  • Configuration: .env and config files

🔍 Finding Things

I need to...

...understand the architecture

ARCHITECTURE.md - Complete system design with diagrams

...deploy to production

SETUP_GUIDE.md - Sections on cloud deployment

...modify the code

frontend/src/ or backend/app/main.py directly

...change configuration

Edit .env file (see .env.example for template)

...troubleshoot an error

SETUP_GUIDE.md - Troubleshooting section

...understand the API

→ Run app and visit http://localhost:8000/docs

...see what's been built

COMPLETION_REPORT.md - Complete summary

...learn the tech stack

README.md - Technology section

...add a new feature

ARCHITECTURE.md - Scaling strategy section

...understand the data flow

ARCHITECTURE.md - Request/Response Flow section


📚 File Reading Order

First Time Setup

  1. README.md (understand what it is)
  2. QUICK_START.md (get it running)
  3. Open http://localhost:5173 in browser
  4. Submit code for review!

Understanding the Code

  1. ARCHITECTURE.md (see the big picture)
  2. PROJECT_SUMMARY.md (understand the plan)
  3. frontend/src/App.tsx (see main component)
  4. backend/app/main.py (see API implementation)

Advanced Usage

  1. SETUP_GUIDE.md (deployment details)
  2. docker-compose.yml (infrastructure)
  3. requirements.txt (dependencies)
  4. ARCHITECTURE.md (scaling strategies)

🎓 Learning Resources

React/TypeScript

  • App.tsx - Main component structure
  • components/ - Component examples
  • hooks/useReview.ts - Custom hook pattern
  • store/reviewStore.ts - State management

FastAPI/Python

  • main.py - API routing and integration
  • config.py - Configuration management
  • Sample code shows async/await patterns

Docker

  • docker-compose.yml - Multi-container setup
  • Dockerfile files - Image definitions
  • Shows networking, volumes, environment

Tailwind CSS

  • globals.css - Utility-first examples
  • tailwind.config.js - Custom configuration
  • Components use Tailwind classes

🔑 Key Concepts

Frontend Architecture

User → React Component → Zustand Store → API Client → Backend
↑                                          ↓
└──── SSE EventSource ← StreamResponse ←──┘

Backend Architecture

FastAPI Endpoint → Config → Groq API → Response → Frontend
                        ↓
                   MongoDB (future)

Deployment

Docker Compose → MongoDB + FastAPI + React → Browser

✅ Checklist for New Users


📞 Getting Help

Issue Categories

Can't start the app? → SETUP_GUIDE.md → Troubleshooting section

Don't understand architecture? → ARCHITECTURE.md → System Architecture Diagram

Want to deploy? → SETUP_GUIDE.md → Production Deployment

Need API documentation?http://localhost:8000/docs (when running)

Looking for a specific file? → Use file search or check the structure above


🚀 Next Steps

  1. Start Local: Follow QUICK_START.md
  2. Understand: Read ARCHITECTURE.md
  3. Explore: Open http://localhost:5173
  4. Deploy: Follow SETUP_GUIDE.md
  5. Extend: Modify code in frontend/src or backend/app

📊 Document Statistics

Document Purpose Length Read Time
README.md Project overview 400 lines 10 min
QUICK_START.md 5-minute setup 400 lines 5 min
SETUP_GUIDE.md Detailed installation 600 lines 15 min
ARCHITECTURE.md System design 500 lines 15 min
PROJECT_SUMMARY.md Implementation plan 400 lines 10 min
COMPLETION_REPORT.md Project completion 400 lines 10 min

Total Documentation: 2,700+ lines


🎯 Success Criteria

You'll know you're successful when:

docker-compose up -d runs without errors ✅ http://localhost:5173 opens in browser ✅ You can submit code and get a review ✅ Results display in real-time ✅ History and Analytics tabs work ✅ API docs are available at /docs


📝 File Naming Convention

Markdown Files:      .md (documentation)
Frontend:            .tsx, .ts (React TypeScript)
Backend:             .py (Python)
Config:              .json, .js, .env, .yml
Docker:              Dockerfile, docker-compose.yml

🔐 Security & Best Practices

  • Never commit .env - It's in .gitignore
  • Use .env.example - As template for team
  • Keep API keys safe - Environment variables only
  • Docker isolation - Services in containers
  • Input validation - All endpoints validate

🗺️ You Are Here

This INDEX.md file is your navigation guide through the entire CodeMentor AI project.

Start with README.md or QUICK_START.md and come back here if you need to find something!

Happy exploring! 🚀