This guide records repository-level development conventions for sub2api.
For harness and prompt architecture, see:
docs/HARNESS_ENGINEERING.md
For the current Kimi Code integration plan, see:
plans/2026-03-20-kimi-code-support.md
| Item | Value |
|---|---|
| Upstream repo | Wei-Shaw/sub2api |
| This fork | lay2dev/sub2api |
| Backend | Go + Gin + Ent |
| Frontend | Vue 3 + Vite + pnpm |
| Database | PostgreSQL |
| Cache | Redis |
- Frontend uses
pnpm, notnpm. - If
package.jsonchanges, commit the lockfile update too.
When editing Ent schema:
cd backend
go generate ./ent
go generate ./cmd/serverCommit generated files together with schema changes.
Backend:
cd backend
go test -tags=unit ./...
go test -tags=integration ./...Optional forked-RPC coverage for the USDC deposit watcher:
cd backend
BSC_FORK_RPC_URL=http://127.0.0.1:8545 \
ARBITRUM_FORK_RPC_URL=http://127.0.0.1:8546 \
BASE_FORK_RPC_URL=http://127.0.0.1:8547 \
go test -tags=integration ./internal/service -run 'TestUSDCDepositWatcherForkRPC_'You can set any subset of these env vars. Missing chain env vars are skipped and do not fail the test run.
For a single chain check, set only one env var (for example BASE_FORK_RPC_URL) and run the same command.
Frontend:
cd frontend
pnpm install
pnpm buildRun the narrowest relevant tests first, then broaden if needed.
cd backend
golangci-lint run ./...- Keep changes surgical unless a broader refactor is explicitly requested.
- Do not revert unrelated local changes.
- Treat prompt assets and embedded instruction files as product code.
- Document behavior changes when modifying gateway routing, prompt assets, auth flows, or provider compatibility layers.
When touching provider integrations:
- document transport assumptions
- keep auth/header logic explicit
- avoid hiding provider quirks in unrelated business logic
- prefer configuration-driven compatibility layers before introducing full new platforms
This is especially important for coding-agent style upstreams such as Kimi Code.
# clone
git clone <repo-url>
# frontend deps
cd frontend && pnpm install
# backend tests
cd ../backend && go test -tags=unit ./...
# run backend
cd ../backend && go run ./cmd/serverThis file should not store:
- one developer's personal machine paths
- OS-specific password reset recipes
- private credentials
- fork-specific notes that are better kept in task docs
Put task-specific implementation plans in dedicated files instead.