# rahulnikam2002/api-monitoring-system architecture

> Architecture diagram of the GitHub repository rahulnikam2002/api-monitoring-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahulnikam2002/api-monitoring-system
- Repository: https://github.com/rahulnikam2002/api-monitoring-system

## Overview

This repository implements an API-hit monitoring product: clients submit hit data, the server queues events for processing and analytics, and users inspect dashboard summaries. The dashboard also supports authentication, client/API-key management, and theme settings. The tree and excerpts establish the ingest path and dashboard composition; analytics, processor, and repository connections are less directly evidenced, so uncertain links are omitted or dashed.

Main entry points: [`server/src/server.js`](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/server.js) (HTTP server), [`dashboard/src/App.jsx`](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/App.jsx) (Dashboard app), [`dashboard/src/pages/OverviewPage.jsx`](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/pages/OverviewPage.jsx) (Overview page), [`dashboard/src/api/api.js`](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/api/api.js) (Dashboard API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Dashboard app<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_layout["Dashboard layout"]
  node_overview["Overview page<br/>[OverviewPage.jsx]"]
  node_settings["Settings page<br/>[SettingsPage.jsx]"]
  node_query["Dashboard query"]
  node_api["Dashboard API client<br/>[api.js]"]
  node_dashboard_views["Stats and charts"]
end

subgraph group_identity["Identity and clients"]
  node_auth_routes["Auth routes<br/>[authRouter.js]"]
  node_auth_service["Auth service<br/>[authService.js]"]
  node_users["User repository<br/>[UserRepository.js]"]
  node_client_routes["Client routes<br/>[clientRoutes.js]"]
  node_client_service["Client service<br/>[clientService.js]"]
  node_client_store[("Client and key stores")]
end

subgraph group_ingestion["Hit ingestion"]
  node_ingest_routes["Ingest routes<br/>[ingestRoutes.js]"]
  node_ingest_controller["Ingest controller"]
  node_ingest_service["Ingest service<br/>[ingestServices.js]"]
  node_producer["Event producer<br/>[eventProducer.js]"]
  node_queue["RabbitMQ queue<br/>[rabbitmq.js]"]
end

subgraph group_analytics["Processing and analytics"]
  node_consumer["Event consumer<br/>[consumer.js]"]
  node_processor["Hit processor"]
  node_metrics[("Metrics repository")]
  node_analytics_routes["Analytics routes<br/>[analyticsRoutes.js]"]
  node_analytics_controller["Analytics controller"]
  node_analytics_service["Analytics service"]
end

subgraph group_platform["Shared platform"]
  node_server["HTTP server<br/>[server.js]"]
  node_mongo[("MongoDB<br/>[mongodb.js]")]
  node_postgres[("PostgreSQL<br/>[postgres.js]")]
end

node_api_caller(("API client"))
node_user(("Dashboard user"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_settings
node_login -->|"auth requests"| node_api
node_overview -->|"loads data"| node_query
node_overview -->|"renders"| node_dashboard_views
node_settings -->|"renders"| node_dashboard_views
node_query -->|"fetches dashboard"| node_api
node_api -->|"HTTP requests"| node_server
node_api_caller -.->|"submits hits"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_client_routes
node_server -->|"mounts"| node_ingest_routes
node_server -->|"mounts"| node_analytics_routes
node_auth_routes -.->|"dispatches"| node_auth_service
node_auth_service -.->|"reads and writes"| node_users
node_client_routes -->|"dispatches"| node_client_service
node_client_service -.->|"uses repositories"| node_client_store
node_ingest_routes -->|"dispatches"| node_ingest_controller
node_ingest_controller -->|"submits hit"| node_ingest_service
node_ingest_service -->|"publishes event"| node_producer
node_producer -.->|"enqueues event"| node_queue
node_queue -.->|"delivers event"| node_consumer
node_consumer -.->|"dispatches"| node_processor
node_processor -.->|"stores metrics"| node_metrics
node_analytics_routes -.->|"dispatches"| node_analytics_controller
node_analytics_controller -.->|"requests analytics"| node_analytics_service
node_analytics_service -.->|"reads metrics"| node_metrics
node_server -->|"connects"| node_mongo
node_server -->|"connects"| node_postgres

click node_app "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/App.jsx"
click node_login "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/components/Login.jsx"
click node_layout "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/components/layout/DashboardLayout.jsx"
click node_overview "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/pages/OverviewPage.jsx"
click node_settings "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/pages/SettingsPage.jsx"
click node_query "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/hooks/useDashboardQuery.js"
click node_api "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/api/api.js"
click node_dashboard_views "https://github.com/rahulnikam2002/api-monitoring-system/tree/master/dashboard/src/components"
click node_auth_routes "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/routes/authRouter.js"
click node_auth_service "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/service/authService.js"
click node_users "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/repository/UserRepository.js"
click node_client_routes "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/client/routes/clientRoutes.js"
click node_client_service "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/client/services/clientService.js"
click node_client_store "https://github.com/rahulnikam2002/api-monitoring-system/tree/master/server/src/services/client/repository"
click node_ingest_routes "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/routes/ingestRoutes.js"
click node_ingest_controller "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/controller/ingestController.js"
click node_ingest_service "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/services/ingestServices.js"
click node_producer "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/events/producer/eventProducer.js"
click node_queue "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/rabbitmq.js"
click node_consumer "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/consumer.js"
click node_processor "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/service/ProcessorService.js"
click node_metrics "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/repository/MetricsRepository.js"
click node_analytics_routes "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/routes/analyticsRoutes.js"
click node_analytics_controller "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/controller/analyticsController.js"
click node_analytics_service "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/services/analyticsService.js"
click node_server "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/server.js"
click node_mongo "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/mongodb.js"
click node_postgres "https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/postgres.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_login,node_layout,node_overview,node_settings,node_query,node_api,node_dashboard_views,node_api_caller,node_user toneBlue
class node_auth_routes,node_auth_service,node_users,node_client_routes,node_client_service,node_client_store toneAmber
class node_ingest_routes,node_ingest_controller,node_ingest_service,node_producer,node_queue toneMint
class node_consumer,node_processor,node_metrics,node_analytics_routes,node_analytics_controller,node_analytics_service toneRose
class node_server,node_mongo,node_postgres toneIndigo
```

## Components

### Dashboard

- [Dashboard app](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Login](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/components/Login.jsx): `dashboard/src/components/Login.jsx`
- [Dashboard layout](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/components/layout/DashboardLayout.jsx): `dashboard/src/components/layout/DashboardLayout.jsx`
- [Overview page](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/pages/OverviewPage.jsx): `dashboard/src/pages/OverviewPage.jsx`
- [Settings page](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/pages/SettingsPage.jsx): `dashboard/src/pages/SettingsPage.jsx`
- [Dashboard query](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/hooks/useDashboardQuery.js): `dashboard/src/hooks/useDashboardQuery.js`
- [Dashboard API client](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/dashboard/src/api/api.js): `dashboard/src/api/api.js`
- [Stats and charts](https://github.com/rahulnikam2002/api-monitoring-system/tree/master/dashboard/src/components): `dashboard/src/components`

### Identity and clients

- [Auth routes](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/routes/authRouter.js): `server/src/services/auth/routes/authRouter.js`
- [Auth service](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/service/authService.js): `server/src/services/auth/service/authService.js`
- [User repository](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/auth/repository/UserRepository.js): `server/src/services/auth/repository/UserRepository.js`
- [Client routes](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/client/routes/clientRoutes.js): `server/src/services/client/routes/clientRoutes.js`
- [Client service](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/client/services/clientService.js): `server/src/services/client/services/clientService.js`
- [Client and key stores](https://github.com/rahulnikam2002/api-monitoring-system/tree/master/server/src/services/client/repository): `server/src/services/client/repository`

### Hit ingestion

- [Ingest routes](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/routes/ingestRoutes.js): `server/src/services/ingest/routes/ingestRoutes.js`
- [Ingest controller](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/controller/ingestController.js): `server/src/services/ingest/controller/ingestController.js`
- [Ingest service](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/ingest/services/ingestServices.js): `server/src/services/ingest/services/ingestServices.js`
- [Event producer](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/events/producer/eventProducer.js): `server/src/shared/events/producer/eventProducer.js`
- [RabbitMQ queue](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/rabbitmq.js): `server/src/shared/config/rabbitmq.js`

### Processing and analytics

- [Event consumer](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/consumer.js): `server/src/services/processor/consumer.js`
- [Hit processor](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/service/ProcessorService.js): `server/src/services/processor/service/ProcessorService.js`
- [Metrics repository](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/processor/repository/MetricsRepository.js): `server/src/services/processor/repository/MetricsRepository.js`
- [Analytics routes](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/routes/analyticsRoutes.js): `server/src/services/analytics/routes/analyticsRoutes.js`
- [Analytics controller](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/controller/analyticsController.js): `server/src/services/analytics/controller/analyticsController.js`
- [Analytics service](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/services/analytics/services/analyticsService.js): `server/src/services/analytics/services/analyticsService.js`

### Shared platform

- [HTTP server](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/server.js): `server/src/server.js`
- [MongoDB](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/mongodb.js): `server/src/shared/config/mongodb.js`
- [PostgreSQL](https://github.com/rahulnikam2002/api-monitoring-system/blob/master/server/src/shared/config/postgres.js): `server/src/shared/config/postgres.js`

### Other components

- **API client**
- **Dashboard user**

## Connections

- Dashboard user → Dashboard app: opens (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Login: renders (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Dashboard layout: renders (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Overview page: routes to (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Settings page: routes to (evidence: `dashboard/src/App.jsx`)
- Login → Dashboard API client: auth requests (evidence: `dashboard/src/components/Login.jsx`)
- Overview page → Dashboard query: loads data (evidence: `dashboard/src/pages/OverviewPage.jsx`)
- Overview page → Stats and charts: renders (evidence: `dashboard/src/pages/OverviewPage.jsx`)
- Settings page → Stats and charts: renders (evidence: `dashboard/src/pages/SettingsPage.jsx`)
- Dashboard query → Dashboard API client: fetches dashboard (evidence: `dashboard/src/hooks/useDashboardQuery.js`)
- Dashboard API client → HTTP server: HTTP requests (evidence: `dashboard/src/api/api.js`)
- API client → HTTP server: submits hits
- HTTP server → Auth routes: mounts (evidence: `server/src/server.js`)
- HTTP server → Client routes: mounts (evidence: `server/src/server.js`)
- HTTP server → Ingest routes: mounts (evidence: `server/src/server.js`)
- HTTP server → Analytics routes: mounts (evidence: `server/src/server.js`)
- Auth routes → Auth service: dispatches
- Auth service → User repository: reads and writes
- Client routes → Client service: dispatches (evidence: `server/src/services/client/routes/clientRoutes.js`)
- Client service → Client and key stores: uses repositories
- Ingest routes → Ingest controller: dispatches (evidence: `server/src/services/ingest/routes/ingestRoutes.js`)
- Ingest controller → Ingest service: submits hit (evidence: `server/src/services/ingest/controller/ingestController.js`)
- Ingest service → Event producer: publishes event (evidence: `server/src/services/ingest/services/ingestServices.js`)
- Event producer → RabbitMQ queue: enqueues event
- RabbitMQ queue → Event consumer: delivers event
- Event consumer → Hit processor: dispatches
- Hit processor → Metrics repository: stores metrics
- Analytics routes → Analytics controller: dispatches
- Analytics controller → Analytics service: requests analytics
- Analytics service → Metrics repository: reads metrics
- HTTP server → MongoDB: connects (evidence: `server/src/server.js`)
- HTTP server → PostgreSQL: connects (evidence: `server/src/server.js`)
