Commit Graph
16 Commits
Author SHA1 Message Date
nutcas3 11fbbfb16b feat: Add analytics, security, and currency route handlers with comprehensive endpoint registration
- Add registerAnalyticsRoutes with churn analysis (predict, metrics, at-risk), market analytics (metrics, competitors, opportunities), predictive maintenance (metrics, assets, alerts, predict), and pricing optimization (metrics, optimize, elasticity) endpoints
- Add registerSecurityRoutes with fraud detection (analyze, alerts, update status, metrics, patterns) and SIM swap protection (verify, history) endpoints
2026-05-03 13:26:11 +03:00
nutcas3 cebed0a904 feat: Add CSRF protection middleware and Swagger annotations, remove GraphQL handler setup
- Add github.com/utrack/gin-csrf import for CSRF protection
- Remove internal/graphql import and resolver initialization
- Add Swagger API documentation annotations (@title, @version, @description, @host, @BasePath, @securityDefinitions)
- Add CSRF middleware with configurable secret from CSRF_SECRET environment variable
- Add warning log when using default CSRF secret
- Add return statement after database
2026-04-30 22:53:09 +03:00
nutcas3 51c1ad6573 feat: Add Swagger documentation endpoint and update API route prefix from /v1 to /api/v1
- Add swaggo/files and swaggo/gin-swagger imports for Swagger documentation
- Change API route group prefix from "/v1" to "/api/v1"
- Add GET /api/v1/swagger/*any endpoint for Swagger UI documentation
- Update RBAC path from "/v1/users" to "/api/v1/users" for consistency
2026-04-30 22:49:51 +03:00
nutcas3 afe4084ae2 refactor: Replace log.Printf with structured logging using logrus in api-server metrics collection
- Remove standard log import from server_metrics.go
- Add logrus import for structured logging
- Replace log.Printf with logrus.WithError for system metrics storage errors
- Replace log.Printf with logrus.WithError for subscriber count errors (total, active, suspended)
- Replace log.Printf with logrus.WithError for active sessions count errors
- Replace log.Printf with logrus.WithError for /proc/stat, /proc/meminfo, and /proc/net/dev read errors
2026-04-30 22:43:37 +03:00
nutcas3 93bf51df65 feat: Add Consul service discovery integration to API server with automatic registration
- Add discovery package import to server.go
- Add fmt and strconv imports for service ID generation and port parsing
- Add CONSUL_ADDR environment variable check to conditionally enable service discovery
- Add discovery.NewServiceDiscovery initialization with error handling and logging
- Add service registration with api-server name, dynamic port from config, and api/telecom tags
- Add serviceID generation using api
2026-04-25 06:51:04 +03:00
nutcas3 1fc84859df refactor: Remove structured logging initialization from API server startup
- Remove logging package import from server.go
- Remove logging.InitWithDefaults call and error handling
- Replace logging.Fatalf with log.Fatalf for database initialization errors
2026-04-25 06:37:33 +03:00
nutcas3 1c89fdac92 feat: Add structured logging initialization to API server startup with database error logging
- Add logging package import to server.go
- Add logging.InitWithDefaults call after config loading with error handling
- Replace log.Fatalf with logging.Fatalf for database initialization errors
2026-04-25 06:36:37 +03:00
nutcas3 19a4aaee01 feat: Add user-based rate limiting to protected API routes with 100 requests per minute limit
- Add RateLimitByUser middleware to protected route group with 100 req/min limit
- Add RateLimitByUser middleware to apiProtected route group with 100 req/min limit
2026-04-25 06:12:59 +03:00
nutcas3 2c5d513c4b feat: Add subscriber management API endpoints with RBAC authorization
- Add SubscriberHandler to serverDeps with NewSubscriberService initialization
- Add subscriber routes to v1 API with GET (list, by id, by IMSI) and protected POST/PUT operations
- Add RBAC enforcement for subscriber creation, updates, suspension, and termination (admin, operator roles)
- Add registerSubscriberRoutes function with /subscribers endpoint group
2026-04-25 05:28:14 +03:00
nutcas3 552d9d5e1f feat: Move charging routes to public v1 group and add health check endpoint
- Move charging routes from protected /api group to public /v1/charging group for packet-gateway integration
- Add GET /v1/health endpoint returning status ok
- Remove registerChargingRoutes function (routes now inline in registerV1Routes)
- Remove registerChargingRoutes call from apiProtected group
2026-04-25 03:33:08 +03:00
nutcas3 7aa582ee3d feat: Add charging routes and handler integration to API server
- Add chargingH field to serverDeps struct
- Add ChargingEngineClient initialization in buildDeps
- Add NewChargingHandler with chargingEngineClient dependency
- Add registerChargingRoutes function with /charging group
- Add POST /charging/credit/:ip/check endpoint
- Add GET /charging/credit/:ip/balance endpoint
- Add POST /charging/credit/:ip/add endpoint
- Add POST /charging/credit/:ip/deduct endpoint
- Call registerChargingRoutes in
2026-04-25 03:32:05 +03:00
nutcas3 c0034b195a feat: Refactor api-server main.go to extract route setup and handlers into separate packages for improved modularity
- Move route registration logic to registerV1Routes with dependency injection pattern
- Extract metrics collector initialization to buildMetricsCollector helper function
- Extract service/handler dependency initialization to buildDeps helper function
- Remove all inline handler implementations (auth/services/monitoring/deployments/plugins/automation/config/chaos/billing routes)
- Remove all metrics collection helper functions (startMetricsCollection/
2026-04-24 08:58:53 +03:00
nutcas3 0e28b8a1ac feat: Add comprehensive API server with REST endpoints, WebSocket support, RBAC, monitoring, and service integrations
- Add server.go with Swagger documentation endpoint, WebSocket handler, health/ready/live monitoring endpoints
- Add global middleware: rate limiting, performance optimization, security headers, CORS, request size (10MB), timeout (30s)
- Add performance metrics endpoint with 100ms threshold monitoring
- Add authentication service initialization with JWT, WebSocket hub, health monitor
2026-04-20 18:09:53 +03:00
NutcaseandGitHub 1b2b9d2412 Revert "Revert "App layer"" (#5) 2026-04-17 16:08:27 +03:00
NutcaseandGitHub efed7e936c Revert "App layer" 2026-04-17 15:59:31 +03:00
nutcas3 ccd50ac79e feat: Add API server main entry point with GraphQL, metrics collection, and system monitoring
- Add main server setup with Gin router, GraphQL handler, and graceful shutdown
- Initialize database connection and metrics collectors (Prometheus and InfluxDB time-series)
- Add HTTP middleware for Prometheus metrics collection
- Add /metrics endpoint for Prometheus scraping and /health endpoint for health checks
- Implement periodic metrics collection (30s interval) for subscribers, sessions, and system
2026-04-17 15:35:33 +03:00