Yulia-Lingo is a modern, secure English Learning Telegram Bot built with Go.
- Prerequisites
- Tech Stack
- Architecture
- Security Features
- Quick Start
- Features
- Configuration
- Development
- Contributing
- Code of Conduct
- License
- Contact
- Go 1.21 or higher
- PostgreSQL 13+
- Docker and Docker Compose (optional)
- Telegram Bot Token
- Language: Go 1.21
- Architecture: Clean Architecture with Dependency Injection
- Database: PostgreSQL with connection pooling
- Telegram Bot API: github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
- Logging: Structured JSON logging with Logrus
- Configuration: Environment-based configuration
- Containerization: Docker with multi-stage builds
The application follows Clean Architecture principles with clear separation of concerns:
cmd/app/ # Application entry point
internal/
├── config/ # Configuration management
├── database/ # Database connection and management
├── logger/ # Structured logging
├── telegram/ # Telegram bot management
│ └── handlers/ # Message and callback handlers
├── irregular_verbs/ # Irregular verbs domain
├── my_word_list/ # Word list domain
├── translate/ # Translation service
└── util/ # Shared utilities
- Input Validation: All user inputs are validated and sanitized
- SQL Injection Prevention: Parameterized queries and prepared statements
- SSRF Protection: URL allowlisting for external API calls
- Log Injection Prevention: Structured logging with input sanitization
- Secure Configuration: Environment-based secrets management
- Resource Management: Proper connection pooling and cleanup
- Concurrency Control: Limited goroutine spawning to prevent resource exhaustion
- Clone the repository:
git clone https://github.com/Sunagatov/Yulia-Lingo.git
cd Yulia-Lingo
- Copy and configure environment variables:
cp .env.example .env
# Edit .env with your configuration
- Start the application:
docker-compose up -d
- Install dependencies:
go mod download
-
Set up PostgreSQL database and configure environment variables
-
Run the application:
go run cmd/app/main.go
- Irregular Verbs Learning: Interactive study of English irregular verbs
- Personal Word Lists: Create and manage custom vocabulary lists
- Translation Service: Real-time word translation with multiple meanings
- Pagination: Efficient browsing through large datasets
- Structured Logging: Comprehensive logging for monitoring and debugging
- Health Checks: Database connectivity monitoring
- Graceful Shutdown: Proper resource cleanup on termination
The application uses environment variables for configuration. See .env.example
for all available options:
TELEGRAM_BOT_TOKEN
: Your Telegram bot tokenPOSTGRESQL_PASSWORD
: Database password
POSTGRESQL_HOST
: Database host (default: localhost)POSTGRESQL_PORT
: Database port (default: 5432)POSTGRESQL_USER
: Database user (default: postgres)POSTGRESQL_DATABASE_NAME
: Database name (default: yulia_lingo)LOG_LEVEL
: Logging level (debug, info, warn, error)IRREGULAR_VERBS_FILE_PATH
: Path to irregular verbs Excel file
go test ./...
The project includes comprehensive security scanning and follows Go best practices:
- SOLID principles implementation
- Dependency injection
- Interface-based design
- Comprehensive error handling
- Resource leak prevention
go build -o yulia-lingo cmd/app/main.go
Interested in contributing? Read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Please read our Code of Conduct to keep our community approachable and respectable.
This project is licensed under the MIT License.
Have any questions or suggestions? Feel free to open an issue or contact us directly.
Follow the instructions in the Quick Start section above.
The bot uses Telegram Bot API. Internal API documentation is available through code comments and interfaces.
Please see our Security Policy for reporting security issues.
Currently, the application supports PostgreSQL 13+. The database layer is abstracted and can be extended for other databases.
Join our community at https://t.me/zufarexplained for support and discussions!