# rahulburugoju/linkpulse architecture

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

- Interactive diagram: https://gitdiagram.com/rahulburugoju/linkpulse
- Repository: https://github.com/rahulburugoju/linkpulse

## Overview

LinkPulse provides account authentication, owned short-link management, fast redirection, and click analytics through four services behind an API gateway. The main workflow is client request → gateway routing → URL creation or short-code resolution → redirect and click-event capture → analytics aggregation. The graph combines documented service boundaries and infrastructure with source-index and excerpted call relationships; unsampled internals are represented only where the README or tree supports them.

Main entry points: [`services/api-gateway/src/app.js`](https://github.com/rahulburugoju/linkpulse/blob/main/services/api-gateway/src/app.js) (API gateway), [`services/redirect-service/src/controllers/redirect.controller.js`](https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/controllers/redirect.controller.js) (Redirect handler), [`services/user-service/src/services/auth.service.js`](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/services/auth.service.js) (Auth operations), [`services/user-service/src/routes/auth.routes.js`](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/routes/auth.routes.js) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Entry and routing"]
  node_gateway["API gateway<br/>[app.js]"]
end

subgraph group_identity["Identity"]
  node_user_api["Auth endpoints<br/>[auth.routes.js]"]
  node_auth_controller["Auth handlers<br/>[auth.controller.js]"]
  node_auth_service["Auth operations<br/>[auth.service.js]"]
  node_user_model[("User records<br/>[user.model.js]")]
  node_auth_tokens["Token utilities<br/>[auth.util.js]"]
end

subgraph group_links["Short links"]
  node_url_routes["URL endpoints<br/>[utl.routes.js]"]
  node_url_controller["URL handlers<br/>[url.controller.js]"]
  node_url_service["URL operations<br/>[url.service.js]"]
  node_url_model[("URL records<br/>[url.model.js]")]
end

subgraph group_redirect["Redirect and events"]
  node_redirect_routes["Short-code endpoint<br/>[redirect.routes.js]"]
  node_redirect_controller["Redirect handler"]
  node_redirect_service["Destination lookup"]
  node_redirect_model[("Redirect URL records")]
  node_redis[("Redis cache")]
  node_kafka["Kafka broker"]
end

subgraph group_analytics["Analytics"]
  node_analytics_consumer["Click-event consumer<br/>[consumer.js]"]
  node_analytics_routes["Analytics endpoints"]
  node_analytics_controller["Analytics queries"]
  node_click_records[("Click-event records")]
end

node_client(("Client / browser"))

node_client -->|"sends requests"| node_gateway
node_gateway -->|"proxies auth"| node_user_api
node_gateway -->|"proxies URL requests"| node_url_routes
node_gateway -->|"proxies short codes"| node_redirect_routes
node_gateway -->|"proxies analytics"| node_analytics_routes
node_user_api -->|"dispatches"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"reads and writes"| node_user_model
node_auth_service -->|"creates and verifies"| node_auth_tokens
node_url_routes -->|"dispatches"| node_url_controller
node_url_controller -->|"calls"| node_url_service
node_url_service -->|"reads and writes"| node_url_model
node_redirect_routes -->|"dispatches"| node_redirect_controller
node_redirect_controller -->|"looks up destination"| node_redirect_service
node_redirect_service -->|"queries"| node_redirect_model
node_redirect_controller -->|"reads and writes cache"| node_redis
node_redirect_controller -->|"publishes click event"| node_kafka
node_kafka -->|"delivers events"| node_analytics_consumer
node_analytics_routes -->|"dispatches"| node_analytics_controller
node_analytics_controller -->|"queries analytics data"| node_click_records

click node_gateway "https://github.com/rahulburugoju/linkpulse/blob/main/services/api-gateway/src/app.js"
click node_user_api "https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/routes/auth.routes.js"
click node_auth_controller "https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/controllers/auth.controller.js"
click node_auth_service "https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/services/auth.service.js"
click node_user_model "https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/models/user.model.js"
click node_auth_tokens "https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/util/auth.util.js"
click node_url_routes "https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/routes/utl.routes.js"
click node_url_controller "https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/controllers/url.controller.js"
click node_url_service "https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/services/url.service.js"
click node_url_model "https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/models/url.model.js"
click node_redirect_routes "https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/routes/redirect.routes.js"
click node_redirect_controller "https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/controllers/redirect.controller.js"
click node_redirect_service "https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/services/redirect.services.js"
click node_redirect_model "https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/models/redirectUrl.model.js"
click node_analytics_consumer "https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/consumer.js"
click node_analytics_routes "https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/routes/analytics.routes.js"
click node_analytics_controller "https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/controllers/analytics.controller.js"
click node_click_records "https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/models/click-event.model.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_gateway,node_client toneBlue
class node_user_api,node_auth_controller,node_auth_service,node_user_model,node_auth_tokens toneAmber
class node_url_routes,node_url_controller,node_url_service,node_url_model toneMint
class node_redirect_routes,node_redirect_controller,node_redirect_service,node_redirect_model,node_redis,node_kafka toneRose
class node_analytics_consumer,node_analytics_routes,node_analytics_controller,node_click_records toneIndigo
```

## Components

### Entry and routing

- [API gateway](https://github.com/rahulburugoju/linkpulse/blob/main/services/api-gateway/src/app.js): `services/api-gateway/src/app.js`

### Identity

- [Auth endpoints](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/routes/auth.routes.js): `services/user-service/src/routes/auth.routes.js`
- [Auth handlers](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/controllers/auth.controller.js): `services/user-service/src/controllers/auth.controller.js`
- [Auth operations](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/services/auth.service.js): `services/user-service/src/services/auth.service.js`
- [User records](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/models/user.model.js): `services/user-service/src/models/user.model.js`
- [Token utilities](https://github.com/rahulburugoju/linkpulse/blob/main/services/user-service/src/util/auth.util.js): `services/user-service/src/util/auth.util.js`

### Short links

- [URL endpoints](https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/routes/utl.routes.js): `services/url-service/src/routes/utl.routes.js`
- [URL handlers](https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/controllers/url.controller.js): `services/url-service/src/controllers/url.controller.js`
- [URL operations](https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/services/url.service.js): `services/url-service/src/services/url.service.js`
- [URL records](https://github.com/rahulburugoju/linkpulse/blob/main/services/url-service/src/models/url.model.js): `services/url-service/src/models/url.model.js`

### Redirect and events

- [Short-code endpoint](https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/routes/redirect.routes.js): `services/redirect-service/src/routes/redirect.routes.js`
- [Redirect handler](https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/controllers/redirect.controller.js): `services/redirect-service/src/controllers/redirect.controller.js`
- [Destination lookup](https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/services/redirect.services.js): `services/redirect-service/src/services/redirect.services.js`
- [Redirect URL records](https://github.com/rahulburugoju/linkpulse/blob/main/services/redirect-service/src/models/redirectUrl.model.js): `services/redirect-service/src/models/redirectUrl.model.js`
- **Redis cache**
- **Kafka broker**

### Analytics

- [Click-event consumer](https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/consumer.js): `services/analytics-service/src/consumer.js`
- [Analytics endpoints](https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/routes/analytics.routes.js): `services/analytics-service/src/routes/analytics.routes.js`
- [Analytics queries](https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/controllers/analytics.controller.js): `services/analytics-service/src/controllers/analytics.controller.js`
- [Click-event records](https://github.com/rahulburugoju/linkpulse/blob/main/services/analytics-service/src/models/click-event.model.js): `services/analytics-service/src/models/click-event.model.js`

### Other components

- **Client / browser**

## Connections

- Client / browser → API gateway: sends requests
- API gateway → Auth endpoints: proxies auth
- API gateway → URL endpoints: proxies URL requests
- API gateway → Short-code endpoint: proxies short codes
- API gateway → Analytics endpoints: proxies analytics
- Auth endpoints → Auth handlers: dispatches (evidence: `services/user-service/src/routes/auth.routes.js`)
- Auth handlers → Auth operations: calls (evidence: `services/user-service/src/controllers/auth.controller.js`)
- Auth operations → User records: reads and writes (evidence: `services/user-service/src/services/auth.service.js`)
- Auth operations → Token utilities: creates and verifies (evidence: `services/user-service/src/services/auth.service.js`)
- URL endpoints → URL handlers: dispatches (evidence: `services/url-service/src/routes/utl.routes.js`)
- URL handlers → URL operations: calls (evidence: `services/url-service/src/controllers/url.controller.js`)
- URL operations → URL records: reads and writes (evidence: `services/url-service/src/services/url.service.js`)
- Short-code endpoint → Redirect handler: dispatches (evidence: `services/redirect-service/src/routes/redirect.routes.js`)
- Redirect handler → Destination lookup: looks up destination (evidence: `services/redirect-service/src/controllers/redirect.controller.js`)
- Destination lookup → Redirect URL records: queries (evidence: `services/redirect-service/src/services/redirect.services.js`)
- Redirect handler → Redis cache: reads and writes cache (evidence: `services/redirect-service/src/controllers/redirect.controller.js`)
- Redirect handler → Kafka broker: publishes click event (evidence: `services/redirect-service/src/controllers/redirect.controller.js`)
- Kafka broker → Click-event consumer: delivers events
- Analytics endpoints → Analytics queries: dispatches (evidence: `services/analytics-service/src/routes/analytics.routes.js`)
- Analytics queries → Click-event records: queries analytics data (evidence: `services/analytics-service/src/controllers/analytics.controller.js`)
