Skip to content

dhanushpachabhatla/CodeScrybe-Legacy-Repository-AI-Covasant-hackathon-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 CodeScrybe - Legacy Repository AI

A comprehensive AI-powered platform that helps developers and organizations analyze, understand, and interact with legacy codebases through intelligent parsing, semantic chunking, and natural language queries.

🌟 Key Features

  • πŸ”— GitHub Integration: Connect and analyze any GitHub repository (Future Scope)
  • 🧩 Smart Code Parsing: Semantically chunk code into meaningful units (functions, classes, blocks)
  • πŸ€– AI-Powered Analysis: Extract features and metadata using Google Gemini AI
  • πŸ“Š Knowledge Graph: Build interactive visualizations in Neo4j to map code relationships
  • πŸ’¬ Natural Language Queries: Ask questions about your codebase using GraphRAG
  • 🌐 Web Interface: User-friendly React.js frontend for seamless interaction

πŸ—οΈ Project Structure

CodeScrybe-Legacy-Repository-AI/
β”œβ”€β”€ Server/                     # Backend API (FastAPI)
β”‚   β”œβ”€β”€ backend/
β”‚   β”‚   β”œβ”€β”€ agents/           # Core parsing, graph builder and analysis modules
β”‚   β”‚   β”œβ”€β”€ database/         # models & services related to db
β”‚   β”‚   β”œβ”€β”€ app.py            # FastAPI application
β”‚   β”‚   └── pipeline.py       # End-to-end processing pipeline
β”‚   β”œβ”€β”€ venv410/              # Python virtual environment
β”‚   β”œβ”€β”€ .env                  # Environent Variables
β”‚   └── README.md             # Server-specific documentation
β”œβ”€β”€ Client/                   # Frontend (React.js)
β”‚   β”œβ”€β”€ src/                  # All UI & Business Logic Files
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md             # Client-specific documentation
β”œβ”€β”€ .gitignore
└── README.md                # This file

βœ… Supported Languages

Language Extensions Parser Type Chunk Type
C, C++ .c, .cpp, .h, .hpp regex_chunker Function + Context
Java .java regex_chunker Function + Context
Shell .sh, .bash regex_chunker Function-like blocks
Perl .pl, .pm regex_chunker Subroutines
COBOL .cob, .cbl, .cpy sas_cobol_chunkers Paragraphs
SAS .sas sas_cobol_chunkers PROC & DATA blocks

πŸš€ Quick Start

Prerequisites

  • Python 3.8+ for backend
  • Node.js 18+ for frontend
  • Neo4j Aura account (free tier available)
  • Google AI Studio API key

1. Clone the Repository

git clone <repository-url>
cd CodeScrybe-Legacy-Repository-AI

2. Environment Setup

Create a .env file in the Server directory:

# Neo4j Configuration
NEO4J_URI=bolt://<your-neo4j-uri>
NEO4J_USERNAME=<your-username>
NEO4J_PASSWORD=<your-password>

# Google Gemini AI
GEMINI_API_KEY=<your-gemini-api-key>

Getting Your API Keys:

Neo4j Aura:

  1. Visit Neo4j Aura
  2. Create a free account and new instance
  3. Copy the connection details to your .env

Google Gemini:

  1. Go to Google AI Studio
  2. Create a new API key
  3. Add it to your .env file

3. Backend Setup

# Create virtual environment (if venv410 doesn't work)
python -m venv venv
source Server/venv/bin/activate      # Linux/Mac
# or
Server\venv410\Scripts\activate.bat         # Windows

# Install dependencies
pip install -r Server/requirements.txt

# Start the backend server
uvicorn Server.backend.app:app --reload

The backend will be available at: http://127.0.0.1:8000

4. Frontend Setup

# Navigate to client directory (from root)
cd Client

# Install dependencies
npm install

# Start the development server
npm start

The frontend will be available at: http://localhost:3000

πŸ“š API Endpoints

Health Check

GET /health

Other Endpoints access from below

Interactive Documentation

Visit http://127.0.0.1:8000/docs for complete API documentation.

πŸ”§ Development Workflow

Full Pipeline Testing

  1. Test Individual Components:

    cd Server
    source venv410/bin/activate  # or your venv
    
    # Test repo cloning
    python backend/agents/repo_loader.py
    
    # Test code parsing
    python -m backend.agents.code_parsers.py
    
    # Test NER extraction
    python backend/agents/ner_extractor.py
    
    # Test knowledge graph building
    python backend/agents/graph_builder.py
    
    # Test GraphRAG queries
    python backend/agents/graph_rag.py
  2. Run Complete Pipeline:

    python backend/pipeline.py

Frontend Development

cd client
npm start        # Start development server

πŸ› Troubleshooting

Common Issues

Virtual Environment Issues:

  • If venv410 doesn't work, create a new virtual environment
  • Ensure Python 3.8+ is installed
  • Check path issues when moving project directories

API Connection Issues:

  • Verify .env file is in the Server directory
  • Check Neo4j instance is running
  • Validate Gemini API key is active

Port Conflicts:

  • Backend default: 8000
  • Frontend default: 3000
  • Modify ports in respective configuration files if needed

πŸ“ Usage Examples

Analyzing a Repository

  1. Start both backend and frontend servers
  2. Navigate to http://localhost:3000/dashboard
  3. Click on Add Repo
  4. Enter a GitHub repository URL
  5. Wait for analysis to complete
  6. Explore the knowledge graph and ask questions in their chat section

Sample Questions

  • "What are the main functions in this codebase?"
  • "Which files depend on the database module?"
  • "Show me all the API endpoints defined"
  • "What security-related functions are implemented?"

🀝 Contributing

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

πŸ“„ License

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

πŸ™ Acknowledgments

  • Google Gemini AI for intelligent code analysis
  • Neo4j for graph database capabilities
  • FastAPI for robust backend development
  • React.js for modern frontend development

CodeScrybe - Legacy Repository AI | Transforming Legacy Code Understanding Through AI

Need Help? Check the individual README files in the Server/ and client/ directories for more detailed setup instructions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors