How romanvintoniak/carinsurancesales works
Project type and purpose
• This is a .NET solution that implements a Telegram bot (CarInsuranceSalesBot).
• CarInsuranceSales.Api exposes HTTP endpoints (for Telegram webhook or API testing) and wires up the bot.
• CarInsuranceSales.Core is the application layer: it contains command handlers (BuyCarInsuranceCommand, ConfirmDocumentsDataCommand, etc.), document-data providers (Mindee or fake), policy providers (OpenAI or fake), models, configuration, and shared helpers.
File structure
• Top-level solution (CarInsuranceSales.sln) ties together two projects:
• CarInsuranceSales.Api
– Controllers/InsuranceSalesBotController.cs
– Program.cs (configures ASP.NET Core pipeline, DI, Telegram.Bot, routing)
– appsettings.json (TelegramBotToken, MindeeApiKey, OpenAiApiKey, PolicyDocumentUrl)
• CarInsuranceSales.Core
– Commands/…Command.cs (each bot action is a command implementing IBotCommand)
– DocumentDataProviders/…Provider.cs (implement IDocumentDataProvider)
– PolicyProviders/…Provider.cs (implement IPolicyProvider)
– Interfaces (IBotCommand, IDocumentDataProvider, IPolicyProvider)
– Models (DocumentData)
– Configuration (AppOptions) and Prompts.cs
• No dedicated database layer: the project relies on external APIs for document extraction and policy generation.
README for additional insights
• Lists dependencies: Telegram.Bot SDK, Mindee API client, OpenAI SDK.
• Specifies that the user sends documents → Mindee processes them → the bot asks for confirmations → OpenAI generates policy text → transaction completes.
Elements
• Clear labels: “Telegram User”, “Telegram Bot API”, “ASP.NET Core API”, “Command Dispatcher”, “Mindee OCR Service”, “OpenAI Service”.
• from User to Telegram Bot API
• from Bot API to your Webhook endpoint
• between Webhook controller and Command Dispatcher
• from commands to external APIs, back to controller, back to user
• Rectangles for internal components (API, dispatcher, commands)
• Cloud symbols for external services (Mindee, OpenAI, Telegram)
Detailed breakdown for maximal clarity
• Command Handlers (each user intent)
• DocumentDataProviders (multiple strategies)
• PolicyProviders (multiple strategies)
• Shared Models & Prompts
• Configuration node showing the appsettings.json keys.