TaskFlow is a comprehensive task management application that integrates with Slack and Google Calendar to automatically detect, manage, and schedule tasks. The system uses AI-powered task detection through OpenAI to analyze Slack messages and create actionable tasks with intelligent scheduling capabilities.
- Framework: React with TypeScript
- Build Tool: Vite for development and production builds
- Styling: Tailwind CSS with shadcn/ui component library
- State Management: TanStack Query (React Query) for server state
- Routing: Wouter for lightweight client-side routing
- UI Components: Radix UI primitives with custom styling
- Runtime: Node.js with TypeScript
- Framework: Express.js for HTTP server
- Database ORM: Drizzle ORM for type-safe database operations
- Authentication: Session-based auth with express-session
- Real-time Communication: WebSocket server for live task updates
- API Integrations: Slack Web API, Google Calendar API, OpenAI API
- Primary Database: PostgreSQL with Drizzle ORM
- Connection: Node Postgres with connection pooling
- Migrations: Drizzle Kit for database schema management
- Session Storage: PostgreSQL-backed session store using connect-pg-simple
- Task Detection Service: Uses OpenAI to analyze Slack messages for task content
- Scheduler Service: Automatically schedules tasks in Google Calendar based on availability
- Slack Integration: Webhook-based event handling for real-time message processing
- Calendar Service: Manages Google Calendar events and synchronization
- Notification System: Real-time notifications via WebSocket and Slack messages
- HMAC-SHA256 signature verification for Slack webhooks
- Rate limiting for API endpoints (100 req/15min general, 60 req/min webhooks)
- Secure session configuration with httpOnly cookies
- Environment variable validation and secure defaults
- Security headers (HSTS, X-Frame-Options, etc.)
- Task Detection: Analyzes message content, urgency, importance, and deadlines
- Smart Scheduling: Finds optimal time slots based on calendar availability
- Conflict Resolution: Handles scheduling conflicts with user interaction
- Slack message received via webhook
- Message analyzed by OpenAI for task content
- If task detected, user receives confirmation prompt
- Upon confirmation, task created in database
- Scheduler automatically finds available time slot
- Calendar event created in Google Calendar
- Real-time updates sent via WebSocket
- Session-based authentication with 24-hour expiration
- Google OAuth2 for calendar integration
- Slack OAuth2 for workspace integration
- Multi-workspace support with workspace-specific configurations
- Real-time webhook processing for Slack events
- Periodic calendar synchronization for availability checking
- WebSocket notifications for immediate UI updates
- Automatic retry mechanisms for failed operations
- Slack API: Bot token and signing secret for webhook verification
- Google Calendar API: OAuth2 credentials for calendar access
- OpenAI API: GPT-4 for intelligent task detection and analysis
- PostgreSQL: Database for persistent storage
DATABASE_URL: PostgreSQL connection stringSLACK_BOT_TOKEN: Slack bot token (xoxb-)SLACK_SIGNING_SECRET: For webhook signature verificationGOOGLE_CLIENT_ID&GOOGLE_CLIENT_SECRET: OAuth2 credentialsOPENAI_API_KEY: OpenAI API accessSESSION_SECRET: Session encryption key (required in production)BASE_URL: Application base URL for OAuth redirects
- Uses Replit's Node.js environment with PostgreSQL module
- Hot reload with Vite for frontend development
- Express server with TypeScript compilation via tsx
- Automatic dependency management with npm
- Frontend: Vite build to
dist/public - Backend: esbuild bundle to
dist/index.js - Database: Drizzle migrations applied before startup
- Environment validation on application start
- Replit autoscale deployment target
- WebSocket connection management with heartbeat
- Rate limiting to prevent abuse
- Session cleanup for memory management
- June 26, 2025: Comprehensive code review and critical improvements implemented
- Added structured logging system with winston-like functionality
- Fixed memory leak by replacing file-based message tracking with database storage
- Added processed messages table with automatic cleanup
- Implemented centralized configuration management
- Created comprehensive README.md and CODE_REVIEW.md documentation
- Added database transaction support preparation
- Enhanced error handling and monitoring capabilities
- June 26, 2025. Initial setup
- June 26, 2025. Code review and database improvements
Preferred communication style: Simple, everyday language.