Skip to content

shubhamranswal/TechGuru

Repository files navigation

TechGuru

Your AI Pair-Programmer That Actually Teaches You
Built with ❤️ by Shubham Singh Ranswal









🧠 What is TechGuru?

TechGuru is an interactive AI code-teaching agent built for software students who need:

  • A teacher
  • A mentor
  • A tech lead
  • A code reviewer
  • A bug fixer
  • A test writer
  • A project generator

Instead of just answering questions, TechGuru teaches you how to think like a real software engineer.

It’s powered by:

  • FastAPI backend
  • Gemini 2.0 Flash Lite (affordable, fast, highly capable)
  • Fully custom ChatGPT-style UI with streaming
  • Multiple intelligent agents (explain, generate-tests, bughunt, scaffold)
  • Local project generation & auto-pytest execution

📌 This project is submitted to the Kaggle Agents Capstone competition. Check the writeup here: https://kaggle.com/competitions/agents-intensive-capstone-project/writeups/techguru


🧩 Core Features

✅ Explain Code (line-by-line with micro-exercises)

✅ Generate Pytest Tests

✅ Bughunt (finds issues + returns patch diff)

✅ Scaffold Complete Python Projects

✅ ChatGPT-style UI with token-by-token streaming

✅ Syntax highlighting via Prism.js

✅ Export chat as Markdown

✅ User avatar uploading

✅ Works offline with fallback logic

✅ Clean FastAPI endpoints (/stream, /explain, /generate-tests, /bughunt, /scaffold)


🏗️ Architecture Overview

┌────────────────────┐
│      Web UI        │
│ (streaming + Prism │
└─────────┬──────────┘
          │ /stream
┌─────────▼──────────┐
│   FastAPI Backend   │
│  - explain          │
│  - generate-tests   │
│  - bughunt          │
│  - scaffold         │
│  - run-tests        │
└─────────┬──────────┘
          │
┌─────────▼──────────┐
│   Agent Layer       │
│ ExplainAgent        │
│ TestGenAgent        │
│ BughuntAgent        │
│ ScaffoldAgent       │
└─────────┬──────────┘
          │
┌─────────▼──────────┐
│ Gemini API 2.0 Lite │
└─────────────────────┘

🎨 UI Screenshots

Below are actual screenshots from your Images/screenshots/ folder. Replace filenames if needed.

💬 Chat Interface

🔍 Explain Mode

Explain Mode

🧪 Test Generation

Test Generation

🏗️ Scaffolding

Scaffolding


🚀 Running Locally

1. Clone repo

git clone https://github.com/shubhamranswal/TechGuru
cd TechGuru

2. Create virtual env

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Set your API key

Windows:

setx GOOGLE_API_KEY "your_key_here"

Mac/Linux:

export GOOGLE_API_KEY="your_key_here"

5. Start server

uvicorn demo.demo_fastapi:app --reload

6. Open UI

http://127.0.0.1:8000/chat

🔌 API Endpoints

POST /explain
POST /generate-tests
POST /bughunt
POST /scaffold
GET  /run-tests
POST /stream   <-- streaming UI endpoint

Example:

curl -X POST "http://127.0.0.1:8000/explain" \
-H "Content-Type: application/json" \
-d "{\"code\":\"def add(a,b): return a+b\"}"

📦 Project Scaffolding Example

Generated automatically:

myproject/
  ├── README.md
  ├── src/
  │     └── main.py
  ├── tests/
  │     └── test_main.py
  └── .github/workflows/ci.yml

📂 Folder Structure

TechGuru/
├── app/
│   ├── agent_core.py
│   ├── code_tools.py
│   ├── srs_scheduler.py
│   └── scaffolder.py
├── demo/
│   ├── demo_fastapi.py
│   └── sample_project/
├── notebooks/
│   └── techguru_demo.ipynb
├── data/
│   └── sample_projects/
├── tests/
│   └── test_agent_core.py
├── requirements.txt
├── README.md
└── .github/workflows/ci.yml

🧪 Running Tests

python -m pytest

Scaffold-generated projects also include their own tests.


🏆 Kaggle Submission Link

👉 https://kaggle.com/competitions/agents-intensive-capstone-project/writeups/techguru


📝 Roadmap

  • VS Code extension
  • More languages (JS, Java, C++)
  • Better patch viewer
  • Multi-file understanding
  • Real-time tutoring mode
  • Deploy live demo server
  • Student progress tracking

🧑‍💻 Author

Shubham Singh Ranswal Software Engineer


🤝 Contributing

Pull requests are welcome! If you want to add test templates, fix prompts, or extend to new languages - feel free to contribute.


📄 License

This project is licensed under the MIT License.


🎉 Final Words

TechGuru started as a simple agent… and became a friendly, powerful personal tech lead for students everywhere.

If you like the project, ⭐ star the repo and share it!

About

A next-gen engineering mentor that explains, reviews, and levels up your code mastery.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors