TryTraGo is a high-performance multilanguage dictionary server designed to support approximately 60 million dictionary entries with robust API functionality, social features, and multi-database support.
-
Comprehensive Dictionary Functionality
- Dictionary entries with meanings and translations
- Support for multiple word types (words, compound words, phrases)
- Pronunciation information
-
Social Features
- Comments on meanings and translations
- Like/unlike functionality
- User profiles and contributions tracking
-
Clean Architecture
- Domain-driven design with clear separation of concerns
- Four-layer architecture (domain, application, interface, infrastructure)
- Highly testable and maintainable codebase
-
Multi-Database Support
- PostgreSQL (primary for production)
- MySQL (alternative)
- SQLite (development and testing)
-
Technology Stack
- Go 1.24+
- Gin web framework
- GORM for database access
- JWT authentication
- Uber-zap for structured logging
- Redis for caching
- Go 1.24 or higher
- Docker and Docker Compose (for local development)
- PostgreSQL, MySQL, or SQLite
- Clone the repository
git clone https://github.com/valpere/trytrago.git
cd trytrago
- Install dependencies
make setup
- Build the application
make build
- Run database migrations
make db-init
- Start the server
make run
Run using Docker:
make docker-run
Or with Docker Compose:
make docker-compose-up
TryTraGo provides a RESTful API for all dictionary operations. You can view the API documentation at:
- Swagger UI:
http://localhost:8080/swagger-ui.html
- OpenAPI Specification:
http://localhost:8080/v3/api-docs
# Register a new user
curl -X POST http://localhost:8080/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"[email protected]","password":"password123"}'
# Login and get a token
curl -X POST http://localhost:8080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"testuser","password":"password123"}'
# List entries
curl http://localhost:8080/api/v1/entries
# Create a new entry (requires authentication)
curl -X POST http://localhost:8080/api/v1/entries \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"word":"example","type":"WORD","pronunciation":"ɪɡˈzæmpəl"}'
trytrago/
├── application/ # Application services and DTOs
├── cmd/ # CLI commands
├── docker/ # Docker configuration
├── docs/ # Documentation
├── domain/ # Core business entities and interfaces
├── infrastructure/ # External details implementations
├── interface/ # HTTP handlers and middleware
├── migrations/ # Database migration files
├── scripts/ # Utility scripts
├── test/ # Test suites
└── main.go # Application entry point
# Development workflow
make setup # Install development dependencies
make build # Build the application
make run # Run the application
make test # Run unit tests
make test-all # Run all tests (unit, integration, API)
make lint # Run linter
# Database operations
make migrate # Run migrations
make db-init # Initialize database
make db-reset # Reset database
make migration-create # Create new migration files
# Docker
make docker-build # Build Docker image
make docker-run # Run Docker container
# Documentation
make docs # Generate API documentation
TryTraGo uses a YAML configuration file. You can specify the configuration file location using the --config
flag:
./build/trytrago server --config=/path/to/config.yaml
Example configuration:
server:
port: 8080
timeout: 30s
database:
type: postgres
host: localhost
port: 5432
name: trytrago
user: postgres
password: postgres
logging:
level: info
format: json
For detailed deployment instructions, please refer to README_DEPLOY.md.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.