- Server-Side Rendering: Fast initial page loads with Astro SSR on Cloudflare Workers
- Global Search: Search across movies, series, and boxsets with real-time dropdown results
- Advanced Filtering: Sort by latest release, date added, release date, or title
- Smooth Transitions: View Transitions API for seamless page navigation with morphing animations
- Responsive Design: Fully responsive TailwindCSS layout with dark mode support
- Type-Safe: End-to-end type safety with GraphQL Code Generator
- Optimized Images: Automatic image optimization with Astro's built-in image service
- Framework: Astro with SSR
- Runtime: Cloudflare Workers
- Styling: TailwindCSS v4
- Data: GraphQL with graphql-request
- Interactivity: Preact
- Package Manager: Bun
- Code Quality: Biome
- Bun v1.3.2 or later
# Clone the repository
git clone <repository-url>
cd thediscdb
# Install dependencies
bun install
# Generate TypeScript types from GraphQL schema
bun run codegen
# Start development server
bun run dev# Development
bun run dev # Start dev server at http://localhost:4321
bun run build # Build for production
bun run preview # Preview production build with Wrangler
# Code Quality
bun run check # Run Biome checks (lint + format)
bun run lint # Lint with Biome
bun run format # Format with Biome
# Code Generation
bun run codegen # Regenerate TypeScript types from GraphQL schema
bun run cf-typegen # Generate Cloudflare Workers typesthediscdb/
βββ src/
β βββ components/ # Reusable UI components
β β βββ GlobalSearch.tsx # Search component (Preact)
β β βββ MediaCard.astro # Movie/series card
β β βββ Navigation.astro # Top navigation bar
β β βββ Pagination.astro # Cursor-based pagination
β βββ graphql/
β β βββ queries.gql # GraphQL queries
β β βββ index.ts # GraphQL client setup
β β βββ sdk.gen.ts # Generated TypeScript SDK
β βββ layouts/
β β βββ Layout.astro # Base page layout
β βββ pages/
β β βββ movies/ # Movie list and detail pages
β β βββ series/ # Series list and detail pages
β β βββ boxsets/ # Boxset list and detail pages
β β βββ search.astro # Global search results
β β βββ api/ # API endpoints
β βββ styles/
β β βββ global.css # Global styles and utilities
β βββ utils/ # Utility functions
βββ astro.config.ts # Astro configuration
βββ codegen.config.ts # GraphQL Code Generator config
βββ wrangler.jsonc # Cloudflare Workers config
- GraphQL queries are defined in
src/graphql/queries.gql - Running
bun run codegengenerates a type-safe SDK - Pages fetch data server-side using the SDK
- Astro renders pages on Cloudflare Workers edge network
The site uses cursor-based pagination (not offset-based) for efficient data fetching:
- 48 items per page
- Bidirectional navigation (next/previous)
- Cursor state maintained via URL query parameters
Global Search:
- Real-time search with 300ms debounce
- Shows up to 3 results per content type
- Full results available at
/search?q=query
List Filtering:
- Each list page supports
?q=parameter for filtering - Combined with sort options for flexible browsing
Smooth client-side navigation using Astro's View Transitions:
- Cover art morphs between list and detail pages
- Navigation bar persists across pages
- Content slides in with custom animations
The project is configured for Cloudflare Workers deployment:
# Build for production
bun run build
# Deploy to Cloudflare Workers
wrangler deployEnsure you have a wrangler.jsonc configured with your Cloudflare account details.
- Add your query to
src/graphql/queries.gql - Run
bun run codegento regenerate types - Import and use:
import { query } from '~/graphql' - Call in your page:
await query.YourNewQuery({ ... })
This is a personal project, but suggestions and feedback are welcome!
- Data provided by TheDiscDB
- Built with Astro
- Deployed on Cloudflare Workers
MIT