# khanhquyenkqvk/aspace architecture

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

- Interactive diagram: https://gitdiagram.com/khanhquyenkqvk/aspace
- Repository: https://github.com/khanhquyenkqvk/aspace

## Overview

Cosmic Explorer is an astronomy exploration website. Visitors browse interactive planet, star, constellation, galaxy, and Big Bang experiences; a separate observing workflow gathers a location and presents recommendations, maps, events, and notifications. The graph emphasizes documented page-to-component calls, the galaxy fetch route, and the location/database relationship visible in the source index. Other API capabilities are retained as a grouped subsystem because the README and tree establish them, but unsampled route-to-provider or page-to-route relationships are not inferred.

Main entry points: [`app/recommendations/page.tsx`](https://github.com/khanhquyenkqvk/aspace/blob/main/app/recommendations/page.tsx) (Observing planner), [`app/galaxies/page.tsx`](https://github.com/khanhquyenkqvk/aspace/blob/main/app/galaxies/page.tsx) (Galaxy explorer), [`app/page.tsx`](https://github.com/khanhquyenkqvk/aspace/blob/main/app/page.tsx) (Explore home), [`app/stars/page.tsx`](https://github.com/khanhquyenkqvk/aspace/blob/main/app/stars/page.tsx) (Star catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Astronomy experiences"]
  node_home["Explore home<br/>[page.tsx]"]
  node_solar["Solar system"]
  node_planet["Planet details<br/>[page.tsx]"]
  node_stars["Star catalog<br/>[page.tsx]"]
  node_star_detail["Star details"]
  node_star_map["Star map<br/>[star-map.tsx]"]
  node_constellations["Constellations<br/>[page.tsx]"]
  node_galaxies["Galaxy explorer<br/>[page.tsx]"]
  node_galaxy_viz["Galaxy simulation<br/>[galaxy-3d.tsx]"]
  node_bigbang["Big Bang page<br/>[page.tsx]"]
  node_bigbang_viz["Cosmic timeline"]
  node_discover["Discover<br/>[page.tsx]"]
  node_nebula["Nebula explorer<br/>[page.tsx]"]
end

subgraph group_observing["Observing tools"]
  node_observe["Observing planner<br/>[page.tsx]"]
  node_recommendations["Viewing recommendations"]
  node_location_map["Location map<br/>[location-map.tsx]"]
  node_events["Event schedule<br/>[event-schedule.tsx]"]
  node_notifications["Notifications"]
end

subgraph group_api["API capabilities"]
  node_api_routes["Astronomy and location APIs"]
  node_galaxy_api["Galaxy endpoint<br/>[route.ts]"]
  node_location_api["Location endpoint<br/>[route.ts]"]
  node_nasa_apis["NASA endpoints"]
end

subgraph group_data["Data and storage"]
  node_mysql[("MySQL pool<br/>[mysql-client.ts]")]
  node_constellation_data["Constellation data"]
  node_astronomy_data["Astronomy data<br/>[astronomy-data.ts]"]
end

node_visitor(("Visitor"))
node_mysql_service[("MySQL database")]
node_nasa_service["NASA APIs"]

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_solar
node_visitor -.->|"browses"| node_stars
node_stars -->|"offers"| node_star_map
node_visitor -.->|"browses"| node_constellations
node_constellations -->|"uses"| node_constellation_data
node_visitor -.->|"explores"| node_galaxies
node_galaxies -->|"fetches"| node_galaxy_api
node_galaxies -.->|"renders"| node_galaxy_viz
node_visitor -.->|"explores"| node_bigbang
node_bigbang -->|"renders"| node_bigbang_viz
node_visitor -.->|"views"| node_planet
node_visitor -.->|"views"| node_star_detail
node_visitor -.->|"browses"| node_discover
node_visitor -.->|"browses"| node_nebula
node_visitor -->|"plans"| node_observe
node_observe -->|"renders"| node_recommendations
node_observe -->|"renders"| node_location_map
node_observe -->|"renders"| node_events
node_observe -->|"renders"| node_notifications
node_visitor -.->|"requests"| node_api_routes
node_api_routes -.->|"includes"| node_nasa_apis
node_visitor -.->|"queries"| node_nasa_service
node_location_api -->|"uses"| node_mysql
node_mysql -->|"connects"| node_mysql_service

click node_home "https://github.com/khanhquyenkqvk/aspace/blob/main/app/page.tsx"
click node_solar "https://github.com/khanhquyenkqvk/aspace/blob/main/components/3d-solar-system.tsx"
click node_planet "https://github.com/khanhquyenkqvk/aspace/blob/main/app/planets/%5Bslug%5D/page.tsx"
click node_stars "https://github.com/khanhquyenkqvk/aspace/blob/main/app/stars/page.tsx"
click node_star_detail "https://github.com/khanhquyenkqvk/aspace/blob/main/components/star-detail-client.tsx"
click node_star_map "https://github.com/khanhquyenkqvk/aspace/blob/main/components/star-map.tsx"
click node_constellations "https://github.com/khanhquyenkqvk/aspace/blob/main/app/stars/constellations/page.tsx"
click node_galaxies "https://github.com/khanhquyenkqvk/aspace/blob/main/app/galaxies/page.tsx"
click node_galaxy_viz "https://github.com/khanhquyenkqvk/aspace/blob/main/components/galaxy-3d.tsx"
click node_bigbang "https://github.com/khanhquyenkqvk/aspace/blob/main/app/big-bang/page.tsx"
click node_bigbang_viz "https://github.com/khanhquyenkqvk/aspace/blob/main/components/big-bang-simulation-3d.tsx"
click node_discover "https://github.com/khanhquyenkqvk/aspace/blob/main/app/discover/page.tsx"
click node_nebula "https://github.com/khanhquyenkqvk/aspace/blob/main/app/nebula/page.tsx"
click node_observe "https://github.com/khanhquyenkqvk/aspace/blob/main/app/recommendations/page.tsx"
click node_recommendations "https://github.com/khanhquyenkqvk/aspace/blob/main/components/astronomy-recommendations.tsx"
click node_location_map "https://github.com/khanhquyenkqvk/aspace/blob/main/components/location-map.tsx"
click node_events "https://github.com/khanhquyenkqvk/aspace/blob/main/components/event-schedule.tsx"
click node_notifications "https://github.com/khanhquyenkqvk/aspace/blob/main/components/notification-service.tsx"
click node_api_routes "https://github.com/khanhquyenkqvk/aspace/tree/main/app/api"
click node_galaxy_api "https://github.com/khanhquyenkqvk/aspace/blob/main/app/api/galaxies/route.ts"
click node_location_api "https://github.com/khanhquyenkqvk/aspace/blob/main/app/api/location/route.ts"
click node_nasa_apis "https://github.com/khanhquyenkqvk/aspace/tree/main/app/api/nasa"
click node_mysql "https://github.com/khanhquyenkqvk/aspace/blob/main/lib/mysql-client.ts"
click node_constellation_data "https://github.com/khanhquyenkqvk/aspace/blob/main/lib/constellations-data.ts"
click node_astronomy_data "https://github.com/khanhquyenkqvk/aspace/blob/main/lib/astronomy-data.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_home,node_solar,node_planet,node_stars,node_star_detail,node_star_map,node_constellations,node_galaxies,node_galaxy_viz,node_bigbang,node_bigbang_viz,node_discover,node_nebula toneBlue
class node_observe,node_recommendations,node_location_map,node_events,node_notifications,node_mysql_service toneAmber
class node_api_routes,node_galaxy_api,node_location_api,node_nasa_apis,node_nasa_service toneMint
class node_mysql,node_constellation_data,node_astronomy_data toneRose
class node_visitor toneIndigo
```

## Components

### Astronomy experiences

- [Explore home](https://github.com/khanhquyenkqvk/aspace/blob/main/app/page.tsx): `app/page.tsx`
- [Solar system](https://github.com/khanhquyenkqvk/aspace/blob/main/components/3d-solar-system.tsx): `components/3d-solar-system.tsx`
- [Planet details](https://github.com/khanhquyenkqvk/aspace/blob/main/app/planets/%5Bslug%5D/page.tsx): `app/planets/[slug]/page.tsx`
- [Star catalog](https://github.com/khanhquyenkqvk/aspace/blob/main/app/stars/page.tsx): `app/stars/page.tsx`
- [Star details](https://github.com/khanhquyenkqvk/aspace/blob/main/components/star-detail-client.tsx): `components/star-detail-client.tsx`
- [Star map](https://github.com/khanhquyenkqvk/aspace/blob/main/components/star-map.tsx): `components/star-map.tsx`
- [Constellations](https://github.com/khanhquyenkqvk/aspace/blob/main/app/stars/constellations/page.tsx): `app/stars/constellations/page.tsx`
- [Galaxy explorer](https://github.com/khanhquyenkqvk/aspace/blob/main/app/galaxies/page.tsx): `app/galaxies/page.tsx`
- [Galaxy simulation](https://github.com/khanhquyenkqvk/aspace/blob/main/components/galaxy-3d.tsx): `components/galaxy-3d.tsx`
- [Big Bang page](https://github.com/khanhquyenkqvk/aspace/blob/main/app/big-bang/page.tsx): `app/big-bang/page.tsx`
- [Cosmic timeline](https://github.com/khanhquyenkqvk/aspace/blob/main/components/big-bang-simulation-3d.tsx): `components/big-bang-simulation-3d.tsx`
- [Discover](https://github.com/khanhquyenkqvk/aspace/blob/main/app/discover/page.tsx): `app/discover/page.tsx`
- [Nebula explorer](https://github.com/khanhquyenkqvk/aspace/blob/main/app/nebula/page.tsx): `app/nebula/page.tsx`

### Observing tools

- [Observing planner](https://github.com/khanhquyenkqvk/aspace/blob/main/app/recommendations/page.tsx): `app/recommendations/page.tsx`
- [Viewing recommendations](https://github.com/khanhquyenkqvk/aspace/blob/main/components/astronomy-recommendations.tsx): `components/astronomy-recommendations.tsx`
- [Location map](https://github.com/khanhquyenkqvk/aspace/blob/main/components/location-map.tsx): `components/location-map.tsx`
- [Event schedule](https://github.com/khanhquyenkqvk/aspace/blob/main/components/event-schedule.tsx): `components/event-schedule.tsx`
- [Notifications](https://github.com/khanhquyenkqvk/aspace/blob/main/components/notification-service.tsx): `components/notification-service.tsx`

### API capabilities

- [Astronomy and location APIs](https://github.com/khanhquyenkqvk/aspace/tree/main/app/api): `app/api`
- [Galaxy endpoint](https://github.com/khanhquyenkqvk/aspace/blob/main/app/api/galaxies/route.ts): `app/api/galaxies/route.ts`
- [Location endpoint](https://github.com/khanhquyenkqvk/aspace/blob/main/app/api/location/route.ts): `app/api/location/route.ts`
- [NASA endpoints](https://github.com/khanhquyenkqvk/aspace/tree/main/app/api/nasa): `app/api/nasa`

### Data and storage

- [MySQL pool](https://github.com/khanhquyenkqvk/aspace/blob/main/lib/mysql-client.ts): `lib/mysql-client.ts`
- [Constellation data](https://github.com/khanhquyenkqvk/aspace/blob/main/lib/constellations-data.ts): `lib/constellations-data.ts`
- [Astronomy data](https://github.com/khanhquyenkqvk/aspace/blob/main/lib/astronomy-data.ts): `lib/astronomy-data.ts`

### Other components

- **Visitor**
- **MySQL database**
- **NASA APIs**

## Connections

- Visitor → Explore home: opens (evidence: `app/page.tsx`)
- Explore home → Solar system: renders (evidence: `app/page.tsx`)
- Visitor → Star catalog: browses
- Star catalog → Star map: offers (evidence: `app/stars/page.tsx`)
- Visitor → Constellations: browses
- Constellations → Constellation data: uses (evidence: `app/stars/constellations/page.tsx`)
- Visitor → Galaxy explorer: explores
- Galaxy explorer → Galaxy endpoint: fetches (evidence: `app/galaxies/page.tsx`)
- Galaxy explorer → Galaxy simulation: renders (evidence: `app/galaxies/page.tsx`)
- Visitor → Big Bang page: explores
- Big Bang page → Cosmic timeline: renders (evidence: `app/big-bang/page.tsx`)
- Visitor → Planet details: views
- Visitor → Star details: views
- Visitor → Discover: browses
- Visitor → Nebula explorer: browses
- Visitor → Observing planner: plans (evidence: `app/recommendations/page.tsx`)
- Observing planner → Viewing recommendations: renders (evidence: `app/recommendations/page.tsx`)
- Observing planner → Location map: renders (evidence: `app/recommendations/page.tsx`)
- Observing planner → Event schedule: renders (evidence: `app/recommendations/page.tsx`)
- Observing planner → Notifications: renders (evidence: `app/recommendations/page.tsx`)
- Visitor → Astronomy and location APIs: requests
- Astronomy and location APIs → NASA endpoints: includes
- Visitor → NASA APIs: queries
- Location endpoint → MySQL pool: uses (evidence: `app/api/location/route.ts`)
- MySQL pool → MySQL database: connects (evidence: `lib/mysql-client.ts`)
