How nhemnt/slackify-api works
Based on your file tree and README, Slackify API is clearly a backend web application built using the NestJS framework. It integrates with Prisma for ORM (using a Supabase DB under the hood), and interacts with external systems such as Slack’s API via webhooks. The application is modular, featuring several feature-specific modules (like check-in-out, problems, trends), as well as a cron module that likely handles scheduled tasks (e.g., daily and weekly notifications).
Main Components
• API Server (NestJS Application): This is the central component where the application’s entry point (main.ts) initializes the system.
• Cron Module: Represent the cron service separately as it handles scheduled tasks that might trigger the Slack notifications and other scheduled features.
• External Services: Include a node for the Slack API, which is used to send messages to Slack channels via webhooks (you have environment variables like WEBHOOK_URI and WEBHOOK_URI_PUNCH_IN_OUT).
• Utilities & Middleware: Consider representing shared utilities (like the logger middleware and other helper functions under src/lib) as common/shared components.
Relationships and Data Flow
• Each module (check-in-out, problems, trends, etc.) receives incoming HTTP requests (as documented by the Swagger UI available at /docs) and sends/receives data to/from the Database.
• The Prisma Service bridges the NestJS backend and the Supabase DB.
• The cron module periodically triggers tasks that may involve fetching data from the database or preparing messages.
Architectural Patterns and Design Principles
• Scheduled Tasks: Emphasize the use of a dedicated Cron module to handle scheduled operations.
• External Integrations: Clearly indicate external integrations such as the Slack API and Supabase DB, ensuring to denote the dependency relationships.
• Configuration & Environment: Although not a runtime component, note that environment configuration (e.g., .env file) controls how external services and secrets (like the Bot User OAuth Access Token) are handled.