How alexisomg/bmstu-free-rooms works
Main Components Identification
The project appears to be a Telegram bot with the following key components:
a) Bot Interface Layer
• Entry point through Telegram Bot API
• Located in handlers/bot.go
b) ICS Processing System
• ICS file loader (handlers/iscloader.go)
• ICS parser (icsparser/icsparser.go)
c) Core Service Layer
• Business logic handlers in service/ directory
• Separate services for different entities (audience, group, lesson, schedule, user)
d) Database Layer
• PostgreSQL database (indicated by init.sql)
• Database models and operations in database/ directory
Component Relationships
[Telegram Bot API] (External)
• ↓
[Bot Handler Layer]
• ↓
[ICS Processing System] ←→ [External ICS Calendar Source]
• ↓
[Service Layer]
• ↓
[Database Layer]
• ↓
[PostgreSQL Database]
Specific Elements
• Telegram Bot API
• ICS Calendar Source (University's schedule system)
b) Core Components (Solid rectangles):
• Bot Handler (handlers/bot.go)
• ICS Processor (icsparser/)
• Service Layer (service/)
• Database Layer (database/)
• User requests → Bot Handler
• Schedule updates → ICS Processor
• Data persistence flows → Database
Important Details to Highlight
a) Service Layer Components:
• AudienceService
• GroupService
• LessonService
• ScheduleService
• UserService
b) Database Entities:
• Audience
• Group
• Lesson
• Schedule
• User
Architectural Patterns to Emphasize
• Layer separation (handlers → service → database)
• Domain-driven design (separate service files for each domain entity)
• Repository pattern (database layer implementation)
Remember to indicate the asynchronous nature of Telegram bot interactions and any background processes for ICS file processing. This will help other developers understand both the static structure and dynamic behavior of the system.