# ericksonathome/uts7 architecture

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

- Interactive diagram: https://gitdiagram.com/ericksonathome/uts7
- Repository: https://github.com/ericksonathome/uts7

## Overview

UTS7 is a Next.js user-tracking app. A visitor loads the page, which collects IP, browser/device, screen, system, and initial geolocation data, then posts it to the tracking API for email delivery. The page also starts live geolocation updates, displays coordinates, and posts each update for email delivery. The sampled source supports these collection, enrichment, dispatch, and notification paths; it does not show persistent storage.

Main entry points: [`app/utils/collectors/userDataCollector.ts`](https://github.com/ericksonathome/uts7/blob/main/app/utils/collectors/userDataCollector.ts) (Data Collector), [`app/page.tsx`](https://github.com/ericksonathome/uts7/blob/main/app/page.tsx) (Tracking Page), [`app/utils/services/liveLocationService.ts`](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/liveLocationService.ts) (Live Tracker), [`app/utils/services/emailService.ts`](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/emailService.ts) (Email Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser Tracking"]
  node_page["Tracking Page<br/>[page.tsx]"]
  node_collector["Data Collector"]
  node_browser["Browser Data<br/>[browserService.ts]"]
  node_ip["IP Lookup<br/>[ipService.ts]"]
  node_location["Location Service<br/>[locationService.ts]"]
  node_live["Live Tracker"]
end

subgraph group_server["Tracking API"]
  node_trackapi["Track Endpoint<br/>[route.ts]"]
  node_types["Tracking Types<br/>[index.ts]"]
end

subgraph group_notify["Email Notifications"]
  node_email["Email Service<br/>[emailService.ts]"]
  node_emailconfig["Email Config<br/>[email.ts]"]
end

node_visitor(("Visitor"))
node_geoapi["Geolocation API"]
node_ipify["IPify"]
node_nominatim["Nominatim"]
node_mailer["Email Provider"]

node_visitor -->|"visits"| node_page
node_page -->|"collects via"| node_collector
node_collector -->|"gets IP"| node_ip
node_collector -->|"gets device data"| node_browser
node_collector -->|"gets location"| node_location
node_collector -->|"enriches address"| node_nominatim
node_ip -->|"looks up IP"| node_ipify
node_location -->|"requests position"| node_geoapi
node_page -->|"starts tracker"| node_live
node_live -->|"watches position"| node_geoapi
node_live -->|"dispatches updates"| node_page
node_page -->|"posts visit and updates"| node_trackapi
node_trackapi -->|"sends tracking data"| node_email
node_email -->|"reads settings"| node_emailconfig
node_email -->|"sends email"| node_mailer

click node_page "https://github.com/ericksonathome/uts7/blob/main/app/page.tsx"
click node_collector "https://github.com/ericksonathome/uts7/blob/main/app/utils/collectors/userDataCollector.ts"
click node_browser "https://github.com/ericksonathome/uts7/blob/main/app/utils/services/browserService.ts"
click node_ip "https://github.com/ericksonathome/uts7/blob/main/app/utils/services/ipService.ts"
click node_location "https://github.com/ericksonathome/uts7/blob/main/app/utils/services/locationService.ts"
click node_live "https://github.com/ericksonathome/uts7/blob/main/app/utils/services/liveLocationService.ts"
click node_trackapi "https://github.com/ericksonathome/uts7/blob/main/app/api/track/route.ts"
click node_types "https://github.com/ericksonathome/uts7/blob/main/app/utils/types/index.ts"
click node_email "https://github.com/ericksonathome/uts7/blob/main/app/utils/services/emailService.ts"
click node_emailconfig "https://github.com/ericksonathome/uts7/blob/main/app/utils/config/email.ts"

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_page,node_collector,node_browser,node_ip,node_location,node_live toneBlue
class node_trackapi,node_types toneAmber
class node_email,node_emailconfig,node_geoapi toneMint
class node_visitor,node_ipify,node_nominatim,node_mailer toneIndigo
```

## Components

### Browser Tracking

- [Tracking Page](https://github.com/ericksonathome/uts7/blob/main/app/page.tsx): `app/page.tsx`
- [Data Collector](https://github.com/ericksonathome/uts7/blob/main/app/utils/collectors/userDataCollector.ts): `app/utils/collectors/userDataCollector.ts`
- [Browser Data](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/browserService.ts): `app/utils/services/browserService.ts`
- [IP Lookup](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/ipService.ts): `app/utils/services/ipService.ts`
- [Location Service](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/locationService.ts): `app/utils/services/locationService.ts`
- [Live Tracker](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/liveLocationService.ts): `app/utils/services/liveLocationService.ts`

### Tracking API

- [Track Endpoint](https://github.com/ericksonathome/uts7/blob/main/app/api/track/route.ts): `app/api/track/route.ts`
- [Tracking Types](https://github.com/ericksonathome/uts7/blob/main/app/utils/types/index.ts): `app/utils/types/index.ts`

### Email Notifications

- [Email Service](https://github.com/ericksonathome/uts7/blob/main/app/utils/services/emailService.ts): `app/utils/services/emailService.ts`
- [Email Config](https://github.com/ericksonathome/uts7/blob/main/app/utils/config/email.ts): `app/utils/config/email.ts`

### Other components

- **Visitor**
- **Geolocation API**
- **IPify**
- **Nominatim**
- **Email Provider**

## Connections

- Visitor → Tracking Page: visits
- Tracking Page → Data Collector: collects via
- Data Collector → IP Lookup: gets IP
- Data Collector → Browser Data: gets device data
- Data Collector → Location Service: gets location
- Data Collector → Nominatim: enriches address
- IP Lookup → IPify: looks up IP
- Location Service → Geolocation API: requests position
- Tracking Page → Live Tracker: starts tracker
- Live Tracker → Geolocation API: watches position
- Live Tracker → Tracking Page: dispatches updates
- Tracking Page → Track Endpoint: posts visit and updates
- Track Endpoint → Email Service: sends tracking data
- Email Service → Email Config: reads settings
- Email Service → Email Provider: sends email
