███████╗████████╗ █████╗ ██████╗ ██╗ ██╗ █████╗ ██████╗ ███████╗ █████╗ ██████╗ ██╗
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗ ██║ ██║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██║
███████╗ ██║ ███████║██████╔╝ ██║ █╗ ██║███████║██████╔╝███████╗ ███████║██████╔╝██║
╚════██║ ██║ ██╔══██║██╔══██╗ ██║███╗██║██╔══██║██╔══██╗╚════██║ ██╔══██║██╔═══╝ ██║
███████║ ██║ ██║ ██║██║ ██║ ╚███╔███╔╝██║ ██║██║ ██║███████║ ██║ ██║██║ ██║
╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
A fully self-contained Star Wars REST API backed by PostgreSQL.
🚀 Live API: https://star-wars-api-9o3y.onrender.com 📖 Swagger Docs: https://star-wars-api-9o3y.onrender.com/api/docs
star-wars-api/
├── apps/
│ └── api/ 🚀 NestJS REST API
└── packages/
└── types/ 📐 Shared TypeScript interfaces
- 🎬 11 films — Episodes I–IX, Rogue One & Solo
- 👤 101 characters — from Luke Skywalker to Grogu
- 🪐 62 planets — Tatooine to Exegol
- 🧬 40 species — Human to Ewok to Dathomirian
- 🚀 32 starships — Millennium Falcon to the Supremacy
- 🚗 30 vehicles — AT-AT to Podracer
- 🔍 Cross-resource search — query across all resources at once
- 📄 Pagination & filtering on every endpoint
- 📖 Swagger docs at
/api/docs
# Page 1, 10 results per page (default)
GET https://star-wars-api-9o3y.onrender.com/characters
# Page 2, 20 results per page
GET https://star-wars-api-9o3y.onrender.com/characters?page=2&limit=20
# First 5 films
GET https://star-wars-api-9o3y.onrender.com/films?page=1&limit=5# Search characters by name
GET https://star-wars-api-9o3y.onrender.com/characters?name=Luke
# Filter planets by climate
GET https://star-wars-api-9o3y.onrender.com/planets?climate=arid
# Filter starships by class
GET https://star-wars-api-9o3y.onrender.com/starships?starshipClass=Star+Destroyer
# Combine filters with pagination
GET https://star-wars-api-9o3y.onrender.com/characters?name=sky&page=1&limit=5# Get a character by ID
GET https://star-wars-api-9o3y.onrender.com/characters/1
# Get a film with full cast & relations
GET https://star-wars-api-9o3y.onrender.com/films/4
# Get a planet by ID
GET https://star-wars-api-9o3y.onrender.com/planets/1# Search across all resources
GET https://star-wars-api-9o3y.onrender.com/search?q=Skywalker
# Search within a specific resource
GET https://star-wars-api-9o3y.onrender.com/search?q=Falcon&type=starships{
"data": [...],
"meta": {
"total": 101,
"page": 1,
"limit": 10,
"totalPages": 11
}
}- Node.js 20+
- npm
- A PostgreSQL database (Supabase free tier works great)
npm install --prefix apps/apicp apps/api/.env.example apps/api/.envFill in your database credentials:
DB_HOST=your-db-host
DB_PORT=5432
DB_NAME=your-db-name
DB_USER=your-db-user
DB_PASS=your-db-password
PORT=3000
NODE_ENV=developmentnpm run dev --prefix apps/apinpm run seed --prefix apps/apiThe API is now live at http://localhost:3000 🎉 Swagger docs at http://localhost:3000/api/docs 📖
| Method | Endpoint | Description |
|---|---|---|
GET |
/characters |
List all characters |
GET |
/characters/:id |
Get a character by ID |
GET |
/films |
List all films |
GET |
/films/:id |
Get a film with full cast & relations |
GET |
/planets |
List all planets |
GET |
/planets/:id |
Get a planet by ID |
GET |
/species |
List all species |
GET |
/species/:id |
Get a species by ID |
GET |
/starships |
List all starships |
GET |
/starships/:id |
Get a starship by ID |
GET |
/vehicles |
List all vehicles |
GET |
/vehicles/:id |
Get a vehicle by ID |
GET |
/search?q= |
Search across all resources |
All list endpoints support:
| Param | Type | Description |
|---|---|---|
page |
number | Page number (default: 1) |
limit |
number | Results per page (default: 10, max: 100) |
name |
string | Filter by name (case-insensitive) |
# Start API in watch mode
npm run dev --prefix apps/api
# Build API
npm run build:api
# Run tests
npm run test --prefix apps/api
# Re-seed the database
npm run seed --prefix apps/api| Layer | Technology |
|---|---|
| API Framework | NestJS |
| Database ORM | TypeORM |
| Database | PostgreSQL |
| Hosting | Render |
| API Docs | Swagger / OpenAPI |
| Package Manager | npm |
| Language | TypeScript |
| Resource | Count | Eras Covered |
|---|---|---|
| 🎬 Films | 11 | Episodes I–IX, Rogue One, Solo |
| 👤 Characters | 101 | Prequel, Original, Sequel, Mandalorian |
| 🪐 Planets | 62 | All eras |
| 🧬 Species | 40 | All eras |
| 🚀 Starships | 32 | All eras |
| 🚗 Vehicles | 30 | All eras |
MIT