A web application for language learning with text-to-speech and translation capabilities.
.
├── backend/ # FastAPI backend
│ ├── main.py # Main API code
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables (not in git)
└── frontend/ # Static frontend
├── index.html # Main frontend code
└── server.py # Development server
- Install dependencies:
# Install backend dependencies
npm run install:all
# Install frontend development dependencies
npm install
- Set up environment variables:
# Copy example .env and fill in your values
cp backend/.env.example backend/.env
- Run the development servers:
# Run both frontend and backend
npm run dev
# Or run them separately:
npm run frontend:dev
npm run backend:dev
- Create a new Web Service on Render.com
- Connect your GitHub repository
- Configure:
- Build Command:
cd backend && pip install -r requirements.txt
- Start Command:
cd backend && gunicorn main:app -k uvicorn.workers.UvicornWorker
- Build Command:
- Add environment variables:
OPENAI_API_KEY
: Your OpenAI API keyFRONTEND_URL
: Your GitHub Pages URL
- Update the API URL in frontend/index.html to point to your Render.com backend
- Deploy to GitHub Pages:
npm run deploy:frontend
- The frontend is a simple static site using HTML, CSS, and JavaScript
- The backend uses FastAPI and integrates with OpenAI's API
- Environment variables are used for configuration
- CORS is configured to allow GitHub Pages domains