How luma-team/basketball-club-example works
Project type and purpose
• This is a full-stack example website built with Next.js (React + server-side capabilities) that integrates with an external service: the Luma API.
• Purpose: Demonstrate how to fetch and display event data (a basketball club schedule) from the Luma Calendar API and render it in a styled Next.js app.
File structure
Top-level:
• app/ – Next.js “App Router” directory containing pages, layouts, and global CSS
– calendar/page.tsx – “/calendar” route: fetches & displays events
– page.tsx – homepage route
– layout.tsx, globals.css
• components/ – Reusable React components (EventList.tsx, HomePage.tsx)
• lib/ – Utility functions (e.g., data-fetching wrappers)
• .env.local.template – Template for API key
• next.config.mjs – Next.js configuration
• tailwind.config.js
• bun.lock, package.json, tsconfig.json, ESLint & PostCSS configs
README for additional insights
• Uses Next.js and the Luma API.
• Runs via Bun (bun dev).
• Expects an environment variable (LUMA_API_KEY) in .env.local.
Elements
• Clear labels: Browser, Next.js Router, React Components, Data-fetch layer, Luma API
– Request flow (User → Browser → Next.js)
– Data flow (Next.js → Luma API → Next.js → Browser)
– Frontend (blue rectangles)
– Server/Rendering (green rectangles)
– External Service (orange cloud)