# joshuaduke/cosmiclens architecture

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

- Interactive diagram: https://gitdiagram.com/joshuaduke/cosmiclens
- Repository: https://github.com/joshuaduke/cosmiclens

## Overview

CosmicLens is a Next.js space-image discovery interface. Visitors search from the home page, browse NASA image results, and open an image detail page that fetches NASA metadata; the explore layout also provides telescope and date-range filter controls, though the filter’s URL-update logic is commented out. The UI includes featured discoveries and detail tabs for summaries, descriptions, and facts, but those detail sections are partly placeholder content. The README is a generic Next.js starter and documents no additional product capabilities. Evidence is limited to the README and indexed or excerpted files; unsampled routes are represented only where their paths are known.

Main entry points: [`app/explore/page.tsx`](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/page.tsx) (Explore results page), [`app/explore/search.tsx`](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/search.tsx) (NASA search results), [`components/searchbar.tsx`](https://github.com/joshuaduke/cosmiclens/blob/main/components/searchbar.tsx) (Search bar), [`app/layout.tsx`](https://github.com/joshuaduke/cosmiclens/blob/main/app/layout.tsx) (Application layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery workflow"]
  node_home["Home and featured<br/>[page.tsx]"]
  node_searchbar["Search bar<br/>[searchbar.tsx]"]
  node_explore["Explore results page<br/>[page.tsx]"]
  node_filters["Explore filters<br/>[filter.tsx]"]
  node_results["NASA search results<br/>[search.tsx]"]
  node_detail["Image detail<br/>[page.tsx]"]
end

subgraph group_presentation["Application presentation"]
  node_explore_layout["Explore layout<br/>[layout.tsx]"]
  node_navbar["Navigation bar<br/>[navbar.tsx]"]
  node_app_layout["Application layout<br/>[layout.tsx]"]
  node_other_routes["Other routes"]
end

subgraph group_ui["UI components"]
  node_ui_primitives["UI primitives"]
end

subgraph group_utilities["Shared utilities"]
  node_utilities["Class utilities<br/>[utils.ts]"]
end

node_visitor(("Visitor"))
node_nasa{{"NASA Images API"}}

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_searchbar
node_searchbar -->|"submits search"| node_explore
node_explore -->|"renders"| node_searchbar
node_explore -->|"renders"| node_results
node_explore_layout -->|"renders"| node_filters
node_results -->|"fetches results"| node_nasa
node_results -->|"links image"| node_detail
node_detail -->|"fetches details"| node_nasa
node_app_layout -->|"renders"| node_navbar
node_app_layout -.->|"hosts routes"| node_other_routes
node_ui_primitives -->|"uses classes"| node_utilities

click node_home "https://github.com/joshuaduke/cosmiclens/blob/main/app/page.tsx"
click node_searchbar "https://github.com/joshuaduke/cosmiclens/blob/main/components/searchbar.tsx"
click node_explore "https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/page.tsx"
click node_filters "https://github.com/joshuaduke/cosmiclens/blob/main/components/filter.tsx"
click node_results "https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/search.tsx"
click node_detail "https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/%5Bslug%5D/page.tsx"
click node_explore_layout "https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/layout.tsx"
click node_navbar "https://github.com/joshuaduke/cosmiclens/blob/main/components/navbar.tsx"
click node_app_layout "https://github.com/joshuaduke/cosmiclens/blob/main/app/layout.tsx"
click node_other_routes "https://github.com/joshuaduke/cosmiclens/tree/main/app"
click node_ui_primitives "https://github.com/joshuaduke/cosmiclens/tree/main/components/ui"
click node_utilities "https://github.com/joshuaduke/cosmiclens/blob/main/lib/utils.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_searchbar,node_explore,node_filters,node_results,node_detail toneBlue
class node_explore_layout,node_navbar,node_app_layout,node_other_routes toneAmber
class node_ui_primitives,node_nasa toneMint
class node_utilities toneRose
class node_visitor toneIndigo
```

## Components

### Discovery workflow

- [Home and featured](https://github.com/joshuaduke/cosmiclens/blob/main/app/page.tsx): `app/page.tsx`
- [Search bar](https://github.com/joshuaduke/cosmiclens/blob/main/components/searchbar.tsx): `components/searchbar.tsx`
- [Explore results page](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/page.tsx): `app/explore/page.tsx`
- [Explore filters](https://github.com/joshuaduke/cosmiclens/blob/main/components/filter.tsx): `components/filter.tsx`
- [NASA search results](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/search.tsx): `app/explore/search.tsx`
- [Image detail](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/%5Bslug%5D/page.tsx): `app/explore/[slug]/page.tsx`

### Application presentation

- [Explore layout](https://github.com/joshuaduke/cosmiclens/blob/main/app/explore/layout.tsx): `app/explore/layout.tsx`
- [Navigation bar](https://github.com/joshuaduke/cosmiclens/blob/main/components/navbar.tsx): `components/navbar.tsx`
- [Application layout](https://github.com/joshuaduke/cosmiclens/blob/main/app/layout.tsx): `app/layout.tsx`
- [Other routes](https://github.com/joshuaduke/cosmiclens/tree/main/app): `app`

### UI components

- [UI primitives](https://github.com/joshuaduke/cosmiclens/tree/main/components/ui): `components/ui`

### Shared utilities

- [Class utilities](https://github.com/joshuaduke/cosmiclens/blob/main/lib/utils.ts): `lib/utils.ts`

### Other components

- **Visitor**
- **NASA Images API**

## Connections

- Visitor → Home and featured: opens (evidence: `app/page.tsx`)
- Home and featured → Search bar: renders (evidence: `app/page.tsx`)
- Search bar → Explore results page: submits search (evidence: `components/searchbar.tsx`)
- Explore results page → Search bar: renders (evidence: `app/explore/page.tsx`)
- Explore results page → NASA search results: renders (evidence: `app/explore/page.tsx`)
- Explore layout → Explore filters: renders (evidence: `app/explore/layout.tsx`)
- NASA search results → NASA Images API: fetches results (evidence: `app/explore/search.tsx`)
- NASA search results → Image detail: links image (evidence: `app/explore/search.tsx`)
- Image detail → NASA Images API: fetches details (evidence: `app/explore/[slug]/page.tsx`)
- Application layout → Navigation bar: renders (evidence: `app/layout.tsx`)
- Application layout → Other routes: hosts routes (evidence: `app/layout.tsx`)
- UI primitives → Class utilities: uses classes (evidence: `components/ui/button.tsx`)
