Skip to content

Repository files navigation

Odoo SaaS Platform

πŸš€ Complete Production-Ready Multi-Tenant Odoo SaaS Platform with automated instance management, comprehensive admin dashboard, advanced billing system, enterprise security, and one-click deployment.

License: MIT Docker FastAPI React Security

🌟 Enterprise Features

πŸŽ›οΈ Advanced Admin Dashboard

  • Real-time Platform Statistics with interactive charts and metrics
  • Complete User Management with roles, permissions, and audit trails
  • Comprehensive Tenant Administration with resource tracking and limits
  • Odoo Instance Lifecycle Management (create, start, stop, restart, backup)
  • Advanced Billing Management with Stripe integration and analytics
  • Security Monitoring with threat detection and vulnerability scanning
  • Automated Backup Management with S3 integration and scheduling
  • System Health Monitoring with CPU, memory, and disk usage tracking

πŸ‘₯ Modern User Frontend

  • Self-service Tenant Registration with email verification
  • Subscription Management with multiple plans and payment methods
  • Odoo Instance Access with single sign-on integration
  • Billing Dashboard with invoices, usage tracking, and payment history
  • Resource Monitoring with real-time usage statistics
  • Support System with ticket management and knowledge base

πŸ”§ Enterprise Backend Services

  • FastAPI-based REST API with async support and comprehensive endpoints
  • Multi-tenant Architecture with complete data isolation and security
  • Automated Odoo Deployment using Docker containers with version management
  • Advanced Billing Integration with Stripe webhooks and subscription management
  • Comprehensive Security System with threat detection and vulnerability scanning
  • Enterprise Monitoring with Prometheus metrics and health checks
  • Automated Backup System with database and file backups, S3 integration
  • Audit Logging with compliance reporting and security tracking

🐳 Advanced Odoo Integration

  • Automated Instance Provisioning with dedicated databases per tenant
  • Docker-based Deployment with resource limits and monitoring
  • Complete Database Isolation with backup and restore capabilities
  • Subdomain Routing (tenant1.yourdomain.com) with SSL certificates
  • Resource Management with CPU, memory, and storage quotas
  • Version Management with automated updates and rollback capabilities

πŸ”’ Enterprise Security

  • SSL/HTTPS with automated Let's Encrypt certificate management
  • Advanced Security Headers (HSTS, CSP, X-Frame-Options, etc.)
  • Rate Limiting and DDoS protection with configurable thresholds
  • Vulnerability Scanning with automated security assessments
  • Threat Detection with brute force protection and IP analysis
  • Compliance Monitoring with security scoring and reporting
  • Audit Trail with comprehensive activity logging

πŸ’Ύ Enterprise Backup & Recovery

  • Automated Backups with configurable schedules and retention
  • S3 Integration for offsite backup storage with encryption
  • Point-in-time Recovery with database and file restoration
  • Disaster Recovery procedures with automated failover
  • Backup Monitoring with health checks and alerting

πŸ—οΈ Production Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    NGINX REVERSE PROXY                      β”‚
β”‚         SSL/TLS Termination & Security Headers             β”‚
β”‚    host.yourdomain.com | api.yourdomain.com | admin.yourdomain.com
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚             β”‚             β”‚
        β–Ό             β–Ό             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   ADMIN     β”‚ β”‚  FRONTEND   β”‚ β”‚   BACKEND   β”‚
β”‚ DASHBOARD   β”‚ β”‚   (React)   β”‚ β”‚  (FastAPI)  β”‚
β”‚  (React)    β”‚ β”‚             β”‚ β”‚   + API     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”
                              β”‚       β”‚       β”‚
                              β–Ό       β–Ό       β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚POSTGRES β”‚ β”‚REDISβ”‚ β”‚MONITORINGβ”‚
                        β”‚ Master  β”‚ β”‚Cacheβ”‚ β”‚Prometheusβ”‚
                        β”‚   DB    β”‚ β”‚     β”‚ β”‚ Grafana β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚         β”‚         β”‚
                    β–Ό         β–Ό         β–Ό
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   TENANT 1  β”‚ β”‚   TENANT 2  β”‚ β”‚   TENANT N  β”‚
            β”‚             β”‚ β”‚             β”‚ β”‚             β”‚
            β”‚ Odoo:8069   β”‚ β”‚ Odoo:8070   β”‚ β”‚ Odoo:807X   β”‚
            β”‚ DB: tenant1 β”‚ β”‚ DB: tenant2 β”‚ β”‚ DB: tenantN β”‚
            β”‚ SSL Enabled β”‚ β”‚ SSL Enabled β”‚ β”‚ SSL Enabled β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ One-Click Production Deployment

