π README Π½Π° ΡΡΡΡΠΊΠΎΠΌ
A multi-platform user support system with a single core engine (currently integrated with Telegram).
The project is built according to Hexagonal / Clean Architecture principles:
- all business logic is in the
core - platforms (Telegram, Discord, etc.) are connected via adapters
- UI and configuration are separate
- Features
- Requirements
- How to use
- Dev running
- Architecture
- Main idea
- How to add a new platform
- Configuration and web panel
- Roadmap
- admin commands (/help to display all)
- support tickets (one open ticket per user)
- message rate limit
- ban users
- welcome message upon first contact
- the ability to add a header and footer to support responses
- attachments support
- operator responses -> to user
- web interface for editing config
application.yml - architecture ready to connect new platforms
- Java 21
- PostgreSQL or MySQL
- Maven (for dev)
Download .jar + .yml from releases and put them in one directory
java -jar target/support-platform-<current version>.jarmvn spring-boot:runmvn clean packagejava -jar target/support-platform-<current version>.jarcommand
tree -I 'target|.git|.idea|*.class|test' --dirsfirst
βββ src
βΒ Β βββ main
βΒ Β βββ java
βΒ Β βΒ Β βββ com
βΒ Β βΒ Β βββ bob
βΒ Β βΒ Β βββ support_platform
βΒ Β βΒ Β βββ config
βΒ Β βΒ Β βΒ Β βββ SupportConfig.java
βΒ Β βΒ Β βΒ Β βββ SupportProperties.java
βΒ Β βΒ Β βββ core
βΒ Β βΒ Β βΒ Β βββ dto
βΒ Β βΒ Β βΒ Β βΒ Β βββ AdminReplyContext.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ CoreCommand.java
βΒ Β βΒ Β βΒ Β βββ interfaces
βΒ Β βΒ Β βΒ Β βΒ Β βββ CoreResponse.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ PlatformMessage.java
βΒ Β βΒ Β βΒ Β βββ model
βΒ Β βΒ Β βΒ Β βΒ Β βββ CommandScope.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ PlatformType.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ Ticket.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ TicketStatus.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ User.java
βΒ Β βΒ Β βΒ Β βββ service
βΒ Β βΒ Β βΒ Β βΒ Β βββ RateLimitExceededException.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ RateLimitService.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ SupportService.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ TextService.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ TicketService.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ UserBannedException.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ UserService.java
βΒ Β βΒ Β βΒ Β βββ CoreCommandProcessor.java
βΒ Β βΒ Β βΒ Β βββ CoreCommandType.java
βΒ Β βΒ Β βΒ Β βββ CoreSupportProcessor.java
βΒ Β βΒ Β βΒ Β βββ PlatformConfigResolver.java
βΒ Β βΒ Β βββ platform
βΒ Β βΒ Β βΒ Β βββ discord
βΒ Β βΒ Β βΒ Β βββ telegram
βΒ Β βΒ Β βΒ Β βββ adapter
βΒ Β βΒ Β βΒ Β βΒ Β βββ TelegramCommandAdapter.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ TelegramMessageAdapter.java
βΒ Β βΒ Β βΒ Β βΒ Β βββ TelegramPlatformMessage.java
βΒ Β βΒ Β βΒ Β βββ TelegramBot.java
βΒ Β βΒ Β βΒ Β βββ TelegramBotConfig.java
βΒ Β βΒ Β βΒ Β βββ TelegramProperties.java
βΒ Β βΒ Β βΒ Β βββ TelegramSender.java
βΒ Β βΒ Β βΒ Β βββ TelegramUpdateHandler.java
βΒ Β βΒ Β βββ repository
βΒ Β βΒ Β βΒ Β βββ TicketRepository.java
βΒ Β βΒ Β βΒ Β βββ UserRepository.java
βΒ Β βΒ Β βββ web
βΒ Β βΒ Β βΒ Β βββ ConfigController.java
βΒ Β βΒ Β βΒ Β βββ SupportConfigDto.java
βΒ Β βΒ Β βΒ Β βββ UiController.java
βΒ Β βΒ Β βΒ Β βββ WebSecurityConfig.java
βΒ Β βΒ Β βΒ Β βββ YamlConfigService.java
βΒ Β βΒ Β βββ SupportPlatformApplication.java
βΒ Β βββ resources
βΒ Β βββ static
βΒ Β βΒ Β βββ app.js
βΒ Β βββ templates
βΒ Β βββ index.html
βββ application.yml
βββ pom.xml
Core knows nothing about platforms (telegram, discord, etc.)
Core:
- accepts abstract messages (
PlatformMessage) - returns intents (
CoreResponse) - does not send messages itself
Platforms:
- determine context (user / admin / command)
- adapt native messages
- execute CoreResponse
To add a new platform, the following elements need to be implemented:
Platform native message adapter:
public interface PlatformMessage {
PlatformType platform();
long chatId();
long senderId();
String text();
boolean hasAttachments();
Object nativeMessage();
}
nativeMessage()is the native platform SDK object Core doesn't use it, it just passes it back toCoreResponse.CopyMessage
Converts a native platform message to a PlatformMessage:
@Component
public class TelegramMessageAdapter {
public PlatformMessage adapt(Message message) {
return new TelegramPlatformMessage(message);
}
}Converts admin commands to CoreCommand:
public record CoreCommand(
PlatformType platform,
long adminId,
String name,
List<String> args
) {}The platform itself determines the context of the message:
- admin command
- admin reply
- user message
Example logic:
1. If the command - CoreCommandProcessor
2. If the reply is from an administrator - CoreSupportProcessor.handleAdminReply
3. If the message is from a user - CoreSupportProcessor.handleUserMessage
The Core returns intents, the platform is obliged to fulfill them:
public sealed interface CoreResponse {
record SendText(long chatId, String text) implements CoreResponse {}
record CopyMessage(long from, long to, Object nativeMsg) implements CoreResponse {}
enum Ignore implements CoreResponse { INSTANCE }
}The platform knows:
- how to send a text
- how to copy a message
- how to ignore
All settings are located in application.yml.
Editing is possible:
- manually
- via the web panel
- By default, it's located on port 8080
- URL:
http://localhost:8080/ - HTTP Basic Auth
- Allows editing the entire
application.yml - Changes take effect after a restart
- Core engine (tickets, rate-limit, ban)
- Telegram platform
- Web UI for configuration
- Discord platform
- Rate-limit storage in Redis