Skip to content

Harwav/Andent_Webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

206 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Andent Webapp

Standalone Andent web application for browser-based dental workflow automation.

Overview

Andent Web provides a modern web interface for dental case intake, STL classification, and PreFormServer handoff. It accepts STL uploads, automatically classifies model types (Ortho, Die, Tooth, Splint), plans compatibility-aware Form 4B/Form 4BL builds, preserves per-file preset hints, and can hold below-target final builds until more compatible sent cases arrive or the office cutoff releases them.

Current Repository Scope:

  • Browser-based STL upload
  • Per-file classification table
  • Durable Model Type, Preset, and Printer edits
  • Queue management and batch operations
  • Compatibility-aware Form 4B/Form 4BL build planning
  • Density-based build holding with operator release
  • PreFormServer handoff and print queue tracking

Quick Start

Prerequisites

  • Python 3.9+
  • pip or uv

Installation

# Clone the repository
git clone https://github.com/Harwav/Andent_Webapp.git
cd Andent_Webapp

# Create virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # macOS/Linux

# Install dependencies
pip install -r requirements.txt

Run Locally

# From the repository root
uvicorn app.main:app --reload --port 8090

Open in browser:

http://localhost:8090/

Windows Desktop EXE

FormFlow can also be packaged as a single Windows tray application. The EXE starts the FastAPI server in the background, shows a green/yellow/red system-tray readiness icon, opens FormFlow in the browser, and exposes tray actions for status, PreFormServer recheck, restart, logs, and quit.

# Build the versioned EXE from app/version.py
python scripts/builders/build_windows_exe.py

# Smoke-test without opening a browser
$env:FORMFLOW_WEB_PORT = "8765"
$env:FORMFLOW_WEB_OPEN_BROWSER = "0"
$exe = Resolve-Path "dist\FormFlow_v0.1.0.exe"
$p = Start-Process -FilePath $exe -PassThru -WindowStyle Hidden
Invoke-RestMethod http://127.0.0.1:8765/health
Stop-Process -Id $p.Id -Force
Remove-Item Env:\FORMFLOW_WEB_PORT -ErrorAction SilentlyContinue
Remove-Item Env:\FORMFLOW_WEB_OPEN_BROWSER -ErrorAction SilentlyContinue

Packaged runtime data defaults to folders beside the EXE (data/, output/, logs/) unless FORMFLOW_WEB_DATA_DIR, FORMFLOW_WEB_OUTPUT_DIR, or FORMFLOW_WEB_DATABASE_PATH override the paths. Startup diagnostics are written to logs/formflow_tray_diagnostic.log.

Health Checks

curl http://localhost:8090/health
curl http://localhost:8090/health/live
curl http://localhost:8090/health/ready

Project Structure

Andent_Webapp/
├── app/                       # FastAPI web application
│   ├── main.py                # Application entry point
│   ├── config.py              # Settings and configuration
│   ├── database.py            # SQLite database layer
│   ├── schemas.py             # Pydantic models
│   ├── routers/
│   │   ├── uploads.py         # Upload and classification endpoints
│   │   └── metrics.py         # Metrics dashboard
│   ├── services/
│   │   ├── classification.py  # STL classification logic
│   │   ├── preset_catalog.py   # Preset compatibility metadata
│   │   ├── build_planning.py   # Form 4B/Form 4BL build manifest planning
│   │   ├── planning_preview.py # Build preview logic
│   │   ├── preform_client.py   # PreFormServer local API client
│   │   ├── print_queue_service.py # Print handoff and queue sync
│   │   └── prep_pipeline.py    # Prep pipeline utilities
│   └── static/                # Frontend assets
├── core/                      # Shared backend modules
│   ├── andent_classification.py  # Case ID and artifact classification
│   ├── batch_optimizer.py        # STL dimension/volume utilities
│   ├── stl_validator.py          # STL file validation
│   ├── andent_service_pipeline.py # Prep pipeline orchestration
│   ├── andent_planning.py        # Build planning logic
│   ├── fps_parser.py             # FPS file parser
│   └── constants.py              # App constants
├── tests/                     # Test suite
├── desktop/                   # Windows tray runtime and packaged server lifecycle
├── scripts/builders/          # Windows EXE build helpers
├── docs/                   # Product documentation
│   ├── 00_context/
│   ├── 01_requirements/
│   └── 02_planning/
├── requirements.txt
├── formflow.spec              # PyInstaller one-file EXE spec
├── run_formflow.py            # Thin tray-runtime entrypoint
└── README.md