Prerequisites

  • Ubuntu 22.04+ or similar Linux distribution
  • 4GB+ RAM, 2+ CPU cores, 50GB+ storage
  • Docker and Docker Compose
  • Domain name with DNS configured
  • Email account for notifications (optional)
  • Stripe account for billing (optional)

Quick Start

# 1. Clone the repository
git clone https://github.com/mah007/Odoo_saas_platform.git
cd Odoo_saas_platform

# 2. Configure environment variables
cp .env.example .env
nano .env  # Configure your settings

# 3. Run the deployment script
chmod +x deploy.sh
./deploy.sh

# 4. Setup SSL certificates (production)
sudo ./scripts/setup-ssl.sh yourdomain.com api.yourdomain.com admin.yourdomain.com

The deployment script automatically:

  • βœ… Installs all dependencies and Docker
  • βœ… Configures firewall and security settings
  • βœ… Generates secure passwords and keys
  • βœ… Builds and starts all services
  • βœ… Initializes database with migrations
  • βœ… Creates admin user and sample data
  • βœ… Sets up monitoring and logging
  • βœ… Configures backup schedules

Access Your Platform

After deployment completes:

  • Frontend: https://yourdomain.com
  • Admin Dashboard: https://admin.yourdomain.com
  • API Documentation: https://api.yourdomain.com/docs
  • Monitoring: Built-in dashboard at /monitoring

πŸ“Š Comprehensive API Endpoints

Authentication & User Management

  • POST /api/v1/auth/register - User registration with email verification
  • POST /api/v1/auth/login - User authentication with JWT tokens
  • POST /api/v1/auth/refresh - Token refresh and renewal
  • POST /api/v1/auth/forgot-password - Password reset functionality
  • POST /api/v1/auth/verify-email - Email verification

Admin Management

  • GET /api/v1/admin/stats - Real-time platform statistics
  • GET /api/v1/admin/users - User management with filtering
  • GET /api/v1/admin/tenants - Tenant administration
  • GET /api/v1/admin/instances - Instance management
  • GET /api/v1/admin/billing - Billing overview and analytics

Tenant Operations

  • POST /api/v1/tenants - Create new tenant with validation
  • GET /api/v1/tenants/{id} - Get tenant details and statistics
  • PUT /api/v1/tenants/{id} - Update tenant configuration
  • DELETE /api/v1/tenants/{id} - Delete tenant and cleanup

Odoo Instance Management

  • POST /api/v1/odoo/instances - Create new Odoo instance
  • POST /api/v1/odoo/instances/{id}/start - Start instance
  • POST /api/v1/odoo/instances/{id}/stop - Stop instance
  • POST /api/v1/odoo/instances/{id}/restart - Restart instance
  • POST /api/v1/odoo/instances/{id}/backup - Create instance backup
  • GET /api/v1/odoo/instances/{id}/stats - Instance statistics

Advanced Billing System

  • GET /api/v1/billing/plans - Available subscription plans
  • POST /api/v1/billing/subscribe - Create subscription with Stripe
  • GET /api/v1/billing/invoices - Invoice history and downloads
  • POST /api/v1/billing/payment-methods - Manage payment methods
  • GET /api/v1/billing/usage - Usage tracking and analytics

Security & Monitoring

  • GET /api/v1/security/metrics - Security metrics and scoring
  • GET /api/v1/security/scan - Vulnerability scanning
  • GET /api/v1/security/threats - Active threat monitoring
  • GET /api/v1/monitoring/health - System health checks
  • GET /api/v1/monitoring/metrics - Prometheus metrics

Backup & Recovery

  • POST /api/v1/backup/create - Create manual backup
  • GET /api/v1/backup/list - List all backups with filtering
  • POST /api/v1/backup/restore - Restore from backup
  • DELETE /api/v1/backup/cleanup - Cleanup old backups

πŸ” Enterprise Security Features

SSL/HTTPS & Encryption

  • Automated Let's Encrypt certificate management with renewal
  • TLS 1.2/1.3 with modern cipher suites
  • HSTS (HTTP Strict Transport Security) enforcement
  • Perfect Forward Secrecy with ECDHE key exchange

