A complete, production-ready appointment management system with AI-powered optimization, WhatsApp integration, and automated background jobs.
- Natural language processing - Understands "book haircut", "show appointments", etc.
- Smart session management - Handles interrupted conversations gracefully
- Professional message templates - Consistent, branded communication
- Multi-step booking flows - Service selection, time preferences, confirmation
- Complete booking system - Service selection, time slots, confirmation
- Reschedule functionality - Change existing appointments
- Cancellation system - Cancel with gap-fill optimization
- Appointment viewing - Client can see all their bookings
- Intent-based scheduling - Max Profit, Balanced, Free Time modes
- Gap-fill automation - Automatically fills cancelled slots
- Waitlist management - Priority-based notifications
- Smart suggestions - Mode-specific optimization recommendations
- Appointment reminders - 24h, 2h, 30min before
- Waitlist notifications - Instant alerts when slots open
- Daily reports - Owner performance summaries
- Redis Queue integration - Scalable background processing
- Owner dashboard - Multi-date view, AI suggestions, waitlist management
- Client booking interface - Easy online booking
- WhatsApp test interface - Local testing without Twilio limits
- Message capture system - See actual bot responses
git clone <your-repo-url>
cd BestAppointmentManager
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt# Copy the example environment file
cp env.example .env
# Edit .env with your actual values
nano .env# Start PostgreSQL and Redis with Docker
docker-compose up -d
# Run database migrations
alembic upgrade head
# Add test data
python add_test_data.py# Terminal 1: Start the main application
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2: Start the background worker
python worker.py- π Web Interface: http://localhost:8000
- π± WhatsApp Test: http://localhost:8000/messages
- π¨βπΌ Owner Dashboard: http://localhost:8000/owner/dashboard
python test_complete_system.py# Test background jobs
python test_background_jobs.py
# Test natural language processing
python test_natural_language.py
# Test individual components
python -m pytest tests/βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β WhatsApp β β Web Interface β β Background β
β Interface β β (FastAPI) β β Jobs (RQ) β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
β Business Logic β
β β’ Scheduler β
β β’ Optimizer β
β β’ Waitlist Manager β
β β’ Policy Enforcer β
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
β Data Layer β
β β’ PostgreSQL β
β β’ Redis (Sessions) β
β β’ SQLAlchemy ORM β
βββββββββββββββββββββββββββββ
DATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringTWILIO_ACCOUNT_SID- Twilio account SIDTWILIO_AUTH_TOKEN- Twilio auth tokenTWILIO_WHATSAPP_FROM- WhatsApp sender numberTIMEZONE_DEFAULT- Default timezoneDEBUG- Debug mode (True/False)
- Intent Modes: Max Profit, Balanced, Free Time
- Service Configuration: Duration, price, buffer time
- Business Hours: Start/end times, quiet hours
- Policies: Cancellation, rescheduling rules
- Messages are captured and displayed in web interface
- No actual WhatsApp messages sent
- Perfect for development and testing
- Configure Twilio credentials in
.env - Real WhatsApp messages sent to clients
- Webhook endpoint:
/webhooks/whatsapp
- π View daily schedules with AI optimization suggestions
- π Manage waitlists with priority-based notifications
- π Get daily reports with performance metrics
- βοΈ Change intent modes (Max Profit, Balanced, Free Time)
- π Handle cancellations with automatic gap-fill
- π Book appointments via natural language
- π Reschedule existing appointments
- β Cancel appointments easily
- π View all upcoming appointments
- π± Get reminders automatically
# Build and run with Docker Compose
docker-compose -f docker-compose.prod.yml up -d- Set up PostgreSQL and Redis servers
- Configure environment variables
- Run database migrations
- Start the application and worker processes
- Set up reverse proxy (nginx)
- Configure SSL certificates
- Application logs - Structured logging with different levels
- Performance metrics - Response times, error rates
- Background job monitoring - Queue status, job failures
- Database monitoring - Connection pools, query performance
- Environment variables - Sensitive data in
.envfiles - Database security - Connection encryption, user permissions
- API security - Input validation, rate limiting
- Session management - Secure session storage in Redis
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation - Check this README and code comments
- Issues - Create GitHub issues for bugs or feature requests
- Testing - Run the test suite to verify functionality
- FastAPI - Modern web framework
- PostgreSQL - Reliable database
- Redis - Fast caching and job queue
- Twilio - WhatsApp messaging API
- SQLAlchemy - Python ORM
Built with β€οΈ for service businesses who want to automate their appointment management.