Scaffold LokiLoto: country theme engine, LokiLab feed client, Québec home page
International lottery stats layer, fed by LokiLab's army-feed API (results, Loki's picks, lifetime win record, army size). One mascot reskinned per country via flag-derived colors; Québec is the first locale, same pattern every future country will follow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b6a4c94e93
commit
b2915d06cd
@@ -0,0 +1,40 @@
|
||||
import 'server-only'
|
||||
|
||||
/**
|
||||
* The one contract between LokiLab and LokiLoto: results, Loki's picks,
|
||||
* lifetime win record, and army size. LokiLoto never talks to LokiLab's
|
||||
* database or stats engine directly — only this feed.
|
||||
*/
|
||||
export interface ArmyFeed {
|
||||
army: {
|
||||
total: number
|
||||
byCountry: Record<string, number>
|
||||
}
|
||||
lotteries: LotteryFeedEntry[]
|
||||
}
|
||||
|
||||
export interface LotteryFeedEntry {
|
||||
id: string
|
||||
name: string
|
||||
country: string
|
||||
lifetime: {
|
||||
picksTracked: number
|
||||
wins: number
|
||||
winRate: number
|
||||
}
|
||||
lastDraw: {
|
||||
date: string
|
||||
result: number[]
|
||||
pick: number[] | null
|
||||
matched: number | null
|
||||
won: boolean | null
|
||||
} | null
|
||||
}
|
||||
|
||||
const LOKILAB_FEED_URL = process.env.LOKILAB_FEED_URL ?? 'https://goldd.devyouz.net/api/public/army-feed'
|
||||
|
||||
export async function getArmyFeed(): Promise<ArmyFeed> {
|
||||
const res = await fetch(LOKILAB_FEED_URL, { next: { revalidate: 300 } })
|
||||
if (!res.ok) throw new Error(`LokiLab feed returned ${res.status}`)
|
||||
return res.json()
|
||||
}
|
||||
Reference in New Issue
Block a user