No description
  • Python 55.4%
  • JavaScript 31.9%
  • CSS 11.7%
  • Dockerfile 0.6%
  • HTML 0.4%
Find a file
moserhu cf6758cfd1
Some checks failed
/ docker-build-and-push (backend) (push) Failing after 16s
/ docker-build-and-push (frontend) (push) Successful in 40s
feat(cart-sheet): corporate WM pricing + email quote
- Corporate pricing toggle: on dozers/packers the four core lines net $44,500
  to the WM contract (software MSRP 17,000, auto per-line discounts).
  Excavators/graders untouched.
- Email quote: send the .xlsx to a preset RDO recipient (Resend, SMTP fallback).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 11:57:23 -05:00
.forgejo/workflows Initial commit: EM Tools — Landfill cart sheet + backend OTP login 2026-06-19 12:38:52 -05:00
.github/workflows Initial commit: EM Tools — Landfill cart sheet + backend OTP login 2026-06-19 12:38:52 -05:00
backend feat(cart-sheet): corporate WM pricing + email quote 2026-06-22 11:57:23 -05:00
deploy Rename EM Tools -> EMT Tools across the app and infra 2026-06-19 13:17:38 -05:00
frontend feat(cart-sheet): corporate WM pricing + email quote 2026-06-22 11:57:23 -05:00
.gitignore Initial commit: EM Tools — Landfill cart sheet + backend OTP login 2026-06-19 12:38:52 -05:00
CLAUDE.md Rename EM Tools -> EMT Tools across the app and infra 2026-06-19 13:17:38 -05:00
docker-compose.yml Rename EM Tools -> EMT Tools across the app and infra 2026-06-19 13:17:38 -05:00
README.md Rename EM Tools -> EMT Tools across the app and infra 2026-06-19 13:17:38 -05:00

EMT Tools

Internal RDO / Carlson field tooling (domain emttools.com). After a backend-validated login, employees pick an AREA:

  • Landfill — the Cart Sheet builder (live).
  • Solar / Mining — coming soon.

Stack: FastAPI + React (CRA) + nginx, built on arm64 via Forgejo Actions and deployed to the knapp Pi. Cloned out of the_system's cart builder.

Login flow (all validation server-side)

  1. Enter Employee ID → backend confirms it's a real, active employee.
  2. Enter email → backend verifies it matches that employee on file.
  3. Backend emails a 6-digit one-time code (Gmail SMTP, 5-min TTL, rate-limited).
  4. Enter the code → backend issues a JWT (httponly cookie + bearer token).

Employees and their area access are managed in-app on /admin/employees (admin only).

Layout

backend/   FastAPI app (app/apps: auth, employees, areas, work/cart_sheet)
frontend/  React SPA (apps: auth, landing, areas, employees, landfill/cart_sheet)
deploy/    Pi compose + Caddyfile (production)
.forgejo/  primary CI (arm64, pushes to git.ttdsm.org registry)
.github/   backup CI (guarded; github.com only)

Local development

Backend (points at emttools_test on the Pi's Postgres):

cd backend
python3 -m venv env && source env/bin/activate
pip install -r requirements.txt
cp .env.example .env   # fill DATABASE_URL, SECRET_KEY, EMAIL_APP_PASSWORD
uvicorn app.main:app --reload --port 8000

Frontend:

cd frontend
npm install
npm start   # http://localhost:3000, talks to backend on :8000

Database

Create the databases once in the postgres container on the Pi:

ssh knapp "docker exec -i postgres psql -U hunterMo -c 'CREATE DATABASE emttools_test;'"
ssh knapp "docker exec -i postgres psql -U hunterMo -c 'CREATE DATABASE emttools_prod;'"

Apply the schema (test first):

ssh knapp 'docker exec -i postgres psql -U hunterMo -d emttools_test' < backend/migrations/0001_init.sql

Deploy

CI builds git.ttdsm.org/moserhu/emt-tools-{backend,frontend}:<sha> on push to main. On the Pi, bump BUILD_VERSION to the full SHA in ~/apps/emtTools/.env, then docker compose pull && docker compose up -d.

DNS

emttools.com A 99.145.203.56 (public home IP, matching colostro-calc.com).