A Next.js admin frontend for the OpenPecha API v2 — manage Buddhist text records, editions, contributors, categories, tags, languages, applications, segments, and annotations.
- Next.js 16 (App Router) + React 19 + TypeScript
- Tailwind CSS v4 + shadcn/ui (Radix base)
- TanStack Query v5
- API types generated from
openapi/openapi.jsonviaopenapi-typescript
-
Install deps
npm install -
(Optional) Create
.env.local— no env vars are required out of the box. Copy from.env.local.exampleonly if you want to override the upstream URL or set a default application id.# OPENPECHA_API_BASE=http://13.250.189.160 # OPENPECHA_DEFAULT_APPLICATION=<optional default application id> -
Run the dev server
npm run devOpen http://localhost:3000.
-
Enter your API key via the Settings dialog in the sidebar footer. It is stored in your browser's
localStorageand sent asX-API-Keyon every request. -
Create an Application at
/applicationsif you don't have one, then click "Use" to make it active. Most write endpoints (texts, categories, tags, segments) require anX-Applicationheader.
Each user enters their own API key in the in-app Settings dialog. The key is kept in localStorage and sent on the request as X-API-Key. All API calls go to a same-origin route at /api/proxy/..., which forwards the request to the upstream API — this avoids CORS and mixed-content issues (the upstream is HTTP, not HTTPS).
The upstream base URL defaults to http://13.250.189.160 and can be overridden with OPENPECHA_API_BASE.
Source: src/app/api/proxy/[...path]/route.ts.
If the upstream OpenAPI spec changes, replace openapi/openapi.json and run:
npx openapi-typescript openapi/openapi.json -o src/lib/api/types.ts