A mobile-first, gamified language learning Progressive Web App for Romance languages (Spanish, French, Italian, Portuguese).
-
5-Task Learning Methodology
- Listen & Read - Listen to audio while reading sentences
- Shadowing - Listen, pause, repeat aloud with voice recording
- Scriptorium - Type each sentence while speaking aloud
- Translation Written - See English, type target language
- Translation Verbal - See English, record yourself speaking
-
Gamification
- XP and leveling system (20 levels)
- Daily streaks with freeze protection
- 20+ achievements to unlock
- Global and friends leaderboards
-
PWA Features
- Installable on mobile/desktop
- Offline support with background sync
- Push notifications (coming soon)
-
Modern Design
- Neo-Mediterranean aesthetic
- Dark/light theme toggle
- Mobile-first responsive design
- Smooth animations with Framer Motion
Frontend: React 18 + TypeScript + Vite + Tailwind CSS
State: Zustand (with persistence)
Audio: Howler.js
Recording: MediaRecorder API
Backend: Express.js + TypeScript
Database: PostgreSQL + Drizzle ORM
Auth: JWT + Passport.js
PWA: vite-plugin-pwa + Workbox
- Node.js 20+
- PostgreSQL 14+
- npm or yarn
git clone <repository-url>
cd fluent-in-four
npm installcp .env.example .envEdit .env with your values:
# Required
DATABASE_URL=postgresql://user:password@localhost:5432/fluent_in_four
JWT_SECRET=your-32-char-minimum-secret-key
JWT_REFRESH_SECRET=your-32-char-minimum-refresh-secret
# Optional
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your-admin-passwordGenerate secure keys:
openssl rand -base64 32# Create database
createdb fluent_in_four
# Run migrations
npm run db:migrate
# Seed initial data (languages, lessons, sentences)
npm run db:seed# Start both client and server
npm run dev
# Or separately:
npm run dev:server # http://localhost:3000
npm run dev:client # http://localhost:5173fluent-in-four/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Route pages
│ │ ├── stores/ # Zustand stores
│ │ ├── services/ # API services
│ │ └── hooks/ # Custom hooks
│ └── public/ # Static assets
├── server/ # Express backend
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── controllers/ # Request handlers
│ │ ├── services/ # Business logic
│ │ ├── middleware/ # Express middleware
│ │ └── db/ # Database schema & migrations
│ └── drizzle/ # Migration files
└── shared/ # Shared types
npm run dev- Start full development environmentnpm run build- Build for productionnpm run start- Start production server
npm run dev:server- Start server with hot reloadnpm run db:migrate- Run database migrationsnpm run db:seed- Seed database with initial datanpm run db:studio- Open Drizzle Studio
npm run dev:client- Start Vite dev servernpm run build:client- Build client for productionnpm run preview- Preview production build
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutPOST /api/auth/refresh- Refresh access tokenGET /api/auth/me- Get current user
GET /api/languages- List all languagesGET /api/lessons/:languageCode- List lessons for languageGET /api/lessons/:id- Get lesson details with sentences
GET /api/progress- Get user progress summaryPOST /api/progress/lessons/:id- Update lesson progressPOST /api/progress/lessons/:id/tasks/:task- Update task progress
GET /api/gamification/streak- Get current streakGET /api/gamification/achievements- Get achievementsGET /api/gamification/leaderboard- Get leaderboard
GET /api/admin/stats- Dashboard statisticsGET /api/admin/users- List usersPATCH /api/admin/users/:id- Update userPOST /api/admin/lessons- Create lessonPOST /api/admin/sentences- Bulk create sentences
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | - | PostgreSQL connection string |
JWT_SECRET |
Yes | - | Access token secret (32+ chars) |
JWT_REFRESH_SECRET |
Yes | - | Refresh token secret (32+ chars) |
JWT_ACCESS_EXPIRES |
No | 15m |
Access token lifetime |
JWT_REFRESH_EXPIRES |
No | 30d |
Refresh token lifetime |
NODE_ENV |
No | development |
Environment mode |
PORT |
No | 3000 |
Server port |
CLIENT_URL |
No | http://localhost:5173 |
Frontend URL |
ADMIN_EMAIL |
No | - | Initial admin email |
ADMIN_PASSWORD |
No | - | Initial admin password |
npm run build
npm run start- Create new Replit project (Node.js 20)
- Upload code or connect to Git
- Add PostgreSQL database
- Configure Secrets (environment variables)
- Upload audio files to Object Storage
- Run:
npm run db:migrate && npm run db:seed - Deploy
docker-compose up -d- User registration with email/password
- User login and logout
- Select language and view lessons
- Complete all 5 tasks in a lesson
- Verify XP and level progression
- Verify streak updates
- Unlock achievements
- Check leaderboard rankings
- Test offline mode
- Test PWA installation
- Admin panel access and functions
- JWT-based authentication with refresh tokens
- HTTP-only cookies for refresh tokens
- Password hashing with bcrypt
- Protected admin routes
- CORS configuration
- Input validation with Zod
MIT
Built with the help of Claude Code.