Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HomeServe Pro

Enterprise-grade service booking and vendor management platform

HomeServe Pro is a comprehensive multi-role service booking platform that connects customers with verified vendors through a secure, scalable, and auditable system. Built with modern web technologies, the platform features real-time communication, automated workflows, and enterprise-level security controls.

Table of Contents

Overview

HomeServe Pro delivers a production-ready platform for organizations requiring secure, auditable service booking operations. The system supports five distinct user roles with granular permissions, automated vendor onboarding, integrated payment processing, and comprehensive audit trails.

Target Use Cases:

  • Enterprise home service management
  • Multi-vendor coordination platforms
  • On-demand service marketplaces
  • Facility management operations

System Architecture

architecture-beta
    group frontend(cloud)[Client Layer]
    service webapp(server)[React SPA] in frontend
    
    group backend(cloud)[Application Layer]
    service api(server)[Django REST API] in backend
    service websocket(server)[WebSocket Server] in backend
    service celery(server)[Task Queue] in backend
    
    group storage(cloud)[Data Layer]
    service db(database)[Database] in storage
    service cache(disk)[Redis Cache] in storage
    
    group external(cloud)[External Services]
    service stripe(internet)[Stripe API] in external
    service docusign(internet)[DocuSign API] in external
    service twilio(internet)[Twilio SMS] in external
    
    webapp:R --> L:api
    webapp:R --> L:websocket
    api:B --> T:db
    api:B --> T:cache
    websocket:B --> T:cache
    celery:L --> R:api
    celery:T --> B:cache
    api:R --> L:stripe
    api:R --> L:docusign
    api:R --> L:twilio
Loading

The architecture follows a modern microservices-inspired approach with clear separation of concerns. The frontend communicates with the backend through RESTful APIs and WebSocket connections for real-time updates. Background tasks are processed asynchronously through Celery, while Redis provides caching and message brokering capabilities.

Key Features

Authentication & Authorization

  • JWT-based authentication with access and refresh tokens
  • Multi-factor authentication via SMS OTP
  • Role-based access control (RBAC) for five user types
  • Session management and token invalidation

Service Booking Management

  • End-to-end booking lifecycle management
  • Dynamic pricing algorithms based on demand and service complexity
  • Real-time vendor availability tracking
  • Automated booking assignment and optimization

Payment Processing

  • Stripe integration for secure payment handling
  • Support for multiple payment methods
  • Automated refund processing
  • Transaction audit trails

Digital Signatures

  • SHA-256 cryptographic signature verification
  • DocuSign integration for legal compliance
  • Tamper-proof document management
  • Audit logging for signature events

Real-time Communication

  • WebSocket-based live notifications
  • Chat functionality between customers and vendors
  • Status update broadcasting
  • Admin monitoring dashboards

Vendor Management

  • Automated onboarding workflow
  • Background verification integration
  • Performance analytics and ratings
  • Bonus calculation system

Booking Workflow

sequenceDiagram
    actor Customer
    participant Frontend
    participant API
    participant TaskQueue
    participant Database
    participant Stripe
    participant Vendor
    
    Customer->>Frontend: Request service booking
    Frontend->>API: POST /api/bookings
    activate API
    API->>Database: Validate customer & service
    Database-->>API: Validation result
    API->>Database: Create booking record
    API->>TaskQueue: Queue vendor assignment task
    API-->>Frontend: Booking created (pending)
    deactivate API
    Frontend-->>Customer: Confirmation with booking ID
    
    activate TaskQueue
    TaskQueue->>Database: Find available vendors
    Database-->>TaskQueue: Vendor list
    TaskQueue->>Database: Assign optimal vendor
    TaskQueue->>API: Trigger notification
    deactivate TaskQueue
    API->>Vendor: Send booking notification
    
    Vendor->>Frontend: Accept booking
    Frontend->>API: PUT /api/bookings/{id}/accept
    API->>Database: Update booking status
    API->>Customer: Send acceptance notification
    
    Note over Customer,Vendor: Service completion
    
    Vendor->>Frontend: Mark service complete
    Frontend->>API: POST /api/bookings/{id}/complete
    API->>Stripe: Process payment
    Stripe-->>API: Payment confirmation
    API->>Database: Update booking & payment status
    API-->>Frontend: Completion confirmed
    Frontend-->>Customer: Service completed notification
Loading

The booking workflow demonstrates the platform's asynchronous architecture, where customer requests are immediately acknowledged while complex operations like vendor assignment and payment processing occur in the background through task queues.

Technology Stack

Backend

  • Python 3.10+
  • Django 4.x
  • Django REST Framework
  • Django Channels (WebSocket support)
  • Celery (distributed task queue)
  • Redis (caching and message broker)

Frontend

  • React 18
  • TypeScript
  • Vite (build tool)
  • Tailwind CSS
  • React Router
  • Axios

Database

  • SQLite (development)
  • PostgreSQL (production recommended)

External Integrations

  • Stripe API (payment processing)
  • DocuSign API (digital signatures)
  • Twilio API (SMS notifications)

Development Tools

  • ESLint & Prettier
  • Git hooks for code quality
  • Comprehensive test suites

Getting Started

Prerequisites

Before beginning development, ensure the following dependencies are installed:

  • Python 3.10 or higher
  • Node.js 16+ with npm or yarn
  • Redis server (version 6.0+)
  • Git version control system

External Service Accounts:

  • Stripe account with test API keys
  • Twilio account for SMS functionality (optional)
  • DocuSign developer account (optional)

Backend Setup

Step 1: Environment Setup

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Step 2: Install Dependencies

pip install -r requirements.txt

Step 3: Environment Configuration

Create a .env file in the project root:

