A comprehensive web application for learning Japanese, similar to LingQ but focused exclusively on Japanese language learning.
- π Custom Ebook Reader: Upload and read Japanese ebooks with integrated dictionary
- π Word Lookup: Click any word to see definitions, readings, and pronunciations
- π― SRS System: Spaced Repetition System for vocabulary learning
- π Progress Tracking: Visual indicators for known/unknown words
- π Statistics: Detailed learning progress and analytics
- Multiple dictionary sources (Sanseido, Daijirin, Ookoku, Jitendex)
- Monolingual and bilingual definitions
- JLPT, WaniKani, and Kanken level indicators
- Audio pronunciations
- Enhanced definitions and explanations
- Context-aware translations
- Learning recommendations
- Difficulty assessment
- Clone the repository
- Set up virtual environment
- Install dependencies
- Configure database
- Run the application
This is the Go backend for the Japanese Learning Web App, rewritten from Python for better performance and simpler dependency management.
- Go 1.21+ installed
- PostgreSQL installed and running
- Git (optional)
-
Navigate to the Go backend directory:
cd backend-go -
Install dependencies:
go mod tidy
-
Set up environment variables:
cp .env.example .env # Edit .env with your PostgreSQL credentials -
Create PostgreSQL database:
CREATE DATABASE japanese_learning_app;
-
Run the application:
go run main.go
The server will start on http://localhost:8000
backend-go/
βββ main.go # Application entry point
βββ internal/
β βββ config/ # Configuration management
β βββ database/ # Database connection & migrations
β βββ handlers/ # HTTP request handlers
β βββ middleware/ # HTTP middleware (auth, etc.)
β βββ models/ # Database models
β βββ utils/ # Utility functions
βββ .env.example # Environment variables template
βββ go.mod # Go module dependencies
Copy .env.example to .env and configure:
# Database
DATABASE_URL=postgres://username:password@localhost:5432/japanese_learning_app?sslmode=disable
# Server
PORT=8000
DEBUG=true
# JWT Secret (change in production!)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-productionPOST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user (requires auth)
GET /api/books/- Get user's books (requires auth)POST /api/books/upload- Upload new book (requires auth)GET /api/books/:id- Get specific book (requires auth)DELETE /api/books/:id- Delete book (requires auth)
GET /health- API health status
go run main.gogo build -o japanese-learning-app main.go
./japanese-learning-appgo test ./...- Gin - HTTP web framework
- GORM - ORM for database operations
- PostgreSQL - Primary database
- JWT - Authentication tokens
- bcrypt - Password hashing
Advantages over the Python version:
- Simpler Dependencies: No virtual environments or complex package management
- Better Performance: Compiled binary, faster execution
- Easy Deployment: Single binary with no runtime dependencies
- Type Safety: Compile-time error checking
- Concurrency: Built-in goroutines for handling multiple requests
The Go version maintains API compatibility with the Python version, so your frontend code should work without changes.
- Install PostgreSQL and configure the database
- Run the Go backend:
go run main.go - Test with the existing frontend at
../frontend/templates/index.html - Start implementing additional features (word processing, SRS, etc.)
- Foundation: Basic project setup and database design
- Core Reader: Ebook upload and basic reading interface
- Dictionary Integration: Word lookup and definitions
- SRS System: Spaced repetition functionality
- Advanced Features: AI integration and analytics
- Polish: UI/UX improvements and optimization
MIT License