This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen 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.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, 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.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
data/competition-data.ts can be auto-generated from a Notion database.
- Add these variables to
.env:
NOTION_TOKEN=secret_xxx
NOTION_COMPETITIONS_DATABASE_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxOptional:
NOTION_SYNC_INTERVAL_MS=60000
NOTION_COMPETITIONS_FILTER_JSON={"property":"Published","checkbox":{"equals":true}}
NOTION_COMPETITIONS_SORTS_JSON=[{"property":"Title","direction":"ascending"}]
NOTION_DEFAULT_IMAGE_URL=https://images.unsplash.com/photo-1446776811953-b23d57bd21aa- Run a one-time sync:
npm run sync:competitions- Run continuous polling (updates file when Notion changes):
npm run sync:competitions:watch- Run in cloud every 5 minutes (works even when your laptop is off):
- The workflow file
.github/workflows/notion-competition-sync.ymlis configured to run every 5 minutes. - Add these GitHub Actions repository secrets:
NOTION_TOKENNOTION_COMPETITIONS_DATABASE_ID
- Push to GitHub; then the action will sync
data/competition-data.tsand auto-commit changes.
Notes:
- The script queries all pages from the configured Notion database and rewrites
data/competition-data.ts. rulesis written as a multiline template string when needed.- For production automation, run the sync command in CI on a schedule and commit updates.