workspace "Naviway API System" "Architecture diagram for the Naviway mobile app and API system" { model { # People mobileUser = person "Mobile App User" "Salesperson using the mobile application" # External Systems azureAD = softwareSystem "Azure Active Directory" "Microsoft identity platform for authentication" "External" navision = softwareSystem "Microsoft Dynamics NAV" "ERP system containing business data (customers, salespeople)" "External" newRelic = softwareSystem "New Relic" "Application performance monitoring" "External" cellar = softwareSystem "Clever Cloud Cellar" "S3-compatible object storage for NAV data artifacts (customers, contacts)" "External" # Main System naviwaySystem = softwareSystem "Naviway System" "Provides mobile access to NAV data with authentication" { # Mobile App mobileApp = container "Mobile App" "Native mobile application for salespeople" "iOS/Android" { tags "Mobile" } # API Server apiServer = container "Naviway API Server" "RESTful API providing authenticated access to NAV data" "Go, Gin Framework" { # Components within API Server apiRouter = component "API Router" "Routes HTTP requests to handlers" "Gin Router" authMiddleware = component "Authentication Middleware" "Validates MSAL Bearer tokens" "auth/msal.go" # Handlers healthHandler = component "Health Handler" "Health check endpoint" "handlers/health.go" vendorsHandler = component "Vendors Handler" "Salespeople endpoint handler" "handlers/vendors.go" manifestHandler = component "Manifest Handler" "Salesperson manifest endpoint handler" "handlers/manifest.go" # Business Logic navisionClient = component "Navision Client" "Communicates with NAV OData API" "navision/client.go" customersService = component "Customers Service" "Retrieves customer data from NAV" "navision/customers.go" # Monitoring nrMiddleware = component "New Relic Middleware" "Application performance monitoring integration" "nrgin" } # CLI Tools cliTool = container "CLI Sync Tool" "Command-line tool for syncing NAV data" "Go, Cobra" { tags "CLI" } } # Relationships - User to Systems mobileUser -> mobileApp "Uses to access customer data" # Relationships - Mobile App to API mobileApp -> apiRouter "Makes API requests [HTTPS/REST]" "JSON/HTTPS" # Relationships - API Router to Middleware apiRouter -> nrMiddleware "Passes requests through" nrMiddleware -> authMiddleware "Validates authentication" # Relationships - Middleware to Handlers authMiddleware -> healthHandler "Routes /api/v1/health" authMiddleware -> vendorsHandler "Routes /api/v1/salespeople" authMiddleware -> manifestHandler "Routes /api/v1/salespeople/:id/manifest" # Relationships - Handlers to Services vendorsHandler -> navisionClient "Gets salespeople data" manifestHandler -> navisionClient "Gets manifest URLs" navisionClient -> customersService "Delegates customer queries" # Relationships - API to External Systems authMiddleware -> azureAD "Validates JWT tokens [HTTPS]" "JWKS" navisionClient -> navision "Queries business data [HTTPS]" "OData v4, NTLM Auth" nrMiddleware -> newRelic "Sends telemetry data [HTTPS]" # Relationships - CLI Tool cliTool -> navisionClient "Uses to fetch NAV data" cliTool -> navision "Syncs data from [HTTPS]" "OData v4" cliTool -> cellar "Uploads data artifacts [HTTPS]" "JSON files" # Relationships - Mobile App to Cellar mobileApp -> cellar "Downloads customer/contact data [HTTPS]" "JSON files" # Deployment deploymentEnvironment "Production" { deploymentNode "Mobile Device" "" "iOS/Android" { mobileAppInstance = containerInstance mobileApp } deploymentNode "Cloud Platform" "" "Server Infrastructure" { deploymentNode "API Server" "" "Go Runtime" { apiServerInstance = containerInstance apiServer } } deploymentNode "On-Premise" "" "Corporate Network" { deploymentNode "NAV Server" "" "Windows Server" { navisionInstance = softwareSystemInstance navision } } deploymentNode "Microsoft Cloud" "" "Azure" { azureADInstance = softwareSystemInstance azureAD } deploymentNode "SaaS" "" "Cloud" { newRelicInstance = softwareSystemInstance newRelic } deploymentNode "Clever Cloud" "" "Platform as a Service" { cellarInstance = softwareSystemInstance cellar } } } views { systemContext naviwaySystem "SystemContext" { include * autoLayout } container naviwaySystem "Containers" { include * autoLayout } component apiServer "APIComponents" { include * autoLayout } deployment naviwaySystem "Production" "ProductionDeployment" { include * autoLayout } styles { element "Software System" { background #1168bd color #ffffff } element "External" { background #999999 color #ffffff } element "Container" { background #438dd5 color #ffffff } element "Mobile" { shape MobileDevicePortrait background #34a853 color #ffffff } element "CLI" { shape Pipe background #f4b400 color #000000 } element "Component" { background #85bbf0 color #000000 } element "Person" { shape person background #08427b color #ffffff } } theme default } configuration { scope softwaresystem } }