Skip to content

shubhamranswal/TechGuru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages