This guide will walk you through setting up CodeCoach on your local machine.
Before you begin, ensure you have:
- Node.js 18 or higher installed
- npm or yarn package manager
- A Supabase account (free tier is fine)
- An OpenRouter account (free tier available)
Dependencies are already installed. If you need to reinstall:
npm install-
Create a Supabase Project
- Go to supabase.com
- Click "Start your project"
- Create a new organization (if you don't have one)
- Create a new project
- Wait for the project to be set up (takes ~2 minutes)
-
Get Your Credentials
- In your Supabase project dashboard, go to Settings > API
- Copy the "Project URL" (looks like:
https://xxxxx.supabase.co) - Copy the "anon public" key (under "Project API keys")
-
Enable Email Authentication
- Go to Authentication > Providers
- Ensure "Email" is enabled
- Configure email templates if desired (optional)
-
Create an OpenRouter Account
- Go to openrouter.ai
- Sign up for a free account
- Verify your email
-
Generate API Key
- Go to your account settings
- Navigate to "API Keys"
- Click "Create Key"
- Copy the generated API key
-
Add Credits (Optional)
- The free tier of DeepSeek model is available
- You can add credits if you want to use other models
- For CodeCoach, the free tier is sufficient
-
Create Environment File
cp .env.example .env.local
-
Fill in Your Credentials Open
.env.localand add your credentials:# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here # OpenRouter API Key OPENROUTER_API_KEY=your-openrouter-api-key-here
Important:
- Replace
your-project.supabase.cowith your actual Supabase URL - Replace
your-anon-key-herewith your Supabase anon key - Replace
your-openrouter-api-key-herewith your OpenRouter API key
- Replace
npm run devThe application will start at http://localhost:3000
-
Visit the Landing Page
- Open http://localhost:3000
- You should see the CodeCoach landing page
-
Create an Account
- Click "Get Started" or "Sign Up"
- Enter your email and password
- Check your email for verification (if enabled)
- Sign in with your credentials
-
Test Code Analysis
- Paste some code in the input editor
- Select a complexity level
- Click "Analyze"
- View the analyzed code with comments
-
Test Code Conversion
- Switch to "Convert Code" mode
- Paste code in the input editor
- Select source and target languages
- Click "Convert"
- View the converted code
- Solution: Check that your OpenRouter API key is correct in
.env.local - Verify you have credits/free tier access on OpenRouter
- Check the browser console for detailed error messages
- Solution: Verify your Supabase credentials in
.env.local - Ensure email authentication is enabled in Supabase dashboard
- Check that your Supabase project is active
- Solution: Run
npm installagain - Delete
node_modulesand.nextfolders, then runnpm install
- Solution: Either stop the process using port 3000, or run on a different port:
npm run dev -- -p 3001
-
Build the application
npm run build
-
Start the production server
npm start
-
Push to GitHub
git init git add . git commit -m "Initial commit" git remote add origin <your-repo-url> git push -u origin main
-
Deploy on Vercel
- Go to vercel.com
- Click "Import Project"
- Select your GitHub repository
- Add environment variables from
.env.local - Click "Deploy"
-
Configure Environment Variables in Vercel
- Go to your project settings
- Navigate to "Environment Variables"
- Add all variables from
.env.local - Redeploy if necessary
- Customize the UI to match your brand
- Add more programming languages
- Implement user preferences storage
- Add code history/favorites feature
- Integrate analytics
If you encounter any issues:
- Check the console for error messages
- Verify all environment variables are set correctly
- Ensure all dependencies are installed
- Check the README.md for additional information
- Never commit
.env.localto version control - Keep your API keys secure
- Use environment variables for all sensitive data
- Enable row-level security in Supabase for production