Skip to main content

Project structure

zero-finance/
├── packages/
│   ├── web/          # Next.js application
│   ├── cli/          # agent-bank package
│   └── docs/         # Public documentation site
├── scripts/          # Build and deployment scripts
└── deployments/      # Contract deployment manifests

Development workflow

1. Create a feature branch

git checkout -b feat/your-feature-name

2. Make changes

Follow the existing code style:
  • TypeScript for all code
  • Prettier formatting (2 spaces, single quotes)
  • ESLint rules from next/core-web-vitals

3. Run quality checks

pnpm typecheck
pnpm lint
pnpm --filter @zero-finance/web test

4. Commit and push

git add .
git commit -m "feat: add your feature"
git push -u origin feat/your-feature-name

5. Create a pull request

PRs should include:
  • Summary of changes
  • Testing notes
  • Screenshots (for UI changes)

Code style

TypeScript

  • Prefer const over let
  • Use explicit return types for exported functions
  • Document complex logic with comments

React

  • Functional components with hooks
  • PascalCase for components
  • camelCase for hooks and utilities

Tailwind

Order classes: layout → spacing → colors
// Good
<div className="flex items-center gap-4 p-4 bg-white text-gray-900">

// Avoid
<div className="bg-white p-4 flex text-gray-900 gap-4 items-center">

Database changes

Use Drizzle migrations:
# Generate migration
pnpm --filter @zero-finance/web db:generate

# Apply migration
pnpm --filter @zero-finance/web db:migrate

Testing the CLI locally

Build and link the CLI:
cd packages/cli
pnpm build
pnpm link --global
Point to your local server:
zero auth login --api-key sk_test_xxx --base-url http://localhost:3050

Useful scripts

ScriptDescription
pnpm devStart all dev servers
pnpm dev:liteStart with lite Docker stack
pnpm buildBuild all packages
pnpm lintRun ESLint
pnpm typecheckRun TypeScript checks
pnpm formatCheck Prettier formatting
pnpm format:fixFix formatting issues

Getting help

  • Check existing issues on GitHub
  • Ask in the team Slack/Discord
  • Review the codebase — most patterns are self-documenting