Skip to content

mah007/odoo-saas-kit

Repository files navigation

Odoo SaaS Platform - Production Ready

A modern, secure, and scalable multi-tenant Odoo SaaS platform built with microservices architecture.

🚀 Features

  • Modern Architecture: Microservices with FastAPI backend and React frontend
  • Security First: JWT authentication, 2FA, rate limiting, input validation
  • High Performance: Redis caching, connection pooling, optimized queries
  • Scalable: Kubernetes-ready with horizontal pod autoscaling
  • Production Ready: Comprehensive testing, monitoring, and CI/CD

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   React SPA     │    │   API Gateway   │    │   Auth Service  │
│   (Frontend)    │◄──►│   (FastAPI)     │◄──►│   (JWT + 2FA)   │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                │
                ┌───────────────┼───────────────┐
                │               │               │
        ┌───────▼──────┐ ┌──────▼──────┐ ┌─────▼──────┐
        │   Tenant     │ │   Billing   │ │   Backup   │
        │   Service    │ │   Service   │ │   Service  │
        └──────────────┘ └─────────────┘ └────────────┘
                │               │               │
        ┌───────▼──────┐ ┌──────▼──────┐ ┌─────▼──────┐
        │  PostgreSQL  │ │   Redis     │ │     S3     │
        │  (Primary)   │ │ (Cache/Jobs)│ │ (Backups)  │
        └──────────────┘ └─────────────┘ └────────────┘

🛠️ Technology Stack

Backend

  • FastAPI: High-performance Python web framework
  • PostgreSQL: Primary database with connection pooling
  • Redis: Caching and background job queue
  • Celery: Distributed task queue
  • SQLAlchemy: ORM with Alembic migrations
  • Pydantic: Data validation and serialization

Frontend

  • React 18: Modern UI library with hooks
  • TypeScript: Type-safe JavaScript
  • Material-UI: Professional component library
  • React Query: Data fetching and caching
  • Socket.IO: Real-time communication

Infrastructure

  • Docker: Containerization
  • Kubernetes: Container orchestration
  • Nginx: Reverse proxy and load balancer
  • Prometheus: Monitoring and metrics
  • Grafana: Visualization and dashboards

🚀 Quick Start

Development Setup

# Clone the repository
git clone <repository-url>
cd odoo-saas-platform

# Start with Docker Compose
docker-compose up -d

# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docs

Production Deployment

# Deploy to Kubernetes
kubectl apply -f infrastructure/kubernetes/

# Or use Helm
helm install odoo-saas ./infrastructure/helm/

📁 Project Structure

odoo-saas-platform/
├── backend/                 # FastAPI backend service
│   ├── app/
│   │   ├── api/            # API routes and endpoints
│   │   ├── core/           # Core configuration and security
│   │   ├── models/         # Database models
│   │   ├── services/       # Business logic services
│   │   └── utils/          # Utility functions
│   ├── tests/              # Backend tests
│   └── migrations/         # Database migrations
├── frontend/               # React frontend application
│   ├── src/
│   │   ├── components/     # Reusable UI components
│   │   ├── pages/          # Page components
│   │   ├── services/       # API services
│   │   ├── utils/          # Utility functions
│   │   └── types/          # TypeScript type definitions
│   └── public/             # Static assets
├── infrastructure/         # Deployment and infrastructure
│   ├── docker/             # Docker configurations
│   ├── kubernetes/         # Kubernetes manifests
│   └── terraform/          # Infrastructure as code
├── docs/                   # Documentation
└── scripts/                # Utility scripts

🔒 Security Features

  • Authentication: JWT tokens with refresh mechanism
  • Authorization: Role-based access control (RBAC)
  • Two-Factor Authentication: TOTP support
  • Rate Limiting: Per-endpoint and per-user limits
  • Input Validation: Comprehensive Pydantic validation
  • Security Headers: CORS, CSP, and security headers
  • Audit Logging: Complete audit trail
  • Encryption: Data encryption at rest and in transit

📊 Performance Features

  • Caching: Multi-level Redis caching
  • Connection Pooling: Optimized database connections
  • Background Jobs: Async processing with Celery
  • Query Optimization: Indexed queries and materialized views
  • CDN Support: Static asset optimization
  • Compression: Response compression and minification

🔧 Configuration

All configuration is managed through environment variables:

# Database
DATABASE_URL=postgresql://user:pass@localhost/db
REDIS_URL=redis://localhost:6379

# Security
SECRET_KEY=your-secret-key
JWT_SECRET_KEY=your-jwt-secret

# External Services
AWS_ACCESS_KEY_ID=your-aws-key
STRIPE_SECRET_KEY=your-stripe-key

📈 Monitoring

  • Health Checks: Kubernetes-ready health endpoints
  • Metrics: Prometheus metrics collection
  • Logging: Structured JSON logging
  • Tracing: Distributed tracing support
  • Alerts: Configurable alerting rules

🧪 Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

# Integration tests
docker-compose -f docker-compose.test.yml up

📚 Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

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

🆘 Support

About

Odoo SAAS multi Tenant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors