A comprehensive language learning platform backend built with Node.js, Express, TypeScript, and Prisma. This API powers interactive language learning experiences with AI-generated content, text-to-speech capabilities, and user progress tracking.
Backend URL: https://langquest-backend.onrender.com
- AI-Powered Scene Generation: Create interactive language learning scenarios using Google Gemini AI
- Text-to-Speech Integration: Generate audio for script lines using Murf AI
- User Response Tracking: Store and manage user interactions with learning content
- Multi-Language Support: Support for various target languages
- Progress Tracking: Monitor user learning progress and mistakes
- Scene Management: Create and retrieve learning scenes with script lines
- User Responses: Track user interactions and responses
- Lesson System: Generate and manage lessons with AI-powered content
- Tutorial Progress: Track completion status and user progress
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- AI Integration:
- Google Gemini AI for content generation
- Murf AI for text-to-speech
- Database Hosting: Neon (PostgreSQL)
- Deployment: Render
langquest-backend/
βββ controllers/ # Business logic controllers
β βββ lesson-controller/ # Lesson generation and management
βββ prisma/ # Database schema and migrations
βββ routes/ # API route definitions
β βββ scene.ts # Scene management endpoints
β βββ userResponse.ts # User response tracking
β βββ lesson.ts # Lesson management
βββ utils/ # Utility functions
β βββ prisma.ts # Database client singleton
βββ types/ # TypeScript type definitions
βββ prompt/ # AI prompt templates
βββ dist/ # Compiled JavaScript (production)
- Scene: Learning scenarios with metadata
- ScriptLine: Individual dialogue lines with TTS audio
- UserResponse: User interactions and responses
- User: User accounts and preferences
- Lesson: AI-generated lesson content
- Tutorial: Learning tutorials and progress tracking
POST /scene # Create new learning scene
GET /scene # Get latest scene with script lines
POST /userResponse # Record user response to script line
GET /userResponse # Retrieve all user responses
POST /lesson # Generate new lesson content
GET /lesson/:userId # Get user's lessons
GET / # API health check
GET /health # Detailed health status
- Node.js (v18 or higher)
- PostgreSQL database
- Google AI API key
- Murf AI API key
-
Clone the repository
git clone https://github.com/Dev-Dhruba/LangQuest-backend.git cd LangQuest-backend -
Install dependencies
npm install
-
Set up environment variables
cp env.example .env
Update
.envwith your configuration:DATABASE_URL="your_postgresql_connection_string" GOOGLE_API_KEY="your_google_ai_api_key" MURF_API_KEY="your_murf_ai_api_key" PORT=8000
-
Set up the database
npx prisma migrate dev npx prisma generate
-
Start development server
npm run dev
npm run build
npm startnpm run dev- Start development server with hot reloadnpm run build- Build for productionnpm start- Start production servernpm run prisma:generate- Generate Prisma clientnpm run compile- Compile TypeScript
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | β |
GOOGLE_API_KEY |
Google Gemini AI API key | β |
MURF_API_KEY |
Murf AI TTS API key | β |
PORT |
Server port (default: 8000) | β |
NODE_ENV |
Environment (production/development) | β |
The project uses Prisma for database management:
# Create new migration
npx prisma migrate dev --name migration_name
# Apply migrations
npx prisma migrate deploy
# Reset database (development only)
npx prisma migrate reset- CORS enabled for cross-origin requests
- Environment variables for sensitive data
- Input validation for API endpoints
- Error handling with detailed logging
curl -X POST https://langquest-backend.onrender.com/scene \
-H "Content-Type: application/json" \
-d '{"language": "Korean"}'curl https://langquest-backend.onrender.com/scenecurl -X POST https://langquest-backend.onrender.com/userResponse \
-H "Content-Type: application/json" \
-d '{"scriptLineId": 1, "response": "μλ
νμΈμ"}'- Connect GitHub repository to Render
- Configure build settings:
- Build Command:
npm ci && npx prisma generate && npx tsc - Start Command:
npm start
- Build Command:
- Add environment variables in Render dashboard
- Deploy automatically on git push
npm run build
npm start- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
All API responses follow this structure:
{
"message": "Success message",
"data": {...},
"count": 10 // (for list responses)
}{
"error": "Error message",
"details": "Detailed error information"
}This project is licensed under the ISC License.
Dev-Dhruba - GitHub Profile
Shreya Shaw - GitHub Profile
- Frontend Repository: [Add your frontend repo link here]
- Mobile App: [Add your mobile app repo link here]
Live API: https://langquest-backend.onrender.com
For questions or support, please open an issue in the GitHub repository.