2.4 KiB
2.4 KiB
AI Agent Instructions
This file is the first-stop context for AI coding agents working in this repo.
Repository identity
- Project: Arkie Library Frontend / ARK database web UI.
- Package name:
ark-database-web. - Stack: React 18, TypeScript, Vite, Tailwind CSS, React Router, RainbowKit/Wagmi.
- Backend API is expected at
/api; uploaded assets under/uploads.
Branch rules
- Current deploy branch:
main. - Work/staging branch available:
terry-staging. - Do not commit or push unless Terry explicitly asks.
- Pushing to
maintriggers production frontend deploy via Gitea Actions. - Before branch-changing or pulling, run
git status --short --branchand preserve local work.
Required checks
Before proposing a push or deploy, run:
npx tsc --noEmit
npm run format:check
npm test
If code formatting is needed, run:
npm run format
Notes:
tsconfig.jsonhasstrict,noUnusedLocals, andnoUnusedParameters; unused imports fail CI.dist/is build output and should not be edited manually.
App structure quick map
src/main.tsxchooses normal app vs admin-only build usingVITE_ADMIN_ONLY.src/App.tsxcontains public routes and conditionally exposes admin routes unlessVITE_DISABLE_ADMIN === "true".src/api.tsdefinesapiBase, fetch helpers, and shared resource/category types.src/i18n.tsxcontains all UI copy forzh-TW,zh-CN, anden.src/pages/admin/contains admin UI screens.src/adminPaths.tshandles admin path prefix logic. Keep it in sync with backend/nginx admin host config if changed.
Environment variables
See .env.example and README.md for details. Do not commit real secrets or private deployment keys.
Common production public build env:
VITE_API_URL=https://api.ark-library.com
VITE_DISABLE_ADMIN=true
Deployment context
.gitea/workflows/deploy.yml deploys on push to main:
npm cinpx tsc --noEmitnpm run format:checknpm testnpm run buildwith production public env- rsync
dist/to both frontend servers - compare remote
index.htmlchecksums
Agent behavior preferences
- Answer Terry in concise Chinese unless the task requires code/docs in English.
- Prefer small, direct fixes over broad refactors.
- Update README/docs/memory when learning non-obvious project facts.
- Search existing project memory before making decisions about workflow, deploy, or conventions.