This project is experimental to learn new technologies and to have fun. It is not intended to be used in production. WORK IN PROGRESS!!!
This project consists in two parts.
- An API that provides information about the characters of the TV show "The Big Bang Theory". The data is scraped from IMDB. The API is built with Hono and deployed on Cloudflare Workers.
- A frontend that shows the characters of the TV show. The frontend is built with Astro with Tailwindcss in pude VanillaJS and deployed on Vercel.
- If you want to run the scparer locally, you can do so by running
npm run scrape
. This will create or update acharacters.json
file in the db directory. - You can then run
npm run dev:api
to start the API locally on url http://localhost:8787/. - If you want to run the frontend locally, you can do so by running
npm run dev
. This will start the frontend on url http://localhost:3000/.
- The API is available at https://big-bang-theory-api.lesalvucci.workers.dev. The API is currently in version 1.0.0.
- The frontend is available at https://big-bang-theory.lesalvucci.xyz. The frontend is currently in development.
Returns API available endpoints
Returns all characters with pagination. The default page size is 10. You can change the page size by adding a limit
query parameter. You can also change the page by adding a page
query parameter. Giving a limit
parameter with -1
will return all characters.
Response object is like this example:
{
"total": 444,
"pages": 45
"limit": 10,
"items": [
{
"id": 1,
"name": "Johnny Galecki",
"photo": "https://m.media-amazon.com/images/M/MV5BNzQ2ODY0MTIwMV5BMl5BanBnXkFtZTcwNDQ2NzMzMw@@._V1_UX266.jpg",
"charName": "Leonard Hofstadter",
},
...
]
}
Returns all episodes for a character. The charId
is the id of the character. The default page size is 10. You can change the page size by adding a limit
query parameter. You can also change the page by adding a page
query parameter. Giving a limit
parameter with -1
will return all episodes.
Response object is like this example:
{
"total": 280,
"pages": 28,
"limit": 10,
"items": [
{
"id": 0,
"text": "The Stockholm Syndrome (2019) ... Leonard Hofstadter",
"url": "https://www.imdb.com/title/tt6674736/?ref_=ttfc_fc_cl_i1"
},
...
]
}
Searches for characters by name or charName. Query parameter q
is required with at least 3 chars.