Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution - Enhance API schema with expanded type definitions and resolvers - Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth - Implement new services: AI optimization, billing, blockchain, compliance, marketplace - Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage) - Update Crossplane provider with enhanced VM management capabilities - Add comprehensive test suite for API endpoints and services - Update frontend components with improved GraphQL subscriptions and real-time updates - Enhance security configurations and headers (CSP, CORS, etc.) - Update documentation and configuration files - Add new CI/CD workflows and validation scripts - Implement design system improvements and UI enhancements
This commit is contained in:
44
mobile/README.md
Normal file
44
mobile/README.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Sankofa Phoenix Mobile Apps
|
||||
|
||||
Native mobile applications for iOS and Android to manage Sankofa Phoenix infrastructure on the go.
|
||||
|
||||
## Architecture
|
||||
|
||||
- **iOS**: SwiftUI + Swift
|
||||
- **Android**: Kotlin + Jetpack Compose
|
||||
- **Shared Backend**: GraphQL API
|
||||
- **State Management**: Apollo Client (iOS) / Apollo Kotlin (Android)
|
||||
|
||||
## Features
|
||||
|
||||
- Dashboard overview with key metrics
|
||||
- Resource management (VMs, clusters, services)
|
||||
- Real-time notifications
|
||||
- Cost tracking and alerts
|
||||
- Quick actions (start/stop resources)
|
||||
- Offline mode with sync
|
||||
- Biometric authentication
|
||||
- Push notifications
|
||||
|
||||
## Getting Started
|
||||
|
||||
### iOS Development
|
||||
|
||||
```bash
|
||||
cd mobile/ios
|
||||
pod install
|
||||
open SankofaPhoenix.xcworkspace
|
||||
```
|
||||
|
||||
### Android Development
|
||||
|
||||
```bash
|
||||
cd mobile/android
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
- iOS: App Store Connect
|
||||
- Android: Google Play Console
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.sankofa.phoenix
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.sankofa.phoenix.ui.theme.SankofaPhoenixTheme
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
SankofaPhoenixTheme {
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background
|
||||
) {
|
||||
PhoenixApp()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.sankofa.phoenix.data
|
||||
|
||||
import com.apollographql.apollo3.ApolloClient
|
||||
import com.apollographql.apollo3.api.ApolloResponse
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GraphQLService {
|
||||
private val apolloClient = ApolloClient.Builder()
|
||||
.serverUrl("https://api.sankofa.nexus/graphql")
|
||||
.build()
|
||||
|
||||
suspend fun fetchResources(): Flow<ApolloResponse<ResourcesQuery.Data>> {
|
||||
// GraphQL query implementation using Apollo Kotlin
|
||||
return apolloClient.query(ResourcesQuery()).toFlow()
|
||||
}
|
||||
|
||||
suspend fun fetchSystemHealth(): Flow<ApolloResponse<SystemHealthQuery.Data>> {
|
||||
return apolloClient.query(SystemHealthQuery()).toFlow()
|
||||
}
|
||||
|
||||
suspend fun fetchCostOverview(): Flow<ApolloResponse<CostOverviewQuery.Data>> {
|
||||
return apolloClient.query(CostOverviewQuery()).toFlow()
|
||||
}
|
||||
}
|
||||
|
||||
data class Resource(
|
||||
val id: String,
|
||||
val name: String,
|
||||
val type: String,
|
||||
val status: String
|
||||
)
|
||||
|
||||
data class SystemHealth(
|
||||
val regions: HealthMetrics,
|
||||
val clusters: HealthMetrics,
|
||||
val nodes: HealthMetrics
|
||||
)
|
||||
|
||||
data class HealthMetrics(
|
||||
val total: Int,
|
||||
val healthy: Int,
|
||||
val warning: Int,
|
||||
val critical: Int
|
||||
)
|
||||
|
||||
data class CostOverview(
|
||||
val currentMonth: Double,
|
||||
val lastMonth: Double,
|
||||
val trend: String,
|
||||
val percentageChange: Double
|
||||
)
|
||||
|
||||
11
mobile/ios/SankofaPhoenix/App.swift
Normal file
11
mobile/ios/SankofaPhoenix/App.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct SankofaPhoenixApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
mobile/ios/SankofaPhoenix/ContentView.swift
Normal file
20
mobile/ios/SankofaPhoenix/ContentView.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@StateObject private var authManager = AuthenticationManager()
|
||||
|
||||
var body: some View {
|
||||
if authManager.isAuthenticated {
|
||||
DashboardView()
|
||||
} else {
|
||||
LoginView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
|
||||
60
mobile/ios/SankofaPhoenix/Services/GraphQLService.swift
Normal file
60
mobile/ios/SankofaPhoenix/Services/GraphQLService.swift
Normal file
@@ -0,0 +1,60 @@
|
||||
import Foundation
|
||||
import Apollo
|
||||
|
||||
class GraphQLService {
|
||||
static let shared = GraphQLService()
|
||||
|
||||
private let apollo: ApolloClient
|
||||
|
||||
private init() {
|
||||
let url = URL(string: "https://api.sankofa.nexus/graphql")!
|
||||
let store = ApolloStore(cache: InMemoryNormalizedCache())
|
||||
let networkTransport = RequestChainNetworkTransport(
|
||||
interceptorProvider: DefaultInterceptorProvider(store: store),
|
||||
endpointURL: url
|
||||
)
|
||||
|
||||
self.apollo = ApolloClient(networkTransport: networkTransport, store: store)
|
||||
}
|
||||
|
||||
func fetchResources(completion: @escaping (Result<[Resource], Error>) -> Void) {
|
||||
// GraphQL query implementation
|
||||
// This would use Apollo iOS SDK to fetch resources
|
||||
}
|
||||
|
||||
func fetchSystemHealth(completion: @escaping (Result<SystemHealth, Error>) -> Void) {
|
||||
// GraphQL query for system health
|
||||
}
|
||||
|
||||
func fetchCostOverview(completion: @escaping (Result<CostOverview, Error>) -> Void) {
|
||||
// GraphQL query for cost overview
|
||||
}
|
||||
}
|
||||
|
||||
struct Resource: Codable {
|
||||
let id: String
|
||||
let name: String
|
||||
let type: String
|
||||
let status: String
|
||||
}
|
||||
|
||||
struct SystemHealth: Codable {
|
||||
let regions: HealthMetrics
|
||||
let clusters: HealthMetrics
|
||||
let nodes: HealthMetrics
|
||||
}
|
||||
|
||||
struct HealthMetrics: Codable {
|
||||
let total: Int
|
||||
let healthy: Int
|
||||
let warning: Int
|
||||
let critical: Int
|
||||
}
|
||||
|
||||
struct CostOverview: Codable {
|
||||
let currentMonth: Double
|
||||
let lastMonth: Double
|
||||
let trend: String
|
||||
let percentageChange: Double
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user