TryTraGo

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.
Features
Quick Start
Prerequisites
- Go 1.24 or higher
- Docker and Docker Compose (for local development)
- PostgreSQL, MySQL, or SQLite
Installation
- 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
Docker
Run using Docker:
make docker-run
Or with Docker Compose:
make docker-compose-up
API Usage
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
Authentication
# Register a new user
curl -X POST http://localhost:8080/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"test@example.com","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"}'
Dictionary Operations
# 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"}'
Development
Project Structure
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
Make Commands
# 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
Configuration
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
Deployment
For detailed deployment instructions, please refer to README_DEPLOY.md.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Weaknesses
Identified Weaknesses and Improvement Opportunities: Code Analysis: TryTraGo Dictionary Server.