How dav1ee/rick-and-morty works
This Next.js application lets visitors browse Rick and Morty characters, episodes, and locations, with character filters and paginated lists, then access individual detail routes. The sampled list-page code shows requests to the corresponding API helpers; the README identifies the Rick and Morty API as the data source. Detail routes are present in the tree, but their data-flow connections are not established by the supplied evidence.
Main entry points: characters/page.tsx Character list · [page]/page.tsx Episode list · [page]/page.tsx Location list · api.ts HTTP client
Components 22
Application routes
- Home page
app/page.tsx - Character list
app/(characters)/characters/page.tsx - Character detail
app/(characters)/character/[id]/page.tsx - Episode list
app/(episodes)/episodes/[page]/page.tsx - Episode detail
app/(episodes)/episode/[id]/page.tsx - Location list
app/(locations)/locations/[page]/page.tsx - Location detail
app/(locations)/location/[id]/page.tsx
User interface
- Shared shell
src/components/layout - Character cards
src/components/characters/Card.tsx - Character filters
src/components/characters/Filter.tsx - Character info
src/components/characters/DetailedInfo.tsx - Status indicator
src/components/characters/StatusCircle.tsx - Pagination
src/components/Pagination.tsx - Item links
src/components/LinkItem.tsx - Episode info
src/components/episodes/Info.tsx - Location info
src/components/locations/Info.tsx
API access
- Character API
src/utils/api/characters.ts - Episode API
src/utils/api/episodes.ts - Location API
src/utils/api/locations.ts - HTTP client
src/utils/api/api.ts
Other components
- Visitor
- Rick and Morty API
Connections 19
- Visitor → Home page: opens
- Home page → Shared shell: renders
- Visitor → Character list: opens
- Character list → Character API: fetches
app/(characters)/characters/page.tsx - Character list → Character filters: renders
app/(characters)/characters/page.tsx - Character list → Pagination: renders
app/(characters)/characters/page.tsx - Visitor → Episode list: opens
- Episode list → Episode API: fetches
app/(episodes)/episodes/[page]/page.tsx - Episode list → Pagination: renders
app/(episodes)/episodes/[page]/page.tsx - Episode list → Item links: renders
app/(episodes)/episodes/[page]/page.tsx - Visitor → Location list: opens
- Location list → Location API: fetches
app/(locations)/locations/[page]/page.tsx - Location list → Pagination: renders
app/(locations)/locations/[page]/page.tsx - Location list → Item links: renders
app/(locations)/locations/[page]/page.tsx - Character info → Status indicator: renders
src/components/characters/DetailedInfo.tsx - Character API → HTTP client: calls
src/utils/api/characters.ts - Episode API → HTTP client: calls
src/utils/api/episodes.ts - Location API → HTTP client: calls
src/utils/api/locations.ts - HTTP client → Rick and Morty API: requests
src/utils/api/api.ts