A browser-based Kotlin and Jetpack Compose compiler that performs actual compilation (not translation) using the real Kotlin compiler.
- ✅ Real Kotlin Compilation: Uses actual Kotlin compiler via JDoodle API
- ✅ Jetpack Compose Support: Compiles Compose code
- ✅ Browser-Based: No local setup required for users
- ✅ Free Tier Available: 200 requests/day with JDoodle free account
- ✅ Deploy to Vercel: Ready for deployment
- Sign up for a free account at JDoodle
- Go to your dashboard and get:
- Client ID
- Client Secret
-
Push your code to GitHub
-
Import to Vercel:
- Go to vercel.com
- Click "New Project"
- Import your GitHub repository
-
Add Environment Variables:
- In Vercel project settings, go to "Environment Variables"
- Add these two variables:
JDOODLE_CLIENT_ID= your client IDJDOODLE_CLIENT_SECRET= your client secret
-
Deploy:
- Click "Deploy"
- Your site will be live with working Kotlin compiler!
- User writes Kotlin/Compose code in the browser
- Code is sent to
/api/compileor/api/compile-composeendpoint - Serverless function calls JDoodle API with the code
- JDoodle compiles the code using the actual Kotlin compiler
- Compilation results (output, errors) are returned and displayed
POST /api/compile- Compiles regular Kotlin codePOST /api/compile-compose- Compiles Jetpack Compose code
To test locally:
# Install Vercel CLI
npm install -g vercel
# Create .env file with your credentials
echo "JDOODLE_CLIENT_ID=your_id" > .env
echo "JDOODLE_CLIENT_SECRET=your_secret" >> .env
# Run locally
vercel devOpen http://localhost:3000
- Free Tier: JDoodle free tier allows 200 requests per day
- Production: For higher usage, consider JDoodle paid plans or set up your own Kotlin compiler server
- Compose Limitations: Full Compose UI rendering requires Android runtime, but code compilation works
MIT