# fabriceibols/starwars-apollo architecture

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

- Interactive diagram: https://gitdiagram.com/fabriceibols/starwars-apollo
- Repository: https://github.com/fabriceibols/starwars-apollo

## Overview

StarWars Api Typescript is a React character browser backed by an Apollo GraphQL API. A user opens the people list, follows a character’s Details link, and views that character’s details; the client’s Apollo provider is configured with the API endpoint. On the server, Apollo combines the schema, resolvers, and REST data source; resolvers request character data from SWAPI, which the data source reduces to the fields exposed by GraphQL. The README confirms the API and SPA but gives few details; relationships below are limited to the sampled source and documented setup.

Main entry points: [`client/src/App.tsx`](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/App.tsx) (App and routes), [`src/index.ts`](https://github.com/fabriceibols/starwars-apollo/blob/master/src/index.ts) (Apollo server), [`src/datasource/people.ts`](https://github.com/fabriceibols/starwars-apollo/blob/master/src/datasource/people.ts) (People REST source), [`client/src/index.tsx`](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/index.tsx) (React bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_entry["React bootstrap<br/>[index.tsx]"]
  node_app["App and routes<br/>[App.tsx]"]
  node_list["People list<br/>[People.tsx]"]
  node_detail["Person details<br/>[Person.tsx]"]
end

subgraph group_api["GraphQL API"]
  node_server["Apollo server<br/>[index.ts]"]
  node_schema["GraphQL schema<br/>[schema.ts]"]
  node_resolvers["Query resolvers<br/>[resolvers.ts]"]
end

subgraph group_data["Character data"]
  node_source["People REST source<br/>[people.ts]"]
end

node_user(("Browser user"))
node_swapi["SWAPI"]

node_user -->|"opens"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"routes to"| node_list
node_app -->|"routes to"| node_detail
node_list -->|"links to"| node_detail
node_app -->|"configures endpoint"| node_server
node_server -->|"loads"| node_schema
node_server -->|"loads"| node_resolvers
node_server -->|"registers"| node_source
node_resolvers -->|"calls"| node_source
node_source -->|"fetches people"| node_swapi

click node_entry "https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/index.tsx"
click node_app "https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/App.tsx"
click node_list "https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/components/People.tsx"
click node_detail "https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/components/Person.tsx"
click node_server "https://github.com/fabriceibols/starwars-apollo/blob/master/src/index.ts"
click node_schema "https://github.com/fabriceibols/starwars-apollo/blob/master/src/schema.ts"
click node_resolvers "https://github.com/fabriceibols/starwars-apollo/blob/master/src/resolvers.ts"
click node_source "https://github.com/fabriceibols/starwars-apollo/blob/master/src/datasource/people.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_entry,node_app,node_list,node_detail,node_user toneBlue
class node_server,node_schema,node_resolvers toneAmber
class node_source,node_swapi toneMint
```

## Components

### React client

- [React bootstrap](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/index.tsx): `client/src/index.tsx`
- [App and routes](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/App.tsx): `client/src/App.tsx`
- [People list](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/components/People.tsx): `client/src/components/People.tsx`
- [Person details](https://github.com/fabriceibols/starwars-apollo/blob/master/client/src/components/Person.tsx): `client/src/components/Person.tsx`

### GraphQL API

- [Apollo server](https://github.com/fabriceibols/starwars-apollo/blob/master/src/index.ts): `src/index.ts`
- [GraphQL schema](https://github.com/fabriceibols/starwars-apollo/blob/master/src/schema.ts): `src/schema.ts`
- [Query resolvers](https://github.com/fabriceibols/starwars-apollo/blob/master/src/resolvers.ts): `src/resolvers.ts`

### Character data

- [People REST source](https://github.com/fabriceibols/starwars-apollo/blob/master/src/datasource/people.ts): `src/datasource/people.ts`

### Other components

- **Browser user**
- **SWAPI**

## Connections

- Browser user → React bootstrap: opens
- React bootstrap → App and routes: renders (evidence: `client/src/index.tsx`)
- App and routes → People list: routes to (evidence: `client/src/App.tsx`)
- App and routes → Person details: routes to (evidence: `client/src/App.tsx`)
- People list → Person details: links to (evidence: `client/src/components/People.tsx`)
- App and routes → Apollo server: configures endpoint (evidence: `client/src/App.tsx`)
- Apollo server → GraphQL schema: loads (evidence: `src/index.ts`)
- Apollo server → Query resolvers: loads (evidence: `src/index.ts`)
- Apollo server → People REST source: registers (evidence: `src/index.ts`)
- Query resolvers → People REST source: calls (evidence: `src/resolvers.ts`)
- People REST source → SWAPI: fetches people (evidence: `src/datasource/people.ts`)