Security Headers & Protection

  • Content Security Policy (CSP) with strict rules
  • X-Frame-Options to prevent clickjacking
  • X-Content-Type-Options to prevent MIME sniffing
  • Referrer-Policy for privacy protection
  • Permissions-Policy for feature control

Advanced Threat Protection

  • Rate Limiting with configurable thresholds per endpoint
  • Brute Force Detection with automatic IP blocking
  • DDoS Protection with connection limits
  • Vulnerability Scanning with automated assessments
  • Threat Intelligence with IP reputation checking

Compliance & Auditing

  • Comprehensive Audit Logging with tamper protection
  • Security Compliance scoring and reporting
  • Data Encryption at rest and in transit
  • Access Control with role-based permissions
  • Privacy Controls with data retention policies

πŸ“ˆ Enterprise Monitoring & Analytics

Real-time Monitoring

  • System Health with CPU, memory, disk, and network monitoring
  • Application Performance with response time tracking
  • Database Performance with query optimization insights
  • Container Health with Docker metrics and alerts

Business Analytics

  • Revenue Analytics with subscription and usage tracking
  • User Analytics with engagement and retention metrics
  • Tenant Analytics with resource usage and growth
  • Performance Analytics with optimization recommendations

Alerting & Notifications

  • Prometheus Integration with custom metrics
  • Grafana Dashboards with real-time visualizations
  • Email Alerts for critical system events
  • Webhook Notifications for external integrations

πŸ› οΈ Development & Customization

Local Development Setup

# Backend development
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Frontend development
cd frontend
npm install
npm start

# Admin dashboard development
cd admin-dashboard
npm install
npm start

Testing & Quality Assurance

# Backend tests with coverage
cd backend
pytest --cov=app tests/

# Frontend tests
cd frontend
npm test -- --coverage

# Integration tests
docker-compose -f docker-compose.test.yml up --abort-on-container-exit

# Security tests
npm audit
safety check
bandit -r backend/

πŸ“¦ Production Deployment Options

Docker Compose (Recommended)

# Production deployment
docker-compose -f docker-compose.prod.yml up -d

# Scaling services
docker-compose up --scale backend=3 --scale frontend=2

Kubernetes Deployment

# Apply Kubernetes manifests
kubectl apply -f k8s/

# Scale deployments
kubectl scale deployment backend --replicas=3

Cloud Provider Integration

  • AWS: ECS, EKS, RDS, S3, CloudFront
  • Google Cloud: GKE, Cloud SQL, Cloud Storage
  • Azure: AKS, Azure Database, Blob Storage

πŸ”§ Configuration & Customization

Environment Variables

# Core Configuration
SECRET_KEY=your-super-secret-key-here
DATABASE_URL=postgresql://user:pass@localhost/dbname
REDIS_URL=redis://localhost:6379/0

# Domain Configuration
DOMAIN=yourdomain.com
ALLOWED_ORIGINS=https://yourdomain.com,https://admin.yourdomain.com

# Security Configuration
JWT_SECRET_KEY=your-jwt-secret-key
JWT_ALGORITHM=HS256
JWT_EXPIRE_MINUTES=30

# Billing Configuration (Stripe)
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...

# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password

# Backup Configuration (AWS S3)
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
S3_BACKUP_BUCKET=your-backup-bucket
S3_REGION=us-east-1

# Monitoring Configuration
PROMETHEUS_ENABLED=true
GRAFANA_ENABLED=true
ALERT_EMAIL=admin@yourdomain.com

πŸ“š Comprehensive Documentation

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support & Community

🎯 Roadmap

Short Term (Q1 2024)

  • Mobile Application for tenant management
  • Advanced Analytics with custom dashboards
  • Multi-language Support for international deployment
  • Advanced Backup Strategies with incremental backups

Medium Term (Q2-Q3 2024)

  • Kubernetes Helm Charts for cloud-native deployment
  • Multi-region Support with data replication
  • Advanced Billing Features with usage-based pricing
  • Marketplace Integration for Odoo addons

Long Term (Q4 2024+)

  • AI-powered Analytics with predictive insights
  • Advanced Security Features with zero-trust architecture
  • Enterprise SSO Integration with SAML/OAuth
  • Advanced Compliance with SOC2, GDPR, HIPAA

⭐ Star this repository if you find it useful!

Built with ❀️ for the Odoo community by enterprise developers

About

Complete multi-tenant Odoo SaaS Platform with admin dashboard, billing, and automated instance management

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages