NutcaseandGitHub 488c1767e0 New features (#63)
* refactor: Rename handler package to handlers in carrier-connector

- Rename internal/handler directory to internal/handlers
- Update handler import path in main.go and routes.go

* feat: Add SM-DP+ handler with multi-carrier management and profile operations

- Add SMDPHandler struct with manager field and NewSMDPHandler constructor
- Add AddCarrier endpoint with JSON binding and carrier configuration support
- Add RemoveCarrier endpoint with carrier ID parameter validation
- Add DownloadProfile endpoint with 30-second timeout and context cancellation
- Add GetCarrierStatus endpoint returning all carriers with timestamp
- Add GetProfileStatus endpoint with EID/ICCID validation

* feat: Add SM-DP+ integration layer with multi-carrier system initialization and route registration

- Add SMDPIntegration struct with service, handler, repository, and logger fields
- Add NewSMDPIntegration constructor with default carrier initialization
- Add InitializeSystem method with carrier health logging and status tracking
- Add RegisterRoutes method with profile, carrier, health, and metrics endpoints
- Add healthHandler with carrier health status aggregation and degraded state detection
- Add metricsHandler

* feat: Add SM-DP+ service layer with multi-carrier management and profile download operations

- Add SMDPService struct with manager, repository, and logger fields
- Add NewSMDPService constructor with default config and background health checking
- Add InitializeDefaultCarriers with AT&T, Verizon, and T-Mobile DE configurations
- Add DownloadProfile method with context support and request logging
- Add GetOptimalCarrier wrapping SelectCarrier for best carrier selection
- Add GetCarrierHealth returning

* feat: Add SM-DP+ manager with multi-carrier load balancing, health checking, and profile operations

- Add DefaultManagerConfig with 30s health checks, 3 retries, and circuit breaker configuration
- Add CarrierConfig struct with ES2 settings, MCC/MNC, priority, and feature support
- Add ToCarrier method converting CarrierConfig to Carrier with metrics and capabilities
- Add HealthChecker with periodic carrier health monitoring and status evaluation
- Add LoadBalancer with weighted round-robin, least

* feat: Add intelligent carrier selection service with scoring, recommendations, and analytics

- Add SelectionService struct with manager, handler, and logger fields
- Add NewSelectionService constructor with info-level logging
- Add IntelligentCarrierSelection method with comprehensive criteria evaluation
- Add IntelligentSelectionRequest with region, profile type, urgency, and cost sensitivity
- Add UserPreferences and BusinessContext structs for selection customization
- Add IntelligentSelectionResponse with selected

* feat: Add carrier selection handler with optimal selection, analytics, and performance monitoring endpoints

- Add SelectionHandler struct with manager and logger fields
- Add NewSelectionHandler constructor with info-level logging
- Add SelectOptimalCarrier endpoint with criteria validation and scoring
- Add SelectCarrier endpoint using default selection criteria
- Add GetSelectionHistory endpoint with carrier ID path parameter
- Add UpdateLearning endpoint with performance feedback validation
- Add GetSelectionAnalytics endpoint with carrier stats

* feat: Add carrier selection integration layer with multi-carrier setup, HTTP server, and demo capabilities

- Add SelectionIntegration struct with manager, selection service, handler, and SMDP service fields
- Add NewSelectionIntegration constructor with default manager config and 30s health checks
- Add SetupCarriers with AT&T, Verizon, T-Mobile DE, and Orange FR configurations
- Add StartServer method with health endpoint and 30s read/write timeouts
- Add StartHealthChecking wrapper for background

* feat: Refactor profile handlers into modular core components with simplified operations

- Split profile_handlers.go into profile_handlers_core.go, profile_handlers_management_core.go, and profile_handlers_management_delete.go
- Simplify OrderProfileHandlerWithRepo with ICCID/IMSI-only validation and "downloaded" state
- Remove webhook and message queue notifications from order handler
- Add UpdateProfileHandler with state validation for downloaded/activated/deactivated/expired
- Add DeleteProfileHandler with existence

* refactor: Extract carrier setup logic into separate file and remove unnecessary comments

- Move SetupCarriers method from selection_integration.go to new setup_carriers.go file
- Remove redundant comments from SelectionIntegration struct and methods
- Clean up inline comments in RunDemo method while preserving functionality

* feat: Add intelligent carrier selection algorithm with machine learning optimization and performance tracking

- Add SelectionAlgorithm with scoring, weighting, and ML-based carrier selection
- Add SelectionCriteria struct with region, profile type, urgency, and cost/performance weights
- Add CarrierScore with performance, reliability, cost, region, and capability scores
- Add calculateWeightedScore combining all scores with ML-optimized weights
- Add getWeights with urgency-based adjustments

* feat: Integrate SelectionAlgorithm into SMDPManager with optimal carrier selection and learning capabilities

- Add selector field to SMDPManager struct with SelectionAlgorithm type
- Initialize selector in NewSMDPManager constructor
- Add SelectOptimalCarrier method filtering healthy carriers and delegating to selection algorithm
- Add SelectCarrier wrapper with default criteria (operational profile, medium urgency, balanced weights)
- Add GetSelectionHistory method returning carrier selection history
- Add UpdateLearning

* refactor: Simplify profile handler function names by removing WithRepo suffix

- Rename ListProfilesHandlerWithRepo to ListProfilesHandler
- Rename GetProfileHandlerWithRepo to GetProfileHandler
- Rename DeleteProfileHandlerWithRepo to DeleteProfileHandler

* feat: Add pricing engine with rate plan validation, cost calculation, and price optimization

- Add PricingEngine struct with repository and logger fields
- Add ValidateRatePlan with comprehensive validation for fields, dates, allowances, overage rates, discounts, and early termination
- Add CalculateOptimalPrice with market analysis and recommended pricing based on competitor data
- Add ValidateSubscription with plan availability, validity dates, and discount validation
- Add CalculateSubscriptionCost with base

* feat: Add rate plan analytics handlers with usage, revenue, popularity, and dashboard endpoints

- Add AnalyticsResponse struct with success, message, and data fields
- Add GetUsageAnalytics with date range parsing, default last month period, and group by support
- Add GetRevenueAnalytics with RFC3339 date parsing and configurable filters
- Add GetPopularPlans with configurable limit defaulting to 10
- Add GetDashboardData aggregating top 5 popular plans, 30-day usage analytics, and revenue analytics

* feat: Add rate plan handler layer with CRUD operations, management endpoints, and analytics support

- Add RatePlanHandler struct with service and logger fields
- Add CreateRatePlan with JSON binding, draft status initialization, and comprehensive field mapping
- Add GetRatePlan with ID path parameter extraction and not found handling
- Add UpdateRatePlan with selective field updates and existing plan retrieval
- Add DeleteRatePlan with active subscription conflict detection
- Add ListRatePlans with carrier

* feat: Add rate plan type system with comprehensive domain models, allowances, subscriptions, and analytics support

- Add RatePlan struct with carrier, region, pricing, allowances, features, discounts, and validity fields
- Add PlanType enum with prepaid, postpaid, hybrid, pay-as-you-go, and unlimited options
- Add PlanStatus enum with draft, active, inactive, archived, and suspended states
- Add BillingCycle enum with daily, weekly, monthly, quarterly, and yearly options
- Add DataAllowance, VoiceAllowance, and

* feat: Add rate plan service layer with CRUD operations, subscription management, usage tracking, and analytics support

- Add Service struct with repository and logger fields
- Add CreateRatePlan with ID generation, validation, and comprehensive field checks
- Add GetRatePlan, UpdateRatePlan, and DeleteRatePlan with active subscription conflict detection
- Add ListRatePlans and SearchRatePlans with filtering and sorting support
- Add SubscribeToPlan with plan availability validation, duplicate subscription

* feat: Add carrier integration layer with optimal carrier selection, rate plan recommendations, and analytics support

- Add CarrierSelectionIntegrator struct with rate plan repository, SMDP manager, and logger fields
- Add GetOptimalCarrierWithRatePlan with region filtering, carrier grouping, performance scoring, and combined evaluation
- Add RecommendRatePlansForCarrier with carrier validation, active plan filtering, and recommendation creation
- Add UpdateCarrierSelectionCriteria with 30-day usage analytics

* feat: Add rate plan repository interface with GORM models and extended types for carrier integration

- Add Repository interface with rate plan CRUD, subscription management, usage tracking, and analytics operations
- Add GORM table name methods for RatePlan, RatePlanSubscription, and RatePlanUsage models
- Add GORM hooks with automatic timestamp handling for BeforeCreate and BeforeUpdate operations
- Add SearchCriteria with carrier, region, plan type, price range, pagination, and sorting fields

* feat: Refactor pricing engine by extracting calculation methods into separate file

- Move calculateDataOverage, calculateVoiceOverage, calculateSMSOverage, calculateDiscounts, and calculateRecommendedPrice to price_calculation.go
- Remove validation helper methods from pricing_engine.go
- Remove PriceOptimization and CostBreakdown type definitions
- Update Logger interface to use `any` instead of `interface{}`
- Remove inline comments throughout pricing_engine.go
- Add switch statement for discount type handling in calculateDiscounts

* refactor: Extract core rate plan types into separate file

- Move RatePlan struct from types.go to types_core.go
- Move PlanType enum with prepaid, postpaid, hybrid, pay-as-you-go, and unlimited options to types_core.go
- Move PlanStatus enum with draft, active, inactive, and archived states to types_core.go
- Move BillingCycle enum with daily, weekly, monthly, quarterly, and yearly options to types_core.go
- Add documentation comments for PlanType, PlanStatus, and BillingCycle enums
- Remove PlanStatusSuspended from PlanStatus enum

* feat: Add GORM repository implementation with CRUD operations, subscription management, usage tracking, and analytics support

- Add GormRepository struct with database and logger fields
- Add CreateRatePlan, GetRatePlan, UpdateRatePlan, and DeleteRatePlan with automatic timestamp handling
- Add ListRatePlans with carrier, region, plan type, status, price range, and validity filtering
- Add CountRatePlans with comprehensive filter support
- Add CreateSubscription, GetSubscription, UpdateSubscription, and DeleteSubscription with timestamp

* feat: Add carrier configuration layer with GORM repository, file loading, and model conversion support

- Add GormCarrierRepository struct with database and logger fields
- Add CarrierModel with ID, name, MCC, MNC, country code, active status, priority, ES2 config, capabilities, and timestamp fields
- Add GetCarriers with active carrier filtering and model-to-carrier conversion
- Add GetCarrier with ID lookup and not found handling
- Add SaveCarrier with upsert logic for create or update operations

* feat: Add carrier configuration file loading with JSON-based carrier setup and validation

- Add carriers.json with AT&T US, Verizon US, T-Mobile Germany, Orange France, and Vodafone UK configurations
- Add LoadCarriersFromFile with JSON parsing and config file reading
- Add ConvertConfigToCarriers with model-to-carrier conversion logic
- Add validateCarrier with ID, name, MCC, MNC, country code, and ES2 config validation
- Replace hardcoded carrier setup with file-based configuration loading
- Add success

* refactor: Extract service methods into separate files for better organization

- Move GetUsage, GetUsageHistory, GetUsageAnalytics, GetRevenueAnalytics, and GetPopularPlans to service_analytics.go
- Move validateRatePlan, validateSubscribeRequest, calculateNextBillingDate, and calculateCycleEnd to service_methods.go
- Move SubscribeToPlan, GetSubscription, UpdateSubscription, CancelSubscription, GetActiveSubscription, and ListSubscriptions to service_subscriptions.go
- Move RecordUsage to service_usage.go
2026-05-02 00:22:28 +03:00
2026-05-02 00:22:28 +03:00

Telecom-as-a-Service (TaaS) Platform

Sovereign, Full-Stack Cellular Connectivity Platform
Built with Go 1.26, Rust 1.95, TypeScript, eBPF, and 5G Core Network Technologies

Overview

The Telecom-as-a-Service (TaaS) Platform is a comprehensive, sovereign cellular connectivity solution that enables organizations to deploy and manage their own private 5G/LTE networks. This full-stack platform provides end-to-end capabilities from core network integration to subscriber management, charging, and developer APIs.

API Gateway Integration

The platform now includes Traefik API Gateway for centralized request routing, security, and monitoring. All services are accessible through a unified HTTPS endpoint with built-in rate limiting, authentication, and SSL termination.

What It Does

The TaaS Platform allows enterprises, telecom operators, and system integrators to:

  • Deploy Private Cellular Networks: Set up and manage private 5G/LTE networks with full control over data sovereignty and security
  • Manage Subscribers: Provision, authenticate, and manage cellular subscribers with role-based access control
  • Real-time Charging: Implement flexible credit control and billing with real-time usage monitoring
  • Developer APIs: Expose cellular network capabilities through REST and GraphQL APIs for custom application development
  • Network Orchestration: Automate network operations, scaling, and health monitoring across distributed infrastructure
  • Service Discovery: Enable dynamic service registration and discovery for microservices architecture

Commercial Applications

The platform is designed for various commercial use cases:

eSIM Operators (Airalo-style)

  • Multi-carrier aggregation across 400+ global carriers
  • Real-time eSIM provisioning via GSMA ES2+ standards
  • Usage-based billing with global rate plans
  • B2B2C model for MVNO partnerships

Enterprise Private Networks

  • Industrial IoT and manufacturing connectivity
  • Campus networks for universities and hospitals
  • Critical infrastructure communications
  • Secure data sovereignty deployments

Telecom Service Providers

  • MVNO enablement platform
  • Network slicing as a service
  • Edge computing integration
  • 5G core network hosting

Architecture

The platform is built as a microservices architecture with the following core components:

API Gateway Layer:

  • Traefik API Gateway: Centralized entry point providing SSL termination, rate limiting, authentication, and request routing
  • Unified HTTPS Endpoint: All services accessible via https://api.telecom.com
  • Security Middleware: JWT authentication, security headers, compression, and retry logic
  • Monitoring Dashboard: Real-time metrics and service health visualization

Core Network Services:

  • API Server: Central BSS (Business Support System) API providing authentication, subscriber management, automation, and plugin system
  • Carrier Connector: ES2+ interface for eSIM profile management and carrier integration
  • Charging Engine: Real-time credit control, usage tracking, and billing with Redis-backed rate limiting
  • Packet Gateway: High-performance eBPF-based packet processing for network traffic routing and QoS enforcement

Supporting Services:

  • Service Discovery (Consul): Dynamic service registration and health checking
  • Message Queue (RabbitMQ): Asynchronous event-driven communication between services
  • Redis: Distributed caching, rate limiting, and session management
  • PostgreSQL: Persistent data storage for subscribers, automations, and configuration
  • Vault: Secure secret management for sensitive credentials and keys

Developer Tools:

  • CLI: Command-line interface for service orchestration, configuration, and health checks
  • Web Dashboard: Next.js-based management interface for network operations
  • TypeScript SDK: Client library for integrating with TaaS APIs
  • Kubernetes Operators: Custom resources for deploying and managing TaaS services

Key Features

API Gateway & Security:

  • Unified HTTPS Endpoint: All services accessible via https://api.telecom.com
  • Centralized Authentication: JWT validation with rate limiting per service
  • SSL Termination: Automatic HTTPS with security headers enforcement
  • Request Routing: Intelligent routing with circuit breakers and retry logic

Sovereignty & Security:

  • Full data sovereignty with on-premise deployment
  • End-to-end encryption for subscriber data
  • Role-based access control (RBAC) with fine-grained permissions
  • Vault-based secret management for credential security

Performance & Scalability:

  • eBPF-accelerated packet processing for line-rate throughput
  • Redis-backed distributed rate limiting and caching
  • Horizontal scaling with Kubernetes orchestration
  • Gateway-level load balancing and connection pooling

Developer Experience:

  • Single API Endpoint: Simplified client integration through gateway
  • REST and GraphQL APIs with comprehensive documentation
  • TypeScript SDK for type-safe client integration
  • Plugin system for extending platform capabilities
  • Automation framework for network operations

Operations:

  • Gateway Dashboard: Real-time monitoring of all services
  • Unified Metrics: Prometheus integration with gateway-level insights
  • Automated scaling and service discovery
  • Centralized logging with structured logs
  • Health checks and failover automation

Technology Stack:

Core Languages & Runtimes:

  • Go 1.26: Core network integration, BSS API, carrier connector
  • Rust 1.95: eBPF packet gateway, real-time charging engine
  • TypeScript/Next.js: Developer dashboard and SDK

Databases:

  • PostgreSQL: Primary database for subscribers, automations, plugins, and configuration
  • Redis: Real-time credit control, caching, and rate limiting
  • MongoDB: Used exclusively by free5GC 5G core network for UDR/UDM subscription data and authentication

5G Core Network:

  • free5GC: Open-source 5G core network (AMF, SMF, UDM, UDR, etc.)

Infrastructure & Orchestration:

  • Kubernetes: Container orchestration and deployment
  • Helm: Package management for Kubernetes deployments
  • Istio: Service mesh for traffic management and security
  • eBPF/Aya: High-performance packet processing in kernel space

Message Queuing & Service Discovery:

  • RabbitMQ: Asynchronous message queue for event-driven communication
  • Consul: Service discovery, health checking, and configuration

Security & Secrets:

  • Vault: Secure secret management for credentials and keys
  • cert-manager: Automated TLS certificate management

Monitoring & Observability:

  • Prometheus: Metrics collection and alerting
  • Grafana: Visualization dashboards for metrics
  • ELK Stack: Elasticsearch, Logstash, Kibana for centralized logging

Prerequisites

  • Go 1.26+: Download
  • Rust 1.95+: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Node.js 22+: Download
  • pnpm: npm install -g pnpm
  • Docker: Install
  • PostgreSQL 15+: Install
  • Redis: Install
  • Kubernetes: Install (for production deployment)
  • Helm 3+: Install (for production deployment)
  • MongoDB 7.0+: Install (required for free5GC only)

Installation

# Clone the repository
git clone https://github.com/nutcas3/telecom-platform.git
cd telecom-platform

# Start with API Gateway (includes all services)
./scripts/start-gateway.sh

# Add domain to hosts file
echo "127.0.0.1 api.telecom.com" | sudo tee -a /etc/hosts

# Access services
# API Gateway Dashboard: http://localhost:8080
# API Documentation: https://api.telecom.com/api/v1/swagger
# Web Dashboard: http://localhost:3000

Manual Installation

# Build all components
make all

# Start services (requires separate terminals)
# Terminal 1: API Server
./dist/api-server

# Terminal 2: Carrier Connector
./dist/carrier-connector

# Terminal 3: Charging Engine
./target/release/charging-engine

# Terminal 4: Web Dashboard
cd apps/web-dashboard && pnpm dev

Project Structure

telecom-platform/
|-- apps/
|   |-- api-server/          # Go: Developer BSS API
|   |-- carrier-connector/   # Go: eSIM ES2+ Provisioning
|   |-- charging-engine/     # Rust: OCS Real-time Credit Control
|   |-- packet-gateway/      # Rust: eBPF UPF Data Plane
|   |-- web-dashboard/       # TypeScript: Next.js Frontend
|-- libs/
|   |-- shared-ts-sdk/       # TypeScript: Drop-in Widget SDK
|   |-- proto/               # Shared Protobufs
|-- deployments/
|   |-- kubernetes/          # K8s manifests
|   |-- docker/              # Dockerfiles
|-- traefik/                 # API Gateway configuration
|   |-- traefik.yml          # Static configuration
|   |-- dynamic/             # Dynamic middleware config
|-- docs/                    # Architecture & API docs
|   |-- gateway-quickstart.md # API Gateway guide
|   |-- api-gateway.md       # Gateway implementation details
|-- scripts/                 # Automation scripts
|   |-- start-gateway.sh     # Gateway startup script
|-- docker-compose.yml       # Container orchestration
|-- Makefile                 # Master build orchestrator
|-- Cargo.toml              # Rust workspace config
|-- go.work                 # Go workspace config
|-- pnpm-workspace.yaml     # TypeScript workspace config

Development

Build Commands

# Build everything
make all

# Build specific language
make build-go        # Go services
make build-rust      # Rust components
make build-ui        # TypeScript dashboard

# Run tests
make test

# Clean artifacts
make clean

Working with Specific Components

Go Services:

cd apps/api-server
go run main.go

Rust Components:

cd apps/charging-engine
cargo run --release

TypeScript Dashboard:

cd apps/web-dashboard
pnpm dev

Documentation

Testing

# Unit tests
make test

# Go tests
go test ./apps/...

# Rust tests
cargo test --workspace

# TypeScript tests
pnpm -r test

Deployment

# Start with API Gateway
./scripts/start-gateway.sh

# Or manually
docker-compose up -d

Docker (Legacy)

make docker-build
docker-compose up -d

Kubernetes

kubectl apply -f deployments/kubernetes/

API Gateway Configuration

The API Gateway provides:

  • Unified Endpoint: https://api.telecom.com
  • Rate Limiting: Per-service rate limits
  • SSL Termination: Automatic HTTPS
  • Authentication: JWT validation
  • Monitoring: Real-time metrics dashboard

For detailed setup, see Gateway Quickstart Guide

Environment Variables

Create .env files in each service directory:

API Server (apps/api-server/.env):

MONGODB_URI=mongodb://localhost:27017/free5gc
REDIS_URI=redis://localhost:6379
API_PORT=8000
JWT_SECRET=your-secret-key

Charging Engine (apps/charging-engine/.env):

REDIS_URI=redis://localhost:6379
SERVER_PORT=8080

Web Dashboard (apps/web-dashboard/.env.local):

NEXT_PUBLIC_API_URL=http://localhost:8000

📖 Key Resources

Contributing

  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

License

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

Support

Acknowledgments

  • free5GC Team: For the open-source 5G core implementation
  • Aya Community: For the pure-Rust eBPF framework
  • GSMA: For standardizing eSIM technology
  • Go Team: For the amazing Go 1.26 release
  • Rust Team: For continuous language improvements
S
Description
No description provided
Readme MIT
1.9 MiB
Languages
Go 67.9%
TypeScript 15%
Rust 8.5%
Python 1.8%
Kotlin 1.6%
Other 5.1%