SECRET_KEY=your-django-secret-key-here
DEBUG=True
DATABASE_URL=sqlite:///db.sqlite3
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
REDIS_URL=redis://localhost:6379/1
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_PHONE_NUMBER=+1234567890

Step 4: Database Initialization

python manage.py migrate
python manage.py createsuperuser

Step 5: Sample Data (Optional)

python datacreate/create_sample_data.py

Step 6: Start Services

Terminal 1 - Django Server:

python manage.py runserver

Terminal 2 - WebSocket Server:

uvicorn homeserve_pro.asgi:application --host 0.0.0.0 --port 8000 --reload

Terminal 3 - Celery Worker:

celery -A homeserve_pro worker -l info

Terminal 4 - Redis Server:

redis-server

Access Points:

Frontend Setup

Step 1: Install Dependencies

cd src
npm install

Step 2: Start Development Server

npm run dev

The React application will be available at http://localhost:5173/

Build for Production:

npm run build

Configuration

Environment Variables

All sensitive configuration should be managed through environment variables. Reference the .env.example file for complete configuration options.

Critical Configuration Items:

  • SECRET_KEY: Django cryptographic signing key (generate using django-admin's get_random_secret_key)
  • DATABASE_URL: Database connection string (use PostgreSQL in production)
  • ALLOWED_HOSTS: Comma-separated list of allowed hostnames
  • CORS_ALLOWED_ORIGINS: Permitted frontend origins for CORS
  • REDIS_URL: Redis connection string for caching and task queue

Production Configuration

For production deployments:

  1. Set DEBUG=False
  2. Use PostgreSQL: DATABASE_URL=postgresql://user:password@host:port/dbname
  3. Configure proper ALLOWED_HOSTS and CORS_ALLOWED_ORIGINS
  4. Enable HTTPS and configure SSL certificates
  5. Use environment-based secrets management (AWS Secrets Manager, Azure Key Vault)
  6. Configure Stripe webhook endpoints with production keys
  7. Set up proper logging and monitoring

Testing

Backend Tests

Run the complete Django test suite:

python manage.py test

Run specific test modules:

python manage.py test core.tests.TestBookingFlow

Run integration tests:

python test/test_complete_customer_journey.py

Frontend Tests

cd src
npm run test

Test Coverage

Generate coverage reports:

coverage run --source='.' manage.py test
coverage report
coverage html  # Generates HTML report

Deployment

Production Deployment Checklist

Infrastructure Requirements:

  • Application server (Gunicorn/uWSGI with Nginx reverse proxy)
  • ASGI server for WebSocket support (Uvicorn/Daphne)
  • PostgreSQL database (version 12+)
  • Redis instance (version 6.0+)
  • SSL/TLS certificates
  • Process manager (systemd, supervisord, or Docker)

Deployment Steps:

  1. Application Server Configuration
gunicorn homeserve_pro.wsgi:application --bind 0.0.0.0:8000 --workers 4
  1. WebSocket Server Configuration
uvicorn homeserve_pro.asgi:application --host 0.0.0.0 --port 8001 --workers 2
  1. Celery Worker Configuration
celery -A homeserve_pro worker --concurrency=4 --loglevel=info
  1. Static Files Collection
python manage.py collectstatic --noinput
  1. Database Migration
python manage.py migrate --noinput

Docker Deployment

A Dockerfile and docker-compose.yml can be added for containerized deployments. Recommended architecture:

  • Backend container (Django + Celery)
  • Frontend container (Nginx serving static React build)
  • Database container (PostgreSQL)
  • Cache container (Redis)

Scaling Considerations

  • Use load balancers for horizontal scaling of application servers
  • Implement database read replicas for read-heavy workloads
  • Configure Redis clustering for high-availability caching
  • Use CDN for static asset delivery
  • Implement connection pooling for database connections

Project Structure

homeserve_pro/
├── core/                       # Core Django application
│   ├── models.py              # Database models
│   ├── views.py               # API views
│   ├── serializers.py         # DRF serializers
│   ├── services/              # Business logic layer
│   ├── consumers.py           # WebSocket consumers
│   └── tasks.py               # Celery tasks
├── homeserve_pro/             # Django project configuration
│   ├── settings.py            # Application settings
│   ├── urls.py                # URL routing
│   ├── asgi.py                # ASGI configuration
│   └── wsgi.py                # WSGI configuration
├── src/                       # React frontend
│   ├── components/            # Reusable UI components
│   ├── pages/                 # Page components
│   ├── services/              # API service layer
│   ├── context/               # React context providers
│   └── hooks/                 # Custom React hooks
├── datacreate/                # Database seeding scripts
├── test/                      # Test suites
├── requirements.txt           # Python dependencies
└── package.json               # Node.js dependencies

Contributing

We welcome contributions from the community. Please follow these guidelines:

Development Workflow:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit changes with descriptive messages
  4. Write or update tests for new functionality
  5. Ensure all tests pass: python manage.py test
  6. Push to your fork: git push origin feature/your-feature-name
  7. Submit a pull request with a comprehensive description

Code Standards:

  • Follow PEP 8 for Python code
  • Use TypeScript strict mode for frontend code
  • Write docstrings for all public functions and classes
  • Maintain test coverage above 80%
  • Use meaningful variable and function names

Pull Request Requirements:

  • Descriptive title and detailed description
  • Reference related issues
  • Include test coverage for new features
  • Update documentation as needed
  • Pass all CI/CD checks

Team

Developed by Serverless Squad.

Team Members:

License

This project's licensing terms are not specified. Please contact the project maintainers for licensing information before using this code in production environments.

Support and Contact

For technical support, bug reports, or feature requests:

  • Open an issue in the GitHub repository
  • Contact the development team through the issue tracker
  • Review existing documentation in the Implementation plan/ directory

For detailed API documentation, refer to:

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages