chore: scaffold PYRE MVP monorepo (structure + docs)
pnpm + TypeScript workspace per design doc §13:
- apps/{web,api,worker} skeletons (Next.js 16, Fastify 5, BullMQ)
- packages/{core,solana,prometheus,db,config} (core has real types/DTOs;
solana/prometheus are stubs)
- programs/pyre-core placeholder (future Anchor, v1.0)
- docs/: PYRE_MVP_DESIGN (canonical), ARCHITECTURE, SECURITY, TOKEN_CLASSIFICATION
- CLAUDE.md, README, .env.example (no private-key var by design)
Skeleton + docs only — no Solana/business logic yet. All workspaces typecheck clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
44
packages/db/src/index.ts
Normal file
44
packages/db/src/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @pyre/db — database schema, migrations, and table definitions (SKELETON).
|
||||
*
|
||||
* Responsibilities (§13): database schema, migrations, table definitions.
|
||||
* Schema reference: §15 (MVP Database Schema) of `docs/PYRE_MVP_DESIGN.md`.
|
||||
*
|
||||
* No queries are implemented here yet — only table-name constants and a
|
||||
* connection-factory stub.
|
||||
*/
|
||||
import type { Pool } from "pg";
|
||||
|
||||
/**
|
||||
* Canonical table names. Centralized so query/migration code references a single
|
||||
* source of truth.
|
||||
*/
|
||||
export const TABLES = {
|
||||
// Initial MVP tables (§15)
|
||||
WALLET_SCANS: "wallet_scans",
|
||||
TOKEN_ACCOUNTS: "token_accounts",
|
||||
CLEANUP_RECEIPTS: "cleanup_receipts",
|
||||
PROMETHEUS_GENERATIONS: "prometheus_generations",
|
||||
SPAWN_RECORDS: "spawn_records",
|
||||
|
||||
// Future tables (§15)
|
||||
TOKEN_CLASSIFICATIONS: "token_classifications",
|
||||
BURN_EVENTS: "burn_events",
|
||||
CLOSE_ACCOUNT_EVENTS: "close_account_events",
|
||||
SPAWN_CANDIDATES: "spawn_candidates",
|
||||
SYSTEM_EVENTS: "system_events",
|
||||
} as const;
|
||||
|
||||
export type TableName = (typeof TABLES)[keyof typeof TABLES];
|
||||
|
||||
/**
|
||||
* Connection-factory stub.
|
||||
*
|
||||
* TODO: create and cache a `pg` Pool from DATABASE_URL (resolved via
|
||||
* `@pyre/config` — never hardcode credentials). Then add a migration runner and
|
||||
* typed table-definition / query layer. No queries are implemented yet.
|
||||
*/
|
||||
export function createPool(): Pool {
|
||||
// TODO: const { databaseUrl } = loadConfig(); return new Pool({ connectionString: databaseUrl });
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
Reference in New Issue
Block a user