A modern, AI-powered language learning platform focused on Cantonese, built with Go and React.
LearnSpeak is a comprehensive language learning platform that combines:
- Structured Learning Journeys - Organized topics and vocabulary
- Interactive Quizzes - Multiple quiz types with instant feedback
- AI-Powered Features - Automated content generation and suggestions
- Progress Tracking - Detailed analytics and learning statistics
- Role-Based Access - Separate interfaces for learners, teachers, and admins
- Go 1.24.3 - High-performance API server
- Echo v4 - Web framework
- PostgreSQL 15+ - Primary database
- GORM - ORM with auto-migrations
- JWT - Authentication tokens
- Docker - Containerization
- React 19 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Router - Client-side routing
- Axios - HTTP client
learnspeak/
├── backend/ # Go API server
│ ├── config/ # Configuration management
│ ├── database/ # Database connection and migrations
│ ├── dto/ # Data Transfer Objects
│ ├── handlers/ # HTTP request handlers
│ ├── middleware/ # Custom middleware
│ ├── models/ # Database models
│ ├── routes/ # Route definitions
│ ├── utils/ # Utility functions
│ └── main.go # Entry point
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom hooks
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── types/ # TypeScript types
│ └── public/ # Static assets
├── design/ # Design mockups and documentation
├── docs/ # Additional documentation
├── docker-compose.yml # Docker orchestration
└── build.sh # Production build script
- Go 1.24.3+
- Node.js 20+
- PostgreSQL 15+ (or use Docker)
- Docker & Docker Compose (optional, for containerized setup)
-
Clone the repository
git clone https://github.com/dannyswat/learnspeak.git cd learnspeak -
Start all services
docker-compose up
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080
- Database: localhost:5432
-
Navigate to backend directory
cd backend -
Copy environment file
cp .env.example .env
-
Configure database (update
.envwith your PostgreSQL credentials) -
Install dependencies (already done via go.mod)
go mod download
-
Run the backend
./run.sh
Backend runs at: http://localhost:8080
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Start development server
npm run dev
Frontend runs at: http://localhost:5173
If running PostgreSQL locally:
CREATE DATABASE learnspeak;The backend will automatically run migrations on startup.
Backend:
cd backend
go test ./...Frontend:
cd frontend
npm testBackend:
cd backend
golangci-lint runFrontend:
cd frontend
npm run lintBackend:
cd backend
gofmt -w .Frontend:
cd frontend
npm run formatUse the build script to create production builds:
./build.shThis will:
- Build the frontend (outputs to
frontend/dist/) - Build the backend binary (outputs to
backend/learnspeak-api)
The backend will serve both the API and static frontend files.
See DEPLOYMENT.md for detailed deployment instructions including:
- Manual deployment
- Docker deployment
- Nginx configuration
- Environment setup
- Security checklist
- 📚 docs/ - Complete documentation hub
- 🚀 docs/QUICKSTART.md - Get started in 5 minutes
- 🚢 docs/DEPLOYMENT.md - Production deployment guide
- 📋 design/PROGRESS.md - Project timeline and sprint progress
- 🔧 backend/README.md - Backend API documentation
- 💻 frontend/README.md - Frontend architecture
- ❓ docs/ANSWERS.md - Project requirements and decisions
- ✅ User registration and authentication
- ✅ JWT-based authorization
- ✅ Protected routes
- ✅ Role-based access control
- ✅ Responsive UI design
- ✅ Development and production environments
- Word and topic management
- Learning journeys
- Interactive quizzes
- Progress tracking
- AI-powered content generation
- Teacher and admin interfaces
API endpoints are available at:
- Development: http://localhost:8080/api/v1
- Production: https://your-domain.com/api/v1
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginGET /api/v1/profile- Get user profile (protected)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Danny Wat - @dannyswat
Project Link: https://github.com/dannyswat/learnspeak