Reverba is an AI-powered vocabulary learning application that helps users master new words through personalized daily tasks and interactive tutoring. The platform uses intelligent task generation, priority-based learning, and AI evaluation to create an effective vocabulary learning experience.
- Word Management: Add, update, and organize vocabulary words with custom meanings and examples
- Priority-Based Learning System: Words progress through 4 priority levels (1-4) based on performance
- Daily Task Generation: Automatically generated tasks at 1 AM daily with up to 8 tasks per day
- AI-Powered Evaluation: OpenAI integration for intelligent assessment of user responses
- Interactive AI Tutor: Chat with an AI tutor for personalized learning assistance
- MEANING Tasks: Provide the meaning of a word
- SENTENCE Tasks: Create sentences using words correctly
- MCQ Tasks: Multiple-choice questions with pre-generated options
- PARAGRAPH Tasks: Write meaningful paragraphs (minimum 50 words) using words
- User Authentication: Secure signup, login, email verification, and password reset
- Dashboard: Comprehensive statistics and progress tracking
- Task History: View and review past learning sessions
- Word Mastery System: Track mastery count and mark words as mastered
- Dark/Light Theme: Modern UI with theme switching support
- User Management: Admin panel for managing users and system administration
- Framework: FastAPI (Python 3.11+)
- Database: MongoDB with Motor (async driver)
- Authentication: JWT tokens (access + refresh tokens)
- AI Integration: OpenAI API (GPT-4o-mini)
- Email Service: Resend API
- Task Scheduling: APScheduler for daily task generation
- Password Hashing: bcrypt
- API Documentation: FastAPI auto-generated docs
- Framework: React 19 with TypeScript
- Build Tool: Vite
- State Management: Redux Toolkit
- Routing: React Router v7
- UI Components: Radix UI primitives
- Styling: Tailwind CSS v4
- Form Handling: React Hook Form with Zod validation
- HTTP Client: Axios
- Icons: Lucide React
- Containerization: Docker & Docker Compose
- Deployment: Vercel (frontend), configurable backend hosting
Reverba/
βββ backend/
β βββ app/
β β βββ cron/ # Scheduled task generation
β β βββ middleware/ # Authentication middleware
β β βββ models/ # Pydantic models
β β βββ routers/ # API route handlers
β β βββ services/ # Business logic
β β βββ settings/ # Environment configuration
β β βββ templates/ # Email templates
β β βββ utils/ # Utility functions
β β βββ database.py # MongoDB connection
β β βββ main.py # FastAPI application
β βββ Dockerfile
β βββ docker-compose.yml
β βββ requirements.txt
β βββ trigger_daily_tasks.py # Manual task trigger script
β
βββ frontend/
βββ src/
β βββ api/ # API client functions
β βββ components/ # React components
β β βββ ui/ # Reusable UI components
β βββ layouts/ # Layout components
β βββ pages/ # Page components
β βββ router/ # Route configuration
β βββ store/ # Redux store and slices
β βββ utils/ # Utility functions
βββ package.json
βββ vite.config.ts
βββ vercel.json
- Python 3.11 or higher
- Node.js 18+ and npm
- MongoDB (local or cloud instance)
- OpenAI API key
- Resend API key (for email functionality)
- Docker and Docker Compose (optional, for containerized setup)
-
Navigate to backend directory:
cd backend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envfile in thebackenddirectory:# Database MONGO_URI=mongodb://localhost:27017/reverba # Authentication ACCESS_TOKEN_SECRET=your-access-token-secret-here REFRESH_TOKEN_SECRET=your-refresh-token-secret-here JWT_ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MIN=15 REFRESH_TOKEN_EXPIRE_DAYS=30 # OpenAI OPENAI_API_KEY=your-openai-api-key OPENAI_MODEL=gpt-4o-mini # Cron CRON_TIMEZONE=Asia/Kolkata # Email (Resend) RESEND_API_KEY=your-resend-api-key RESEND_FROM_EMAIL=noreply@yourdomain.com # Application APP_SECRET_KEY=your-app-secret-key APP_ENV=development CORS_ORIGINS=http://localhost:3000,http://localhost:5173
-
Run the backend:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Or using Docker:
docker-compose up --build
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create
.envfile in thefrontenddirectory:VITE_BACKEND_URL=http://localhost:8000
-
Run the development server:
npm run dev
-
Build for production:
npm run build
Once the backend is running, you can access:
- Interactive API Docs: http://localhost:8000/docs
- Alternative Docs: http://localhost:8000/redoc
- Health Check: http://localhost:8000/health
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/verify-email- Verify email addressPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password
GET /api/words- Get all words (with optional filters)POST /api/words- Create a new wordPOST /api/words/batch- Create multiple wordsGET /api/words/{word_id}- Get a specific wordPUT /api/words/{word_id}- Update a wordDELETE /api/words/{word_id}- Delete a wordPOST /api/words/{word_id}/promote- Increase word priorityPOST /api/words/{word_id}/demote- Decrease word priorityPOST /api/words/{word_id}/master- Mark word as mastered
GET /api/tasks/today- Get today's daily tasksPOST /api/tasks/{task_id}/complete- Complete a task
POST /api/tutor/evaluate- Evaluate user response (MEANING/SENTENCE/PARAGRAPH)POST /api/tutor/chat/{chat_id}- Continue chat conversationGET /api/tutor/chat/{chat_id}- Get chat historyGET /api/tutor/chats- List user's chat history
GET /api/dashboard- Get dashboard statistics
GET /api/admin/users- List all users (admin only)GET /api/admin/stats- Get admin statistics (admin only)
- Tasks are automatically generated every day at 1 AM (configurable timezone)
- Word selection based on priority:
- Priority 1: 1 word β MEANING task
- Priority 2: 2 words β SENTENCE tasks (2 separate tasks)
- Priority 3: 3 words β MCQ tasks (3 separate tasks)
- Priority 4: 2 words β PARAGRAPH tasks (2 separate tasks)
- Total: Up to 8 tasks per day
- Words start at Priority 1 when added
- Non-selected words: Priority increases by 1 (max 4)
- After task completion:
- PASS: Priority set to 1
- FAIL: Priority set to 2, failure stats incremented
- Words can be manually promoted/demoted
- Words can be marked as "mastered" after 3 successful Priority 4 completions
- MEANING/SENTENCE/PARAGRAPH: Evaluated by OpenAI with strict criteria
- First failure: Provides hint without revealing answer
- Second failure: Reveals expected answer
- MCQ: Pre-generated during task creation, evaluated on frontend
- Chat continuation available after evaluation for unlimited learning
- JWT-based authentication with access and refresh tokens
- Password hashing with bcrypt
- Email verification for new accounts
- Secure password reset flow
- CORS configuration for API security
- Environment-based configuration
- Input validation with Pydantic models
# Backend tests (if available)
cd backend
pytest
# Frontend tests (if available)
cd frontend
npm test# Frontend linting
cd frontend
npm run lintFor development/testing, you can manually trigger daily task generation:
cd backend
python trigger_daily_tasks.pycd backend
docker-compose up --buildThe backend will be available at http://localhost:8000
MONGO_URI: MongoDB connection stringACCESS_TOKEN_SECRET: Secret for JWT access tokensREFRESH_TOKEN_SECRET: Secret for JWT refresh tokensOPENAI_API_KEY: OpenAI API key for AI featuresRESEND_API_KEY: Resend API key for emailsRESEND_FROM_EMAIL: Sender email addressAPP_SECRET_KEY: Application secret key
VITE_BACKEND_URL: Backend API URL
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is private and proprietary.
For issues, questions, or contributions, please open an issue in the repository.
Built with β€οΈ for vocabulary learners