This Next.js application uses API routes and requires a server-side environment. GitHub Pages cannot host this application because it only serves static files.
Vercel is the best platform for Next.js applications and offers free hosting.
-
Push your code to GitHub (if not already done):
git add . git commit -m "Prepare for deployment" git push origin main
-
Deploy to Vercel:
- Go to vercel.com
- Sign up/Login with your GitHub account
- Click "New Project"
- Import your repository:
Yashwanth-Kumar-Kotla/aura_duo_project - Vercel will auto-detect Next.js settings
-
Add Environment Variables:
- In your Vercel project settings, go to "Environment Variables"
- Add:
OPENAI_API_KEY= your OpenAI API keyGEMINI_API_KEY= your Gemini API key
- Click "Redeploy" after adding variables
-
Your site will be live! Vercel will give you a URL like
https://aura-duo.vercel.app
- Go to netlify.com
- Sign up/Login with GitHub
- Click "Add new site" → "Import an existing project"
- Select your repository
- Build settings:
- Build command:
npm run build - Publish directory:
.next
- Build command:
- Add environment variables in Site settings → Environment variables
- Deploy!
- Go to railway.app
- Sign up with GitHub
- Click "New Project" → "Deploy from GitHub repo"
- Select your repository
- Add environment variables in the Variables tab
- Railway will automatically detect Next.js and deploy
- GitHub Pages only serves static HTML/CSS/JS files
- Your app uses Next.js API routes (
/api/chat,/api/list-models) which require a Node.js server - API routes need to access environment variables and make server-side API calls
- GitHub Pages has no server-side execution capability
To run locally:
npm install
npm run devMake sure to create a .env.local file with:
OPENAI_API_KEY=your_key_here
GEMINI_API_KEY=your_key_here
- Build fails: Check that all dependencies are in
package.json - API errors: Verify environment variables are set correctly
- 404 errors: Make sure you're deploying to a platform that supports Next.js (not GitHub Pages)