A private BitStockerz monorepo that combines product and database documentation with an early NestJS API implementation.
- Type: private product monorepo
- Current repo version:
0.0.0 - Maturity: pre-1.0 documentation and API foundation
- Current runnable surface:
apps/api - Release model: manual changelog + release branch flow documented in RELEASE.md
- Changelog: CHANGELOG.md
- Release process: RELEASE.md
- Product roadmap: docs/product/ROADMAP.md
- MVP definition: docs/product/MVP.md
- UX flows: docs/product/UX_Flows.md
- API inventory: docs/database/API_Inventory.md
- Database schema (full MVP target): docs/database/schema.prisma
- Runnable API schema: apps/api/prisma/schema.prisma
- Product definition and implementation planning for the BitStockerz platform.
- Database design, migration planning, lifecycle policy, and API inventory work.
- A NestJS API foundation under
apps/api, including auth, WebAuthn, market-data symbols, candle read APIs, jobs, and ingestion.
- Root tooling: npm, Husky, and commitlint
- API app: NestJS 11, TypeScript, Jest, Pino, and WebAuthn foundations
- Database planning: Prisma schema plus SQL documentation and migration notes
apps/apiNestJS API implementationdocs/productproduct roadmap, MVP, UX flows, and storiesdocs/databaseschema, migration, lifecycle, and API design docsdocs/manual-testingcurl-based API smoke test guidescriptsDocker MySQL, sprint verification, and HTTP smoke helpers- root
package.jsonrepo tooling and release version anchor
- Node.js
24.11.1forapps/api - npm
- Install root dependencies with
npm install. - Install API dependencies with
npm --prefix apps/api install. - (Recommended) Start local MySQL and apply migrations — see docs/database/Local_MySQL.md.
- Start the API with
npm --prefix apps/api run start:dev(defaults tohttp://localhost:4000/api). - Use the
docs/tree as the source of truth for roadmap, product, and data-model context while you work.
npm run prepareinstalls Husky hooks for the repo../scripts/docker-mysql.sh startstarts MySQL 8 in Docker for local persistence.npm --prefix apps/api run buildbuilds the NestJS API.npm --prefix apps/api run lintruns the API lint checks.npm --prefix apps/api run testruns the API unit test suite.npm --prefix apps/api run test:covruns unit tests with 90% global coverage gates.npm --prefix apps/api run test:e2eruns the API end-to-end suite (seed mode; seeapps/api/test/setup-e2e.ts).npm --prefix apps/api run db:deployapplies Prisma migrations to MySQL../scripts/smoke-test-api.sh --sprint allruns HTTP smoke tests (API must be running; readsDATABASE_URLfromapps/api/.envwhen set)../scripts/sprint-delivery-verify.sh verifyruns build, lint, test, test:cov, test:e2e, then smoke tests in seed mode (clearsDATABASE_URLfor the smoke API even whenapps/api/.envdefines it).KEEP_DATABASE_URL=1 ./scripts/sprint-delivery-verify.sh verifyruns the same gates, then smoke tests with MySQL (loadsDATABASE_URLfromapps/api/.env).
Configuration lives in apps/api/.env (copy from apps/api/.env.example; never commit .env).
| Variable | Purpose |
|---|---|
DATABASE_URL |
MySQL connection URL. Omit for in-memory seed mode. |
INGESTION_SCHEDULER_ENABLED |
Hourly background imports. When unset: true if NODE_ENV=development, otherwise false. Always off when NODE_ENV=test. Set false during manual ingestion tests. |
JOB_TIMEOUT_MS |
Job executor timeout (default 30000). |
JOBS_SYSTEM_USER_ID |
User id for scheduled jobs (default matches migration seed). |
PORT |
API listen port (default 4000). |
MARKET_DATA_HEALTH_URL |
Optional URL probed by /health/ready checks.marketData. |
AUTH_RATE_LIMIT_WINDOW_MS / AUTH_RATE_LIMIT_MAX_REQUESTS |
Auth ceremony rate limits (defaults 60000 / 30). |
LOG_TO_FILE / LOG_FILE_PATH |
Optional file logging (see Observability.md). |
The API loads apps/api/.env automatically on startup via src/load-env.ts. Restart after editing .env.
MySQL with Docker: full setup in docs/database/Local_MySQL.md.
- Start database:
./scripts/docker-mysql.sh start - Apply migrations:
npm --prefix apps/api run db:deploy - Manual curl tests: docs/manual-testing/manual_testing.md
- API-focused releases should run
build,lint,test,test:cov, andtest:e2efromapps/api, or./scripts/sprint-delivery-verify.sh verifyfrom the repo root. - Unit tests enforce 90% global coverage (
branches,functions,lines,statements). - E2E tests always run in seed mode (
NODE_ENV=test, noDATABASE_URL) so they do not depend on a local MySQL instance. ./scripts/sprint-delivery-verify.sh verifystarts the API for smoke tests in seed mode (clearsDATABASE_URLfor that process). UseKEEP_DATABASE_URL=1to run smoke against MySQL usingDATABASE_URLfromapps/api/.env.- Documentation-heavy releases should verify consistency across the roadmap, MVP, API inventory, and schema documents.
- Keep the root
CHANGELOG.mdupdated under## [Unreleased]. - Cut release branches as
release/vX.Y.Zfrommain. - Use repo-level tags and release notes even when a release only affects
apps/api; note the scope clearly in the changelog entry. - Follow the full checklist in RELEASE.md.
- docs/product/MVP.md
- docs/product/ROADMAP.md
- docs/product/UX_Flows.md
- docs/database/API_Inventory.md
- docs/database/schema.prisma (full MVP target schema)
- apps/api/prisma/schema.prisma (runnable subset through Sprint 1.3)
- docs/database/Local_MySQL.md
- docs/manual-testing/manual_testing.md
UNLICENSED and proprietary.