lukenya-university-marathon
This is a Next.js project bootstrapped with v0.
Built with v0
This repository is linked to a v0 project. You can continue developing by visiting the link below -- start new chats to make changes, and v0 will push commits directly to this repo. Every merge to main will automatically deploy.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
Learn More
To learn more, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- v0 Documentation - learn about v0 and how to use it.
Backend connection
Race, price, edition and prize data come from the Frappe backend (lukenya_marathon app).
Nothing about races is hard-coded in the pages any more.
lib/lukenya-api.ts: server-only calls to Frappe. Pages refresh their data every 60 seconds, or immediately when the backend callsPOST /api/revalidate.lib/event-types.ts: the data shapes the backend returns. Treat these as the contract.- The browser never calls Frappe directly. It posts to this site's routes, which forward to Frappe:
POST /api/register→api.create_registrationPOST /api/payment/start→payments.start_payment(returns the Paystack checkout link)GET /api/payment/status?reference=…→payments.check_payment_status
- Paystack sends the runner back to
/payment/return, which waits for the server to verify the payment.
If api.get_public_event isn't available yet, the site falls back to the older
api.get_event_categories endpoint. Set FRAPPE_EDITION so that fallback only shows one edition.
Environment variables are listed in .env.example.