aitutor/
βββ backend/ # FastAPI Backend Module
β βββ app/
β β βββ core/config.py
β β βββ models/schemas.py
β β βββ services/
β β βββ api/routes/
β β βββ main.py
β βββ requirements.txt
β βββ Dockerfile
β βββ render.yaml # Render deployment config
β βββ .env.example # Environment variables template
β βββ deploy.sh # Deployment script
β βββ README.md # Backend-specific docs
β
βββ frontend/ # Next.js Frontend Module
β βββ app/
β β βββ components/
β β βββ hooks/
β β βββ lib/
β β βββ types/
β βββ public/
β βββ package.json
β βββ vercel.json # Vercel deployment config
β βββ .env.example # Environment variables template
β βββ deploy.sh # Deployment script
β βββ README.md # Frontend-specific docs
β
βββ src/ # Original source (can be removed)
βββ deployment/ # Deployment guides and scripts
βββ docs/ # Documentation
βββ README.md # Main project README
Create two separate GitHub repositories:
aitutor-backendβ Deploy to Renderaitutor-frontendβ Deploy to Vercel
Keep single repository but deploy from subfolders:
- Backend: Deploy
backend/folder to Render - Frontend: Deploy
frontend/folder to Vercel
cd backend
./deploy.shcd frontend
./deploy.sh# Deploy backend
cd backend && ./deploy.sh
# Deploy frontend
cd ../frontend && ./deploy.shOPENROUTER_API_KEY: OpenRouter API keyPORT: 8000 (Render sets automatically)NODE_ENV: production
NEXT_PUBLIC_API_URL: Backend URLNODE_ENV: production
- Backend: https://aitutor-backend.onrender.com
- Frontend: https://aitutor-frontend.vercel.app
- API Docs: https://aitutor-backend.onrender.com/docs
- Independent Deployment: Deploy frontend/backend separately
- Faster Builds: Smaller codebases build faster
- Team Collaboration: Frontend/backend teams can work independently
- Scaling: Scale services independently
- Maintenance: Update one service without affecting the other
- Testing: Test services in isolation
If migrating from the current src/ structure:
- Copy
src/backend/tobackend/ - Copy
src/frontend/tofrontend/ - Update deployment configurations
- Create separate repositories (optional)
- Update CI/CD pipelines
name: Deploy Backend
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to Render
run: curl -X POST https://api.render.com/v1/services/${{RENDER_SERVICE_ID}}/deploysname: Deploy Frontend
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to Vercel
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}