Minimal instructions for AI coding agents working in this repository.
- Use this file for repo-wide guidance.
- Link to existing docs instead of duplicating them. Start with README.md for setup.
- Install dependencies:
yarn install - Start dev server:
yarn dev(runs on port3001) - Lint:
yarn lint(Next.js ESLint) - Test:
yarn test(Jest) - Test watch mode:
yarn test:watch - Production build:
yarn build
- This is a Next.js 13 App Router app using static export.
- Route files live under
app/, with many topic-specific pages underapp/topics/and category landing pages underapp/categories/. - Shared UI lives in
components/. Low-level shadcn/radix primitives live incomponents/ui/. - Shared content, enums, constants, and types live in
lib/. Start withlib/content.tsx,lib/constants.ts,lib/enums.ts, andlib/types.tswhen changing navigation, topics, or labels. - Client-side API calls are centralized in
lib/api-hooks.tsand useAPI_URLfromlib/constants.ts.
- Prefer existing
components/ui/*primitives and current Tailwind utility patterns before adding new abstractions. - Keep styling in Tailwind classes. Variant-heavy reusable components should follow the existing
class-variance-authoritypattern. - Follow the ESLint rules in
.eslintrc.json: useasync/awaitinstead of.then()/.catch(), avoid nested ternaries, prefer object shorthand, preferconst, and keepconsoleusage toconsole.warnorconsole.error, and keep files Prettier-clean because formatting violations fail lint. - Preserve the current font/theme setup in
app/layout.tsxand token-based Tailwind config intailwind.config.ts. - Route-level pages use lightweight Jest render tests alongside the page file (
page.test.tsx). When adding a new route, add or update the matching test.
next.config.jssetsoutput: "export",trailingSlash: true, andimages.unoptimized: true.- Avoid changes that require a Node runtime or server-only features unless the export strategy is also updated.
- When adding pages or data flows, make sure they work under static export.
- Many feature pages are assembled from shared enums/constants/content instead of isolated page-local data. If a topic, channel, or category changes, check
lib/content.tsx,lib/constants.ts, andlib/enums.tstogether. - Flight destination pages have extra wiring: add the route in
lib/enums.ts, add the airline destination mapping inlib/constants.ts, and passdestinationLinksinto the relevant flights table page. - New route pages should usually come with a matching
page.test.tsxso the PR workflow continues to cover render-level regressions. - Some topics and Telegram channels are intentionally hidden via inactive lists in
lib/constants.ts; verify those lists before assuming a missing topic is a bug.