# prateekm180/aet---astronomical-event-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/prateekm180/aet---astronomical-event-tracker
- Repository: https://github.com/prateekm180/aet---astronomical-event-tracker

## Overview

AET is an astronomical-event tracker with a web interface and a Fastify API. Its backend accepts event data, enriches events asynchronously, matches visibility regions to user locations, and schedules notifications. Users can register, browse events, and request personalized viewing insight; the frontend also exposes login, registration, event detail, and dashboard routes. The README provides no further capability details, and several frontend pages and notification modules were not sampled, so uncertain connections are omitted.

Main entry points: [`backend/src/lib/prisma.ts`](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/lib/prisma.ts) (Prisma database), [`backend/src/server.ts`](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/server.ts) (Fastify server), [`backend/src/agents/agentAWorker.ts`](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/agents/agentAWorker.ts) (AI enrichment), [`frontend/src/App.tsx`](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/App.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App routes<br/>[App.tsx]"]
  node_authhook["Auth state<br/>[useAuth.ts]"]
  node_apiclient["API client<br/>[clients.ts]"]
  node_pages["User pages"]
end

subgraph group_api["API and identity"]
  node_server["Fastify server<br/>[server.ts]"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_eventroutes["Event routes<br/>[events.routes.ts]"]
  node_eventservice["Event service<br/>[events.service.ts]"]
  node_usersroutes["Profile routes<br/>[users.routes.ts]"]
  node_userservice["User service<br/>[users.service.ts]"]
  node_database[("Prisma database<br/>[prisma.ts]")]
end

subgraph group_events["Event processing"]
  node_ingestion["Event ingestion<br/>[ingestEvent.ts]"]
  node_queues["Job queues<br/>[queues.ts]"]
  node_agentaworker["AI enrichment<br/>[agentAWorker.ts]"]
  node_geomatch["Visibility matching<br/>[geoMatchWorker.ts]"]
  node_agentb["Personalized insight<br/>[agentB.ts]"]
  node_weather["Weather data<br/>[weather.ts]"]
  node_lightpollution["Light pollution<br/>[lightPollution.ts]"]
end

subgraph group_notify["Personalized notifications"]
  node_scheduling["Notification scheduling<br/>[schedule.worker.ts]"]
  node_dispatch["Notification dispatch<br/>[dispatch.worker.ts]"]
  node_push["Push provider<br/>[pushProvider.ts]"]
end

node_visitor(("Visitor"))
node_anthropic["Anthropic API"]

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_pages
node_app -->|"reads auth"| node_authhook
node_authhook -->|"requests profile"| node_apiclient
node_server -->|"registers"| node_authroutes
node_server -->|"registers"| node_eventroutes
node_server -->|"registers"| node_usersroutes
node_authroutes -->|"calls"| node_authservice
node_authroutes -->|"reads user"| node_database
node_authservice -->|"reads and writes"| node_database
node_eventroutes -->|"calls"| node_eventservice
node_eventroutes -->|"requests insight"| node_agentb
node_eventservice -->|"reads events"| node_database
node_usersroutes -->|"calls"| node_userservice
node_userservice -->|"updates profile"| node_database
node_ingestion -->|"creates event"| node_database
node_ingestion -->|"enqueues jobs"| node_queues
node_agentaworker -->|"consumes jobs"| node_queues
node_agentaworker -->|"requests enrichment"| node_anthropic
node_agentaworker -->|"updates event"| node_database
node_geomatch -->|"enqueues schedules"| node_queues
node_geomatch -->|"matches users"| node_database

click node_app "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/App.tsx"
click node_authhook "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/hooks/useAuth.ts"
click node_apiclient "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/api/clients.ts"
click node_pages "https://github.com/prateekm180/aet---astronomical-event-tracker/tree/main/frontend/src/Pages"
click node_server "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/server.ts"
click node_authroutes "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/auth/auth.routes.ts"
click node_authservice "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/auth/auth.service.ts"
click node_eventroutes "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/events/events.routes.ts"
click node_eventservice "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/events/events.service.ts"
click node_usersroutes "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/users/users.routes.ts"
click node_userservice "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/users/users.service.ts"
click node_database "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/lib/prisma.ts"
click node_ingestion "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/ingestion/ingestEvent.ts"
click node_queues "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/lib/queues.ts"
click node_agentaworker "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/agents/agentAWorker.ts"
click node_geomatch "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/geo/geoMatchWorker.ts"
click node_agentb "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/agents/agentB.ts"
click node_scheduling "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/notifications/schedule.worker.ts"
click node_dispatch "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/notifications/dispatch.worker.ts"
click node_push "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/delivery/pushProvider.ts"
click node_weather "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/external/weather.ts"
click node_lightpollution "https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/external/lightPollution.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_app,node_authhook,node_apiclient,node_pages toneBlue
class node_server,node_authroutes,node_authservice,node_eventroutes,node_eventservice,node_usersroutes,node_userservice,node_database toneAmber
class node_ingestion,node_queues,node_agentaworker,node_geomatch,node_agentb,node_weather,node_lightpollution,node_anthropic toneMint
class node_scheduling,node_dispatch,node_push toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth state](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/hooks/useAuth.ts): `frontend/src/hooks/useAuth.ts`
- [API client](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/frontend/src/api/clients.ts): `frontend/src/api/clients.ts`
- [User pages](https://github.com/prateekm180/aet---astronomical-event-tracker/tree/main/frontend/src/Pages): `frontend/src/Pages`

### API and identity

- [Fastify server](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Auth routes](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/auth/auth.routes.ts): `backend/src/modules/auth/auth.routes.ts`
- [Auth service](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/auth/auth.service.ts): `backend/src/modules/auth/auth.service.ts`
- [Event routes](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/events/events.routes.ts): `backend/src/modules/events/events.routes.ts`
- [Event service](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/events/events.service.ts): `backend/src/modules/events/events.service.ts`
- [Profile routes](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/users/users.routes.ts): `backend/src/modules/users/users.routes.ts`
- [User service](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/users/users.service.ts): `backend/src/modules/users/users.service.ts`
- [Prisma database](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`

### Event processing

- [Event ingestion](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/ingestion/ingestEvent.ts): `backend/src/ingestion/ingestEvent.ts`
- [Job queues](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/lib/queues.ts): `backend/src/lib/queues.ts`
- [AI enrichment](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/agents/agentAWorker.ts): `backend/src/agents/agentAWorker.ts`
- [Visibility matching](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/geo/geoMatchWorker.ts): `backend/src/geo/geoMatchWorker.ts`
- [Personalized insight](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/agents/agentB.ts): `backend/src/agents/agentB.ts`
- [Weather data](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/external/weather.ts): `backend/src/external/weather.ts`
- [Light pollution](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/external/lightPollution.ts): `backend/src/external/lightPollution.ts`

### Personalized notifications

- [Notification scheduling](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/notifications/schedule.worker.ts): `backend/src/modules/notifications/schedule.worker.ts`
- [Notification dispatch](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/modules/notifications/dispatch.worker.ts): `backend/src/modules/notifications/dispatch.worker.ts`
- [Push provider](https://github.com/prateekm180/aet---astronomical-event-tracker/blob/main/backend/src/delivery/pushProvider.ts): `backend/src/delivery/pushProvider.ts`

### Other components

- **Visitor**
- **Anthropic API**

## Connections

- Visitor → App routes: uses
- App routes → User pages: routes to
- App routes → Auth state: reads auth
- Auth state → API client: requests profile
- Fastify server → Auth routes: registers
- Fastify server → Event routes: registers
- Fastify server → Profile routes: registers
- Auth routes → Auth service: calls
- Auth routes → Prisma database: reads user
- Auth service → Prisma database: reads and writes
- Event routes → Event service: calls
- Event routes → Personalized insight: requests insight
- Event service → Prisma database: reads events
- Profile routes → User service: calls
- User service → Prisma database: updates profile
- Event ingestion → Prisma database: creates event
- Event ingestion → Job queues: enqueues jobs
- AI enrichment → Job queues: consumes jobs
- AI enrichment → Anthropic API: requests enrichment
- AI enrichment → Prisma database: updates event
- Visibility matching → Job queues: enqueues schedules
- Visibility matching → Prisma database: matches users