API Endpoints

Uploads

  • POST /api/uploads/classify - Upload and classify STL files
  • GET /api/uploads/queue - List queue rows
  • PATCH /api/uploads/rows/{row_id} - Update classification
  • POST /api/uploads/rows/bulk-update - Bulk update model type, preset, or printer group
  • POST /api/uploads/rows/send-to-print - Send ready rows to PreFormServer using build manifests
  • POST /api/uploads/rows/bulk-delete - Delete rows
  • GET /api/uploads/rows/{row_id}/file - Download STL file
  • GET /api/uploads/rows/{row_id}/thumbnail.svg - Get thumbnail SVG
  • GET /api/uploads/rows/{row_id}/plan-preview - Get case plan preview
  • POST /api/uploads/rows/batch-plan-preview - Batch plan preview
  • GET /api/print-queue/jobs - List tracked print jobs
  • GET /api/print-queue/jobs/{job_id}/screenshot - Fetch cached or remote job screenshot
  • POST /api/print-queue/jobs/{job_id}/release-now - Release a held build to PreFormServer

Print Job Naming

Generated print jobs use YYMMDD_CASEID_CASEID names in build order. Case IDs are sanitized to filename-safe tokens before the name is used for local .form and .png outputs. Names longer than 120 characters are trimmed and suffixed with a stable 10-character hash of the full untrimmed name; same-day collisions receive a numeric suffix.

System

  • GET /health - Health check with timestamp
  • GET /health/live - Liveness probe
  • GET /health/ready - Readiness probe
  • GET /metrics - Metrics dashboard (HTML)

Configuration

Environment variables:

Variable Default Description
FORMFLOW_WEB_HOST 127.0.0.1 Server host
FORMFLOW_WEB_PORT 8090 Server port
FORMFLOW_WEB_DATA_DIR ./data Data directory
FORMFLOW_WEB_DATABASE_PATH ./data/formflow.db Database path
FORMFLOW_WEB_OUTPUT_DIR ./output Local output directory
FORMFLOW_WEB_OPEN_BROWSER 1 Set to 0, false, or no to suppress packaged-runtime browser launch
FORMFLOW_WEB_PRINT_HOLD_DENSITY_TARGET 0.40 Minimum estimated density before a final compatible build dispatches immediately
FORMFLOW_WEB_PRINT_HOLD_CUTOFF_LOCAL_TIME 18:00 Local cutoff time when held builds become releasable

Testing

# Run tests from repository root
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/ -q

Release Gate

npm install
npx playwright install chromium
npm run test:release-gate

This is the hard ship/no-ship gate. It runs environment probes, Python backend tests, Chromium browser flows, canonical Form 4BL dataset classification, live virtual/debug PreFormServer handoff invariants, and packaged EXE startup proof. A release ships only when the command exits 0 and the generated verdict says SHIP: yes.

Prerequisites:

  • Canonical STL data exists at C:\Users\Marcus\Desktop\From 4BL Test Data, or set FORMFLOW_RELEASE_TEST_DATA_DIR.
  • A live compatible PreFormServer is reachable at http://127.0.0.1:44388, or set PREFORM_SERVER_URL.
  • The available PreForm target is virtual/debug only for the release-gate dispatch path.
  • A packaged EXE exists under dist/, for example dist\FormFlow_v0.1.0.exe.

Evidence is written under docs/02_planning/98_VerificationArtifacts/pre_release_* by default, including release-gate.json, verdict.md, stage logs, dataset manifest, PreForm status, browser evidence, print-job evidence, and packaged-runtime evidence.

Roadmap

Current Repository State

  • STL upload and classification
  • Manual model type/preset overrides
  • Queue management
  • Batch operations
  • Compatibility-aware Form 4B/Form 4BL build manifests
  • Printer-group row and bulk edits
  • Density-based holding and Release now path
  • Real PreFormServer handoff path
  • Print Queue tab and job status polling
  • Windows tray EXE runtime and CI packaging smoke test
  • Live PreFormServer/Formlabs acceptance validation

Development

See docs/02_planning/ for product documentation:

License

Proprietary - FormFlow Dent Project

Support

Contact your Formlabs representative for technical support.

About

Standalone Andent web application for browser-based dental workflow automation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors