A production-ready data processing platform built with Rust, featuring:
- Web Framework: Axum for high-performance, type-safe APIs
- Authentication: JWT-based authentication with OAuth2 flow
- Authorization: Casbin-based permission system with database persistence
- Database: PostgreSQL with SQLx and SeaORM for async database operations
- Data Processing: Apache DataFusion query engine supporting multiple data sources
- Data Formats: Arrow in-memory format, Parquet, CSV, JSON
- Flight SQL: Apache Arrow Flight protocol for high-performance data access
- ADBC: Arrow Database Connectivity for database abstraction
- Iceberg: Native Apache Iceberg support
- Config Management: Environment-specific configuration for dev/test/prod
- Error Handling: Comprehensive error handling with unified response format
- Logging: Structured logging with tracing
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Frontend │────│ Axum API │────│ PostgreSQL │
│ (Superset, │ │ │ │ │
│ etc.) │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
└─────────────────┘ │ │ Auth Layer │ │ │ │ Casbin │ │
│ │ (JWT/Casbin)│ │ │ │ Policy │ │
│ └─────────────┘ │ │ │ Storage │ │
│ │ │ └─────────────┘ │
│ ┌─────────────┐ │ │ │
│ │ DataFusion │ │ │ ┌─────────────┐ │
│ │ Engine │ │────│──│ DataFusion │ │
│ └─────────────┘ │ │ │ Adapter │ │
│ │ │ └─────────────┘ │
│ ┌─────────────┐ │ └─────────────────┘
│ │ Flight SQL │ │
│ │ Server │ │
│ └─────────────┘ │
└──────────────────┘
- JWT-based authentication with refresh tokens
- OAuth2 integration
- Casbin-based authorization with database persistence
- Role-based access control (RBAC)
- Policy management via REST API
- Apache DataFusion query engine
- Support for multiple data sources:
- Memory tables
- CSV files
- PostgreSQL, MySQL, SQLite databases
- Parquet files
- JSON files
- Apache Arrow format
- Apache Iceberg tables
- Remote data sources
- SQL query execution
- Distributed query capabilities
- Custom function support
- Apache Arrow Flight protocol implementation
- High-performance data access
- Compatible with Apache Superset
- Prepared statement support
- Environment-specific configurations (dev/test/prod)
- Database connection pooling
- JWT token management
- DataFusion settings
- Flight server configuration
- Rust 1.70+
- PostgreSQL 12+
- Docker (for optional containerization)
- Clone the repository:
git clone <repository-url>
cd modern-data-platform- Install dependencies:
cargo build- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Run database migrations:
cargo runThe application supports three environments:
development- For local developmenttest- For testingproduction- For production deployment
Configuration files are located in the config/ directory.
POST /api/auth/login- User loginPOST /api/auth/refresh- Token refresh
GET /api/casbin/policies- Get all policiesPOST /api/casbin/policies- Add policyDELETE /api/casbin/policies- Remove policyGET /api/casbin/rules- Get all rulesPOST /api/casbin/rules- Add rulePUT /api/casbin/rules/{id}- Update ruleDELETE /api/casbin/rules/{id}- Delete rule
GET /api/data-sources- List data sourcesPOST /api/data-sources- Create data sourceGET /api/data-sources/{id}- Get data sourcePUT /api/data-sources/{id}- Update data sourceDELETE /api/data-sources/{id}- Delete data source
POST /api/query/execute- Execute SQL query
The Flight SQL server runs on port 50051 by default when enabled in the configuration. It's compatible with Apache Superset and other Flight SQL clients.
# Database
DATABASE_URL=postgresql://user:password@localhost/dbname
# JWT
JWT_SECRET=your-super-secret-jwt-key
# Application
APP_ENV=development
APP_HOST=0.0.0.0
APP_PORT=8080cargo runAPP_ENV=production cargo run --releaseRun all tests:
cargo testRun tests with logging:
RUST_LOG=debug cargo testThe application can be deployed as a standalone binary or containerized with Docker.
- 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.