Skip to content

Flixbox/starwars-db

Repository files navigation

This is a Next.js project that displays Star Wars related data.

Uses Swapi - https://swapi.py4e.com

All elements are auto-generated from the Swapi root data. This keeps this platform flexible - Any new resources added to Swapi will be automatically available in this platform, including completely new resource types.

Maintainability

Getting Started

  • Set up Bun
  • bun i to install dependencies
  • bun start to start the dev server (Note: This will kill any current processes on port 3000 before starting the dev server. You can remove the "prestart" script if you don't want this behavior.)

Run the tests

  • Go through the "Getting Started" section
  • playwright install to set up playwright
  • bun prestart to kill anything on port 3000
  • bun run test to run the tests

Known issues

Some issues that I've encountered during development.

The Next.js dev overlay shows Compiling... the whole time

  • Stop the server
  • Delete the .next folder
  • Start the server again

[FETCH ERROR] POST https://telemetry.nextjs.org/api/v1/record

Run bun x next telemetry disable to disable telemetry.

Failed to fetch root data

This is expected behavior if the API is down or rate limited to 10k requests per hour.

If you just deployed this to a cloud service (like Vercel) and it's not working, this is because the cloud service shares IPs with many deployed services. Use the webapp locally or deploy it to a cloud service that provides a dedicated IP.

Tried & Failed

  • Using HAR files to mock the API responses - Impossible due to SSR
  • Cloud deployment - API is harshly rate limited & IP is shared with other services

AI disclosure

This project is mostly written by hand, with some assistance from AI.

This includes:

No agentic AI systems are used to write code in this repository. They are however used to explain and debug issues and concepts.

My goal is to understand the tech and the task, creating an implementation plan in my mind, then writing the code. I do not use AI to write all of the code, but to assist me in this endeavour.

Timing

  • Start of work in this repository: 2025-12-20 17:10
  • End of work in this repository: 2025-12-20 22:32

About

Use SWAPI to navigate Star Wars data!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors