Skip to content

CoJoA13/Tempyr

Repository files navigation

Tempyr

CI

Desktop ERP for a metal heat-treating / finishing job shop — scheduling, quality, and fulfillment. Long-term goal: replace Visual Shop.

Proprietary — the source is published for reference only. See LICENSE.

Layout

TypeScript monorepo (npm workspaces):

  • packages/domain — pure shared core (types, selectors, formatting, seed data); no I/O.
  • apps/web — React 18 + Vite + Zustand + React Router. Reads/writes data through a DataGateway seam: InMemoryGateway (seed data, the default) or HttpGateway (the live API, used when VITE_API_URL is set).
  • apps/api — Fastify 5 + PostgreSQL 16 + Drizzle ORM, run under tsx. JWT auth + RBAC, operator-PIN identity, rate-limiting. DB tests use Testcontainers.

Specs and plans live in docs/superpowers/{specs,plans}/; design reference in docs/design-reference/.

Develop — web only

The web app runs against in-memory seed data, so no backend is needed:

npm install
npm run dev        # serve apps/web (InMemoryGateway)
npm test           # all workspace tests (domain + web + api*)
npm run typecheck
npm run lint
npm run build      # build the web app

* the apps/api suite uses Testcontainers and needs Docker running.

Develop — full stack (with the API)

Copy the env templates and fill them in (real .env files are gitignored):

cp apps/api/.env.example apps/api/.env     # DATABASE_URL, JWT_SECRET, OPERATOR_PIN_PEPPER, …
cp apps/web/.env.example apps/web/.env     # VITE_API_URL=http://localhost:3001

Then bring up Postgres, migrate, seed, and run both:

docker compose -f apps/api/docker-compose.yml up -d   # Postgres on :5433
npm run -s db:migrate -w @tempyr/api
npm run -s db:seed    -w @tempyr/api
npm run -s start      -w @tempyr/api                   # API on :3001
npm run dev -w @tempyr/web                             # web reads VITE_API_URL from apps/web/.env

In production the API fails fast at startup unless JWT_SECRET and OPERATOR_PIN_PEPPER are set to strong, non-default values, and db:seed refuses to run unless ALLOW_PROD_SEED=true with non-default credentials — see apps/api/.env.example.

Contributing

See CONTRIBUTING.md for the spec → plan → implementation workflow.

About

ERP prototype for a metal heat-treating / finishing job shop — scheduling, quality, fulfillment. TypeScript monorepo: React + Vite (web), Fastify + Postgres + Drizzle (API).

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages