Go to file
Talha Ahmed d823a45cb2 Production readiness: month separation, auth, FX service, AWS deployment
Month management & data separation:
- Fix double-count bug: re-uploading a filename updates the existing
  session_files row in place; identical content (sha256) is skipped —
  a closing can never parse the same file twice
- Guard against duplicate closings per reporting month (409 unless
  explicitly overridden); dashboard flags duplicates
- Default new closings to carry-forward openings; month switcher in the
  closing header; publish state visible everywhere; Accounts Summary
  lists unpublished months with the reason instead of dropping them
- Completed closings are locked read-only with an explicit reopen

Authentication (stdlib only, no new deps):
- Per-user login (scrypt + HMAC tokens), AR_AUTH=auto turns on with the
  first user; manage.py add-user/set-password/deactivate-user
- Verified identity feeds reviewed_by/approved_by/confirmed_by

Exchange rates:
- fx_service with provider abstraction: Frankfurter (free, keyless,
  ECB) default, exchangerate-api stub; month-end + daily fetch
  endpoints and UI buttons; rates arrive unconfirmed so Control C5
  still gates the close; cache table; certifi CA bundle

Deployment & hardening:
- Production Docker stack: caddy (auto-HTTPS) + nginx + single-worker
  backend + mysql:8.4; per-context .dockerignore (images carry no
  financial data); .env.example with local+production sections
- deploy/DEPLOY.md runbook + nightly S3 backup script
- Stale-job recovery on startup; export retention (AR_RETENTION_DAYS);
  deep /api/health; request/job logging; Gitea Actions CI
- Repo reorganized: launchers in scripts/, dated lowercase docs,
  root README, .gitattributes for deterministic line endings

Tests: 152 passed (25+ new: dedup, month locking, auth, FX orientation)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 18:46:47 +05:00
.claude Initial commit: AR aging app with root gitignore. 2026-07-29 18:07:21 +05:00
.gitea/workflows Production readiness: month separation, auth, FX service, AWS deployment 2026-08-19 18:46:47 +05:00
ar-aging-app Production readiness: month separation, auth, FX service, AWS deployment 2026-08-19 18:46:47 +05:00
.gitattributes Production readiness: month separation, auth, FX service, AWS deployment 2026-08-19 18:46:47 +05:00
.gitignore fix isuses 2026-08-18 19:37:57 +05:00
README.md Production readiness: month separation, auth, FX service, AWS deployment 2026-08-19 18:46:47 +05:00
plan.md Production readiness: month separation, auth, FX service, AWS deployment 2026-08-19 18:46:47 +05:00

README.md

Finance-Accounts

Finance team tooling for Utopia Brands. The main (currently only) application is the Amazon Accounts Receivable Aging Dashboard — it turns the month's Amazon Custom Unified Transaction exports into the month-end AR workbook, with per-user login, month-end controls, exchange-rate fetching, and a full audit trail.

Repository layout

ar-aging-app/          The application (FastAPI backend · React frontend)
│
├── backend/           Python API + calculation engine + tests
├── frontend/          React + TypeScript dashboard
├── scripts/           Launchers: start.ps1 / start.bat (Windows) · start.command (macOS)
├── deploy/            Production runbook (DEPLOY.md) + backup script
├── docs/              System guide, AR logic, audit reports
├── docker-compose.yml          local Docker stack (dev)
├── docker-compose.prod.yml     production stack (AWS: HTTPS + MySQL + backups)
└── .env.example       every setting, local + production sections

plan.md                Production-readiness plan (architecture, AWS costs, phases)
sample data (local)    "Test Files/" — real Amazon exports; gitignored, never committed

Quick start

I want to… Do this
Run the app on this PC double-click ar-aging-app/scripts/start.bathttp://localhost:5174
Understand the app ar-aging-app/README.md
Deploy to AWS ar-aging-app/deploy/DEPLOY.md (~$5055/month)
See how figures are calculated ar-aging-app/docs/system-guide.md
Read the production plan plan.md
Manage users / fix data python ar-aging-app/backend/manage.py --help

Financial data never enters git: spreadsheets, databases, uploads, and .env* secrets are all ignored (see .gitignore). The only template committed is ar-aging-app/.env.example.