How hamza-lgtm/teams-notification-bot works
1. System shape
This is a Spring Boot backend for a Microsoft Teams notification bot. It is not a frontend app; the main runtime is a Java service that exposes an HTTP API and integrates with Teams bot messaging.
2. Primary entry points
TeamsNotificationBotApplication is the Spring Boot bootstrap class. From there, the app wires together the bot, REST controller, security, persistence, and message-delivery services.
3. Inbound traffic paths
There are two main inbound entry points:
- A REST API exposed by NotificationController, used to submit notification requests such as POST /api/notification/send.
- A Teams bot interaction path handled by NotificationBot, which is the Teams-facing component for bot-driven communication.
4. Request protection and web wiring
SecurityConfig and ApiKeyAuthFilter indicate the API is protected by API-key-based authentication. WebConfig likely configures MVC/web integration for the service endpoints and bot-related HTTP handling.
5. Core business services
The service layer is split into three focused components:
- MessageService for notification/message orchestration.
- ChannelService for resolving and managing channel-related targets.
- TeamsMessageService for sending messages into Microsoft Teams and handling Teams-specific delivery logic.
6. Domain model
The app persists two main business entities:
- TeamsUser for user-level notification recipients and verification/enablement state.
- ChannelInfo for channel-level targets and configuration.
7. Persistence boundary
TeamsUserRepository and ChannelInfoRepository are the data-access layer. The repository naming strongly suggests Spring Data persistence behind the service layer, with services depending on repositories rather than controllers talking to storage directly.
8. External integrations
The repository is centered on Microsoft Teams and its bot ecosystem. The README also calls out:
- voice calls with text-to-speech
- email verification
- notification enable/disable controls
So the main outbound integrations are Teams messaging and a voice-call/TTS capability, with email used as part of user verification.
9. Localization and message content
src/main/resources/messages.properties and messages_fr.properties show the app supports localized user-facing text, at least English and French. That makes message rendering part of the delivery pipeline rather than hardcoded in controllers.
10. Deployment and packaging
The teams-manifest/ directory contains Teams app manifest files and a packaged zip, which means the bot is designed to be installed into Teams as a Teams application. Publishing_to_Microsoft.md and the README’s Azure/ngrok references indicate both local tunneling and Azure-hosted deployment are part of the operational model.
11. Build/runtime footprint
The project uses Maven and targets Java 11+. The target/ directory shows standard Maven build outputs, while pom.xml is the central build definition for dependencies and packaging.
12. End-to-end data flow
A typical notification flow is: client submits a request to the REST API → API key is validated → controller hands off to services → services resolve the recipient/channel via repositories → Teams delivery is performed through the Teams bot/message layer → optional voice-call/TTS follow-up is triggered. The bot path is separate but shares the same domain and delivery services.
Main entry points: MessageService.java Message Service · TeamsNotificationBotApplication.java App · ChannelService.java Channel Service · TeamsMessageService.java Teams Delivery
Components 19
Runtime
Spring Boot application and bot entry points
- App · Main application bootstrap for the notification bot
src/main/java/com/teamsbot/TeamsNotificationBotApplication.java
Web API
HTTP and bot-facing inbound handling
- Teams Bot · Teams-facing bot interaction handler
src/main/java/com/teamsbot/bot/NotificationBot.java - Notification API · HTTP entry point for notification requests
src/main/java/com/teamsbot/controller/NotificationController.java
Services
Business orchestration and delivery logic
- Message Service · Coordinates notification requests and delivery flow
src/main/java/com/teamsbot/service/MessageService.java - Channel Service · Resolves and manages channel targets
src/main/java/com/teamsbot/service/ChannelService.java - Teams Delivery · Sends messages into Microsoft Teams and related delivery steps
src/main/java/com/teamsbot/service/TeamsMessageService.java
Domain
Persistent business entities
- Teams User · Recipient and verification state for notification users
src/main/java/com/teamsbot/model/TeamsUser.java - Channel Info · Channel target and configuration data
src/main/java/com/teamsbot/model/ChannelInfo.java
Persistence
Repository access layer
- User Repo · Persistence access for Teams users
src/main/java/com/teamsbot/repository/TeamsUserRepository.java - Channel Repo · Persistence access for channel records
src/main/java/com/teamsbot/repository/ChannelInfoRepository.java
Config
Application wiring and security
- Security · Web security configuration for protected API access
src/main/java/com/teamsbot/config/SecurityConfig.java - API Key Filter · Validates API-key authenticated requests
src/main/java/com/teamsbot/config/ApiKeyAuthFilter.java - Web Config · HTTP and MVC wiring for the service
src/main/java/com/teamsbot/config/WebConfig.java - Bot Config · Configuration for Teams bot integration
src/main/java/com/teamsbot/config/BotConfig.java - Messages EN · Default localized user-facing text
src/main/resources/messages.properties - Messages FR · French localized user-facing text
src/main/resources/messages_fr.properties
Packaging
Teams deployment artifacts and docs
- Teams Manifest · Teams app packaging and install manifest
teams-manifest/manifest.json - Manifest FR · French Teams app manifest
teams-manifest/manifest.fr-fr.json - Publish Guide · Instructions for publishing and deployment
Publishing_to_Microsoft.md
Connections 21
- App → Teams Bot: wires · Bootstraps Teams bot component
- App → Notification API: wires · Exposes REST API entry point
- App → Security: loads · Applies web security configuration
- App → Web Config: loads · Configures HTTP handling
- App → Bot Config: loads · Registers bot integration settings
- Security → API Key Filter: uses · Installs API-key authentication filter
- Notification API → Message Service: delegates · Submits notification requests to service layer
- Teams Bot → Message Service: delegates · Reuses shared message orchestration
- Message Service → Channel Service: resolves · Looks up channel targets
- Message Service → Teams Delivery: delivers · Triggers Teams message sending
- Channel Service → Channel Repo: reads · Accesses channel persistence
- Message Service → User Repo: reads · Accesses recipient state
- Message Service → Teams User: uses · Operates on user notification state
- Channel Service → Channel Info: uses · Operates on channel configuration
- User Repo → Teams User: stores · Persists user records
- Channel Repo → Channel Info: stores · Persists channel records
- Teams Delivery → Messages EN: localizes · Uses message templates
- Teams Delivery → Messages FR: localizes · Uses message templates
- Bot Config → Teams Bot: configures · Provides bot runtime wiring
- Publish Guide → Teams Manifest: describes · Documents Teams packaging
- Publish Guide → Manifest FR: describes · Documents localized Teams packaging