AI-assisted code conversion

CodeSwitch

I built CodeSwitch to convert code between programming languages. It uses an AI engine with a rule-based fallback when the model service is unavailable.

The challenge

Code translation still needs to work when model providers hit rate limits or go offline. I also needed to keep the browser editor quick to load.

What I built

I built conversion across five programming languages with configurable OpenAI, Groq and Gemini providers and a rule-based fallback. API-key retries share one 20-second request budget. A cancellable subprocess prevents stalled HTTP calls from keeping a request running indefinitely. The React frontend lazy-loads Monaco Editor. Django REST Framework handles authentication with httpOnly JWT cookies and login-attempt lockouts.

Details & scope

CodeSwitch supports Python, C, C++, Java and JavaScript. I passed 163 backend tests covering authentication, conversion safety, provider failures and request boundaries. The backend is deployed on Railway and the frontend on Vercel. AI output needs review. The rule-based fallback covers a smaller set of conversion patterns.

Python / Django REST Framework / React / TypeScript

Explore all projects