feat: Initialize telecom platform with core services and infrastructure

- Add Go-based API server and carrier connector services
- Add Rust-based charging engine and packet gateway services
- Add Docker Compose configuration for local development
- Add comprehensive documentation (API, Architecture, Deployment)
- Add development scripts for Redis, MongoDB, and environment setup
- Add workspace configuration for Go modules and pnpm
- Remove unnecessary documentation files from web-dashboard
- Add project build configuration (Makefile, Cargo.toml)

This commit establishes the foundational microservices architecture for the sovereign Telecom-as-a-Service platform.
This commit is contained in:
nutcas3
2026-04-03 19:55:38 +03:00
parent a69c6a125a
commit b69b7ec087
26 changed files with 2573 additions and 6 deletions
+144
View File
@@ -0,0 +1,144 @@
#!/bin/bash
set -e
echo "========================================="
echo "TaaS Platform - Development Setup"
echo "========================================="
echo ""
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to check command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check Go 1.26
echo -n "Checking Go 1.26... "
if command_exists go; then
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
if [[ "$GO_VERSION" == 1.26* ]]; then
echo -e "${GREEN}✓${NC} Found $(go version)"
else
echo -e "${YELLOW}⚠${NC} Found Go $GO_VERSION (1.26 recommended)"
fi
else
echo -e "${RED}✗${NC} Not found"
echo "Please install Go 1.26: https://go.dev/dl/"
fi
# Check Rust 1.94
echo -n "Checking Rust 1.94... "
if command_exists rustc; then
RUST_VERSION=$(rustc --version | awk '{print $2}')
if [[ "$RUST_VERSION" == 1.94* ]]; then
echo -e "${GREEN}✓${NC} Found $(rustc --version)"
else
echo -e "${YELLOW}⚠${NC} Found Rust $RUST_VERSION (1.94 recommended)"
fi
else
echo -e "${RED}✗${NC} Not found"
echo "Please install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
fi
# Check Node.js 22
echo -n "Checking Node.js 22... "
if command_exists node; then
NODE_VERSION=$(node --version | sed 's/v//')
if [[ "$NODE_VERSION" == 22* ]]; then
echo -e "${GREEN}✓${NC} Found $(node --version)"
else
echo -e "${YELLOW}⚠${NC} Found Node.js $NODE_VERSION (22 recommended)"
fi
else
echo -e "${RED}✗${NC} Not found"
echo "Please install Node.js 22: https://nodejs.org/"
fi
# Check pnpm
echo -n "Checking pnpm... "
if command_exists pnpm; then
echo -e "${GREEN}✓${NC} Found $(pnpm --version)"
else
echo -e "${RED}✗${NC} Not found"
echo "Installing pnpm..."
npm install -g pnpm
fi
# Check MongoDB
echo -n "Checking MongoDB... "
if command_exists mongosh; then
echo -e "${GREEN}✓${NC} Found"
else
echo -e "${YELLOW}⚠${NC} MongoDB shell not found"
echo "Please install MongoDB: https://www.mongodb.com/docs/manual/installation/"
fi
# Check Redis
echo -n "Checking Redis... "
if command_exists redis-cli; then
echo -e "${GREEN}✓${NC} Found"
else
echo -e "${YELLOW}⚠${NC} Redis not found"
echo "Install Redis: sudo apt-get install redis-server"
fi
# Check Docker
echo -n "Checking Docker... "
if command_exists docker; then
echo -e "${GREEN}✓${NC} Found $(docker --version | cut -d ' ' -f3)"
else
echo -e "${YELLOW}⚠${NC} Docker not found (optional)"
fi
echo ""
echo "========================================="
echo "Installing Dependencies"
echo "========================================="
echo ""
# Install Go dependencies
echo "Installing Go dependencies..."
cd apps/api-server && go mod download && cd ../..
cd apps/carrier-connector && go mod download && cd ../..
# Install Rust dependencies
echo "Installing Rust dependencies..."
cargo fetch
# Install Node.js dependencies
echo "Installing Node.js dependencies..."
pnpm install
echo ""
echo "========================================="
echo "Creating Environment Files"
echo "========================================="
echo ""
# Create .env files from examples
for env_example in $(find . -name ".env.example"); do
env_file="${env_example%.example}"
if [ ! -f "$env_file" ]; then
cp "$env_example" "$env_file"
echo "Created $env_file"
else
echo "Skipped $env_file (already exists)"
fi
done
echo ""
echo "========================================="
echo "Setup Complete!"
echo "========================================="
echo ""
echo "Next steps:"
echo "1. Set up databases: make db-setup"
echo "2. Build all components: make all"
echo "3. Start development: make dev"
echo ""
echo "For help: make help"
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
set -e
echo "Setting up MongoDB for TaaS Platform..."
# Check if MongoDB is installed
if ! command -v mongosh &> /dev/null; then
echo "MongoDB shell (mongosh) not found. Please install MongoDB first."
echo "Visit: https://www.mongodb.com/docs/manual/installation/"
exit 1
fi
# MongoDB connection details
MONGO_HOST=${MONGO_HOST:-"localhost"}
MONGO_PORT=${MONGO_PORT:-"27017"}
MONGO_USER=${MONGO_USER:-"free5gc"}
MONGO_PASS=${MONGO_PASS:-"free5gc_password"}
MONGO_DB="free5gc"
echo "Creating MongoDB database and user..."
# Create database and user
mongosh --host $MONGO_HOST --port $MONGO_PORT <<EOF
use admin
// Create user if not exists
if (!db.getUser("$MONGO_USER")) {
db.createUser({
user: "$MONGO_USER",
pwd: "$MONGO_PASS",
roles: [
{ role: "readWrite", db: "$MONGO_DB" },
{ role: "dbAdmin", db: "$MONGO_DB" }
]
})
print("User $MONGO_USER created successfully")
} else {
print("User $MONGO_USER already exists")
}
use $MONGO_DB
// Create collections for free5GC
db.createCollection("subscriptionData.provisionedData.amData")
db.createCollection("subscriptionData.authenticationData.authenticationSubscription")
db.createCollection("subscriptionData.provisionedData.smData")
db.createCollection("policyData.ues.amData")
db.createCollection("policyData.ues.smData")
print("Collections created successfully")
EOF
echo "MongoDB setup complete!"
echo ""
echo "Connection string: mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_HOST:$MONGO_PORT/$MONGO_DB"
echo ""
echo "Update your .env files with:"
echo "MONGODB_URI=mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_HOST:$MONGO_PORT/$MONGO_DB"
+66
View File
@@ -0,0 +1,66 @@
#!/bin/bash
set -e
echo "Setting up Redis for TaaS Platform..."
# Check if Redis is installed
if ! command -v redis-cli &> /dev/null; then
echo "Redis CLI not found. Please install Redis first."
echo "Ubuntu/Debian: sudo apt-get install redis-server"
echo "macOS: brew install redis"
exit 1
fi
# Redis connection details
REDIS_HOST=${REDIS_HOST:-"localhost"}
REDIS_PORT=${REDIS_PORT:-"6379"}
echo "Testing Redis connection..."
# Test connection
if redis-cli -h $REDIS_HOST -p $REDIS_PORT ping > /dev/null 2>&1; then
echo "✓ Redis is running and accessible"
else
echo "✗ Cannot connect to Redis at $REDIS_HOST:$REDIS_PORT"
echo "Please start Redis: sudo systemctl start redis-server"
exit 1
fi
# Configure Redis for TaaS
echo "Configuring Redis..."
redis-cli -h $REDIS_HOST -p $REDIS_PORT <<EOF
# Set memory limit
CONFIG SET maxmemory 2gb
CONFIG SET maxmemory-policy allkeys-lru
# Disable RDB persistence for speed (optional)
# CONFIG SET save ""
# Enable AOF for durability (optional)
# CONFIG SET appendonly yes
# Save configuration
CONFIG REWRITE
EOF
echo "Redis configuration complete!"
echo ""
echo "Connection string: redis://$REDIS_HOST:$REDIS_PORT/"
echo ""
echo "Update your .env files with:"
echo "REDIS_URI=redis://$REDIS_HOST:$REDIS_PORT/"
# Create some test data
echo ""
echo "Creating test credit balances..."
redis-cli -h $REDIS_HOST -p $REDIS_PORT <<EOF
SET credit:10.0.0.1 1073741824
SET credit:10.0.0.2 5368709120
SET credit:10.0.0.3 10737418240
EOF
echo "✓ Test credit balances created"
echo " - 10.0.0.1: 1 GB"
echo " - 10.0.0.2: 5 GB"
echo " - 10.0.0.3: 10 GB"