A React application that visualizes Star Wars characters and their relationships through an interactive graph interface. Browse through characters from the Star Wars universe and explore their connections to films, starships, vehicles, and species.
- Displays a grid of Star Wars characters
- Shows detailed information about each character
- Visualizes relationships between characters and their associated entities (films, starships, vehicles, species) using an interactive flow graph
- Fetches data from the Star Wars API (SWAPI)
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- TailwindCSS - Styling
- React Router - Navigation
- TanStack Query - Data fetching and caching
- XYFlow - Interactive graph visualization
- Axios - HTTP client
Make sure you have one of these installed:
- Node.js (v18 or higher)
- npm (comes with Node.js)
yarnThe project includes a .env file with these settings:
REACT_APP_BASE_URL=https://swapi.dev
REACT_APP_ENABLE_MOCKS=false
You can modify REACT_APP_ENABLE_MOCKS to false if you want to use the real API instead of mocked data.
yarn devThe app will open at http://localhost:5173 (or another port if 5173 is busy).
yarn buildThis creates an optimized production build in the dist folder.
yarn previewRuns the production build locally so you can test it before deployment.
| Command | What It Does |
|---|---|
npm run dev |
Starts development server with hot reload |
npm run build |
Creates production-ready build |
npm run preview |
Previews the production build locally |
npm run lint |
Checks code for issues using ESLint |
src/
├── app/ # App-level configuration (providers, root component)
├── business/ # Business logic and UI components
├── modules/ # Feature modules
│ └── starwars/ # Star Wars feature
│ ├── listStarwars/ # Character list view
│ ├── detailStarwars/ # Character detail view with graph
│ ├── models/ # Data models
│ └── shared/ # Shared utilities for this module
├── resources/ # Static resources (icons, constants)
├── routing/ # Route definitions
├── shared/ # Shared UI components and utilities
└── styles/ # Global styles
- Start the dev server
- You'll see a grid of Star Wars characters
- Click on any character card to view detailed information
- The detail page shows an interactive graph of relationships
- Use the back button to return to the character list
- The app uses TanStack Query for data caching, so subsequent visits will be faster
- Mock mode is disabled by default for development
- The graph visualization uses the Dagre layout algorithm for automatic positioning