Use bun for EVERYTHING. Never use npm, pnpm, or yarn.
bun install- Install dependenciesbun run dev- Start development server with watch modebun run build- Compile TypeScript to dist/bun run start- Run compiled server (runs build first via prestart)bun test- Run all testsbun run <script>- Run any script from package.json
bun run backfill- Run full backfillbun run backfill:daily- Backfill daily databun run backfill:hourly- Backfill hourly databun run backfill:ten-minute- Backfill 10-minute data
src/
├── server.ts # Express server entry point
├── config.ts # Configuration & environment variables
├── services/ # Business logic & data processing
│ ├── tenMinuteVolumeService.ts
│ └── [other services]
├── schema/ # Database schema & types
└── types/ # TypeScript type definitions
- Runtime: Bun (native TypeScript)
- Framework: Express.js
- Database: PostgreSQL (pg driver)
- Blockchain: Solana Web3.js, Anchor Framework
- Monitoring: Prometheus (prom-client)
- Testing: Bun's native test runner
- Start dev server:
bun run dev - Make code changes in src/
- TypeScript errors will show in terminal
- Run tests:
bun test - Build for production:
bun run build
- Copy
example.envto.env - Configure PostgreSQL connection and API keys
- Run backfill if needed:
bun run backfill
- Package Manager: This project uses Bun exclusively. Do NOT run
npm install,npm run,pnpm, oryarn. - TypeScript: Target is ESNext, compiled to dist/ via
bun run build - Main files:
index.ts- Module entry pointsrc/server.ts- Server startuptsconfig.json- Compiler config
- Lock file:
bun.lock- commit this, not node_modules
- Tests run via Bun's native test runner
- Test files go in
tests/directory - Run with:
bun test
- Development:
bun run dev(with file watching) - Production build:
bun run build→ outputs todist/ - Production start:
bun run start(runs build first via prestart script)
- Uses PostgreSQL with pg driver
- Schema defined in
src/schema/ - Connection configured via .env (DATABASE_URL)
- Backfill scripts in
scripts/directory
| Issue | Solution |
|---|---|
| Dependencies missing | bun install |
| TypeScript errors | bun run build to see full errors |
| Tests fail | bun test to run suite |
| ENV vars missing | Copy example.env to .env and fill values |
README.md- Project overviewARCHITECTURE_COMPARISON.md- Architecture decisionsIMPROVEMENTS.md- Recent improvements madeCODE_REVIEW_README.md- Code review guidelines