Tech Stack
Fluvius Framework is built on modern Python technologies and best practices.
Core Technologies
Python
Version: Python 3.12+
Why Python 3.12+?
- Modern type hints
- Improved async/await
- Better performance
- Pattern matching support
Features Used:
- Type hints
- Async/await
- Dataclasses
- Enums
FastAPI
Purpose: REST API framework
Why FastAPI?
- High performance
- Automatic API documentation
- Type validation with Pydantic
- Async support
Usage:
from fastapi import FastAPI
from fluvius.fastapi import FluviusFastAPI
app = FluviusFastAPI()
Pydantic
Purpose: Data validation and serialization
Why Pydantic?
- Type validation
- JSON serialization
- Data models
- Settings management
Usage:
from pydantic import BaseModel
class User(BaseModel):
name: str
email: str
SQLAlchemy / Alembic
Purpose: Database ORM and migrations
Why SQLAlchemy?
- Database abstraction
- Query builder
- Migration support
- Multiple database support
Usage:
from sqlalchemy import create_engine
from alembic import alembic
Database Technologies
PostgreSQL
Purpose: Primary relational database
Why PostgreSQL?
- ACID compliance
- JSON support
- Full-text search
- Extensions
Usage:
from fluvius.data import PostgreSQLDriver
driver = PostgreSQLDriver(connection_string)
MongoDB
Purpose: Document database support
Why MongoDB?
- Document storage
- Flexible schema
- Horizontal scaling
- JSON-like documents
Usage:
from fluvius.data import MongoDBDriver
driver = MongoDBDriver(connection_string)
SQLite
Purpose: Development and testing
Why SQLite?
- Zero configuration
- File-based
- Fast for development
- Easy testing
Usage:
from fluvius.data import SQLiteDriver
driver = SQLiteDriver(database_path)
Async Technologies
asyncio
Purpose: Async runtime
Why asyncio?
- Native Python async
- High concurrency
- Non-blocking I/O
- Event loop
aiohttp / httpx
Purpose: Async HTTP client
Why aiohttp/httpx?
- Async HTTP requests
- Connection pooling
- Timeout handling
- SSL support
Background Processing
ARQ
Purpose: Redis-based job queue
Why ARQ?
- Async job processing
- Task scheduling
- Retry logic
- Redis backend
Usage:
from fluvius.worker import Worker, task
@task
async def process_payment(payment_id: str):
# Background processing
pass
Redis
Purpose: Job queue backend
Why Redis?
- Fast in-memory store
- Pub/sub support
- Job queue
- Caching
Authorization
Casbin
Purpose: Policy-based access control
Why Casbin?
- RBAC support
- ABAC support
- Policy engine
- Multiple backends
Usage:
from fluvius.casbin import CasbinEnforcer
enforcer = CasbinEnforcer()
Testing
pytest
Purpose: Testing framework
Why pytest?
- Simple syntax
- Fixtures
- Parametrization
- Plugins
Usage:
import pytest
@pytest.mark.asyncio
async def test_create_user():
# Test code
pass
pytest-asyncio
Purpose: Async test support
Why pytest-asyncio?
- Async test support
- Fixture support
- Event loop management
Development Tools
Ruff
Purpose: Fast Python linter
Why Ruff?
- Fast performance
- Multiple rules
- Auto-fix support
- Modern Python
mypy
Purpose: Static type checking
Why mypy?
- Type checking
- IDE integration
- Error detection
- Type inference
Black (Optional)
Purpose: Code formatter
Why Black?
- Consistent formatting
- Auto-formatting
- PEP 8 compliance
Deployment
Docker
Purpose: Containerization
Why Docker?
- Consistent environments
- Easy deployment
- Isolation
- Scalability
Docker Compose
Purpose: Multi-container orchestration
Why Docker Compose?
- Local development
- Service orchestration
- Environment setup
Kubernetes (Optional)
Purpose: Container orchestration
Why Kubernetes?
- Production deployment
- Auto-scaling
- Service mesh
- Load balancing
Monitoring & Observability
Structured Logging
Purpose: Application logging
Why Structured Logging?
- JSON logs
- Searchable
- Parseable
- Integration with log aggregators
Prometheus (Optional)
Purpose: Metrics collection
Why Prometheus?
- Time-series metrics
- Alerting
- Query language
- Integration
OpenTelemetry (Optional)
Purpose: Distributed tracing
Why OpenTelemetry?
- Request tracing
- Performance monitoring
- Service maps
- Standard protocol
Package Management
pip
Purpose: Package installation
Standard Python package manager
uv (Optional)
Purpose: Fast package manager
Why uv?
- Faster than pip
- Better dependency resolution
- Lock file support
Version Control
Git
Purpose: Version control
Standard version control system
CI/CD
GitHub Actions
Purpose: Continuous integration
Why GitHub Actions?
- Integrated with GitHub
- Easy configuration
- Free for open source
GitLab CI (Optional)
Purpose: Alternative CI/CD
Why GitLab CI?
- Integrated with GitLab
- Flexible pipelines
Technology Choices Summary
| Category | Technology | Purpose |
|---|---|---|
| Language | Python 3.12+ | Core language |
| Web Framework | FastAPI | REST API |
| Validation | Pydantic | Data validation |
| Database ORM | SQLAlchemy | Database abstraction |
| Migrations | Alembic | Schema migrations |
| Async Runtime | asyncio | Async support |
| Job Queue | ARQ | Background jobs |
| Cache/Queue | Redis | Caching & queues |
| Authorization | Casbin | Access control |
| Testing | pytest | Test framework |
| Linting | Ruff | Code quality |
| Type Checking | mypy | Static analysis |
| Containerization | Docker | Deployment |
| Orchestration | Kubernetes | Production scaling |
Compatibility
Python Versions
- Minimum: Python 3.12
- Recommended: Python 3.12+
- Tested: Python 3.12, 3.13
Operating Systems
- Linux: Fully supported
- macOS: Fully supported
- Windows: Supported (with WSL recommended)
Database Versions
- PostgreSQL: 12+
- MongoDB: 5.0+
- SQLite: 3.35+
Next Steps
- Learn about Design Patterns
- Explore Core Components
- Check Getting Started