Welcome to the Monorepo of the Harry Potter API. This repo houses the API itself, the data used and an example Frontend.
The API itself uses Fastify and queries a Supabase database. It provides information about the Harry Potter universe: Characters, Movies, Books, Spells and Potions.
The data is taken from the danielschuster-muc/potter-db repo, converted to csv using this python script and imported to Supabase.
The frontend is a React app that uses Vite, react-router for routing, React Query to fetch data from the API and display it, and Chakra UI for the interface.
The API is deployed on Render and can be publically accessed and used at https://hpapi.onrender.com/. RLS has been enabled on Supabase to allow anyone to read the data.
The frontend is also deployed on Render and can be accessed at https://hpapi-web.onrender.com/.
If you would like to work on this, you will need to set up the data on your own Supabase instance. You can do this by following these steps:
- Clone this repo
- Create a new Supabase project
- Create a new table for each csv file in the
data
folder - Import the csv files into the tables
- Create a new
.env
file in thepackages/api
folder of the project and add the following variables:SUPABASE_URL
- The URL of your Supabase projectSUPABASE_KEY
- The public key of your Supabase project
- Run
npm install
to install the dependencies - Run
cd packages/api && npm run dev
to start the API development server - The development server should now be running on
localhost:3000
To work on the frontend, simply run cd packages/web && npm run dev
to start the development server. The frontend should now be running on localhost:5173
.
If you need any support feel free to open a GitHub issue or ask your question on GitHub Discussions.
This repository was set up by Jordan Harrison.
For a full list of all authors and contributors, see the contributors page.
This project is licensed under the MIT license.
See LICENSE for more information.