This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend.
What I Built
My friend is learning C++ and DSA, but there was a recurring problem: whenever he got stuck on a problem, the easiest solution was to ask an AI for the answer.
That solved the problem once, but it didn't necessarily teach him how to solve the next one.
So I built CodeMate, a local AI coding mentor designed around one simple rule:
Don't give me the answer. Help me figure it out.
CodeMate can:
- Give progressive hints instead of immediately revealing solutions
- Explain C++ code in beginner-friendly language
- Identify bugs and explain why they happen
- Analyze a student's approach
- Generate practice questions around weak concepts
- Adapt the difficulty based on previous attempts
The goal isn't to replace practice platforms. It's to create a learning layer between "I'm stuck" and "I understand it now."
Demo
[https://shivammraj.github.io/CodeMate/]
Code
[https://github.com/shivammraj/CodeMate]
How I Built It
CodeMate is built around a locally running open-weight AI model rather than a proprietary AI API.
The architecture is:
React Frontend
β
FastAPI Backend
β
CodeMate Learning Engine
β
Ollama
β
Open-weight LLM
β
Personalized response
The AI has different modes for different situations:
Hint Mode
The model is instructed not to immediately reveal the complete solution. It gives one conceptual hint and waits for the learner to try again.
Debug Mode
Instead of rewriting the entire program, it identifies the error, explains the cause, and suggests the smallest useful correction.
Explain Mode
It breaks code into its purpose, variables, logic, example execution, and complexity.
Practice Mode
It generates progressively harder problems based on concepts the learner has struggled with.
Why Does Open Innovation Matter?
For this project, using an open model wasn't just a technical choice.
CodeMate is designed around a person's code, mistakes, learning history, and study material. I wanted the core AI experience to be capable of running locally rather than requiring every interaction to be sent to a proprietary cloud API.
Running an open-weight model locally gives CodeMate several important properties:
- Privacy: code and learning data can remain on the user's device.
- Offline capability: the core AI can work without an internet connection after the model is installed.
- Model freedom: the underlying model can be replaced without rebuilding the entire product.
- Behavioral control: the tutoring behavior can be changed through our own prompts and application logic.
- No per-request API cost: local inference doesn't require paying a proprietary provider for every question.
Open innovation made the AI itself something I could inspect, adapt, and build around rather than simply consume through an API.
What My Friend Thought
After the first version was ready, I gave it to my friend and asked them to use it without explaining how it worked.
Their feedback was:
"[Honestly, CodeMate was helpful because it didn't immediately give me the solution. The hints made me think about the problem myself, which helped me understand the logic better.
I especially liked the Debug Mode because it explained what was wrong with my code instead of just giving me the corrected code.
One thing I would improve is the hint system. Sometimes the first hint was a little too vague, so having a βGive me a stronger hintβ option would make it easier when I'm completely stuck.]"
That feedback changed
[Overall, I would actually use it while practicing DSA because it feels more like having someone guide me rather than just giving me the answer.].
What I Learned
The biggest lesson wasn't about getting an AI model to answer coding questions.
It was about building for a specific person.
A generic coding assistant tries to help everyone. CodeMate started with one person, one problem, and one question:
What would actually help my friend learn instead of simply finish the problem?
What's Next
If I continue developing CodeMate, I'd like to add:
- Better long-term learning profiles
- More accurate misconception detection
- Voice-based tutoring
- More efficient models for low-end laptops
- Personalized revision plans
- Support for additional programming languages
Top comments (0)