How masa-massara/notifier works
Notifier App is a user-scoped service that turns Notion database page changes into conditional, formatted chat notifications. Users authenticate, register a Notion integration, discover databases, and manage templates and webhook destinations; incoming Notion webhooks then trigger matching templates and send messages to configured destinations. The graph follows documented capabilities and relationships visible in the supplied excerpts and SOURCE INDEX; links to unsampled handlers or modules are omitted where their wiring is not evidenced.
Main entry points: main.ts HTTP application · processNotionWebhookUseCase.ts Webhook processing · notionApiClient.ts Notion API client · firestore Firestore repositories
Components 23
API and access
- HTTP application
src/main.ts - Request authentication
src/presentation/middleware/authMiddleware.ts
User configuration
- Template API
src/presentation/handlers/templateHandler.ts - Template management
src/application/usecases - Destination API
src/presentation/handlers/destinationHandler.ts - Destination management
src/application/usecases - Notion integration API
src/presentation/handlers/userNotionIntegrationHandler.ts - Integration management
src/application/usecases - Database schema API
src/presentation/handlers/notionDatabaseHandler.ts - Database discovery
src/application/usecases/listNotionDatabasesUseCase.ts - Property lookup
src/application/usecases/getNotionDatabasePropertiesUseCase.ts
Notification workflow
- Notion webhook handler
src/presentation/handlers/notionWebhookHandler.ts - Webhook processing
src/application/usecases/processNotionWebhookUseCase.ts - Condition matching
src/domain/services/templateMatcherService.ts - Message formatting
src/application/services/messageFormatterServiceImpl.ts
External integrations
- Notion API client
src/infrastructure/web-clients/notionApiClient.ts - Webhook sender
src/infrastructure/web-clients/httpNotificationClient.ts
Persistence and services
- Firestore repositories
src/infrastructure/persistence/firestore - Schema cache
src/infrastructure/persistence/inMemory/inMemoryCacheService.ts - Token encryption
src/infrastructure/services/nodeCryptoEncryptionService.ts
Other components
- API user
- Notion
- Chat webhook
Connections 29
- API user → HTTP application: calls API
README.md - HTTP application → Request authentication: uses middleware
src/main.ts - HTTP application → Template API: routes requests
src/main.ts - HTTP application → Destination API: routes requests
src/main.ts - HTTP application → Notion integration API: routes requests
src/main.ts - HTTP application → Database schema API: routes requests
src/main.ts - HTTP application → Notion webhook handler: routes webhook
src/main.ts - Template API → Template management: calls use cases
src/presentation/handlers/templateHandler.ts - Destination API → Destination management: calls use cases
src/presentation/handlers/destinationHandler.ts - Notion integration API → Integration management: calls use cases
src/presentation/handlers/userNotionIntegrationHandler.ts - Notion integration API → Database discovery: calls use case
src/presentation/handlers/userNotionIntegrationHandler.ts - Database schema API → Property lookup: calls use case
- Notion webhook handler → Webhook processing: dispatches to
src/main.ts - Webhook processing → Condition matching: matches templates
src/application/usecases/processNotionWebhookUseCase.ts - Webhook processing → Message formatting: formats messages
src/application/usecases/processNotionWebhookUseCase.ts - Webhook processing → Notion API client: fetches schema
src/application/usecases/processNotionWebhookUseCase.ts - Webhook processing → Webhook sender: sends notifications
src/application/usecases/processNotionWebhookUseCase.ts - Webhook processing → Firestore repositories: loads records
- Webhook processing → Token encryption: decrypts token
src/application/usecases/processNotionWebhookUseCase.ts - Template management → Firestore repositories: stores templates
- Destination management → Firestore repositories: stores destinations
- Integration management → Firestore repositories: stores integrations
- Integration management → Token encryption: protects tokens
- Database discovery → Notion API client: queries databases
- Property lookup → Notion API client: queries properties
- Property lookup → Schema cache: uses cache
- Notion API client → Notion: calls API
- Webhook sender → Chat webhook: posts message
- Request authentication → API user: verifies identity