- Python 55.4%
- JavaScript 31.9%
- CSS 11.7%
- Dockerfile 0.6%
- HTML 0.4%
- 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> |
||
|---|---|---|
| .forgejo/workflows | ||
| .github/workflows | ||
| backend | ||
| deploy | ||
| frontend | ||
| .gitignore | ||
| CLAUDE.md | ||
| docker-compose.yml | ||
| README.md | ||
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)
- Enter Employee ID → backend confirms it's a real, active employee.
- Enter email → backend verifies it matches that employee on file.
- Backend emails a 6-digit one-time code (Gmail SMTP, 5-min TTL, rate-limited).
- 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).