Skip to main content

Add your description here

Project description

Document Validator - Templates Structure

๐Ÿ“ Directory Structure

realtimex-ai-manifest-template/
โ”œโ”€โ”€ templates/
โ”‚   โ”œโ”€โ”€ index.html          # HTML template
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ”œโ”€โ”€ main.css        # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ modal.css       # Modal and grid view styles
โ”‚   โ”‚   โ”œโ”€โ”€ tree.css        # Tree view styles
โ”‚   โ”‚   โ””โ”€โ”€ components.css  # UI components
โ”‚   โ””โ”€โ”€ js/                 # Application logic split by feature
โ”‚       โ”œโ”€โ”€ state.js
โ”‚       โ”œโ”€โ”€ icons.js
โ”‚       โ”œโ”€โ”€ utils.js
โ”‚       โ”œโ”€โ”€ overrides.js
โ”‚       โ”œโ”€โ”€ changelog.js
โ”‚       โ”œโ”€โ”€ analysis.js
โ”‚       โ”œโ”€โ”€ tree.js
โ”‚       โ”œโ”€โ”€ canvas.js
โ”‚       โ”œโ”€โ”€ render.js
โ”‚       โ”œโ”€โ”€ viewer.js
โ”‚       โ”œโ”€โ”€ verification.js
โ”‚       โ”œโ”€โ”€ ai-enhancements.js
โ”‚       โ””โ”€โ”€ events.js
โ”œโ”€โ”€ batch_data/             # Batch data folders
โ”‚   โ””โ”€โ”€ {batch_id}/         # Each batch has its own folder
โ”‚       โ”œโ”€โ”€ registry.json   # Document registry for this batch
โ”‚       โ”œโ”€โ”€ summary.json    # Batch summary
โ”‚       โ”œโ”€โ”€ data/           # OCR JSON payloads
โ”‚       โ”œโ”€โ”€ enhanced_data/  # AI-enhanced data (optional)
โ”‚       โ”œโ”€โ”€ images/         # Rendered page images
โ”‚       โ””โ”€โ”€ documents/      # Original documents
โ”œโ”€โ”€ user_data/              # User edits (auto-generated, git-ignored)
โ”‚   โ”œโ”€โ”€ overrides.json      # Field value overrides
โ”‚   โ”œโ”€โ”€ changelog.json      # Change history
โ”‚   โ”œโ”€โ”€ verifications.json  # Verification states
โ”‚   โ””โ”€โ”€ dismissed_ai.json   # Dismissed AI suggestions
โ”œโ”€โ”€ server.py               # Python server with API endpoints
โ””โ”€โ”€ README.md

๐Ÿš€ How to Run

1. Start the server

The application requires a Python server to save/load overrides:

cd /path/to/realtimex-ai-manifest-template
python3 server.py

The server will:

  • Serve the application at http://localhost:8000
  • Provide API endpoints for saving/loading overrides
  • Automatically save changes to user_data/ folder
  • Create the user_data/ folder if it doesn't exist

2. Open the dashboard

Navigate to:

http://localhost:8000/templates?batch_id={BATCH_ID}

Example:

http://localhost:8000/templates?batch_id=BATCH-VN-CN-2021-9982

Note: If you omit the batch_id parameter, the app will fallback to legacy paths (../data/, ../images/, etc.)

๐Ÿ“ Files

1. index.html

  • Basic HTML shell
  • Links to CSS and JavaScript modules
  • Minimal body placeholder

2. CSS modules (templates/css/...)

  • main.css: Global styles and CSS variables
  • modal.css: Modal, grid view, and AI enhancement styles
  • tree.css: Tree view styles
  • components.css: UI components (tabs, badges, buttons)

3. JavaScript modules (templates/js/...)

  • state.js: Shared data structures and UI state
  • analysis.js: Data loading, validation logic, and batch URL parameter handling
  • tree.js: Builds and renders the validation tree + related handlers
  • render.js: List/document/table/grid rendering helpers
  • canvas.js: Drawing utilities for the viewer and cropped previews
  • viewer.js: Modal/viewer controls, zooming, and master evidence logic
  • overrides.js: Data override management system for editing field values
  • changelog.js: Changelog viewer UI for tracking all data modifications
  • verification.js: Field verification system
  • ai-enhancements.js: AI enhancement loading and application
  • events.js: Global event wiring, search/tabs, resize handling, and document toggles
  • icons.js & utils.js: Shared SVG icons + formatting helpers

โœจ Features

Batch Data Loading

Load different batches using URL parameter:

?batch_id=BATCH-VN-CN-2021-9982

The app automatically loads from batch_data/{batch_id}/ folder.

Data Override System

The application includes a powerful override system that allows you to edit field values without modifying the original JSON files:

  • Edit Values: Click the edit button (โœ๏ธ) on any field value in the grid view to modify it
  • Visual Indicators: Edited fields are highlighted with an "EDITED" badge
  • Revert Changes: Use the revert button (โ†บ) to restore original values
  • File-based Storage: All overrides are automatically saved to user_data/overrides.json
  • Change Log: View all modifications in the change log panel (clock icon in bottom-right)
  • Auto-Save: Every change is immediately saved to disk

AI Enhancement System

If a document has AI-enhanced data in enhanced_data/ folder:

  • Banner Notification: A banner appears at the top of the document fields panel
  • Apply All: Click โœ“ to apply all AI suggestions at once
  • Dismiss: Click โœ• to hide the banner
  • Individual Suggestions: Apply or dismiss suggestions field by field

Verification System

  • Mark Fields as Verified: Toggle verification status on any validation
  • Verification Statistics: Track verified vs. total fields
  • Persistent State: Verifications are saved to user_data/verifications.json

Change Log Features

  • Track All Changes: Every edit, revert, and clear action is recorded with timestamp
  • Export/Import Backup: Create backups of your overrides or import from a backup file
  • Clear All: Remove all overrides at once (with confirmation)
  • Real-time Updates: Change count badge updates automatically

Responsive Design

  • Desktop (โ‰ฅ1024px): Split-view with validation list and viewer side-by-side
  • Mobile (<1024px): Full-screen modal viewer
  • Auto-resize: UI automatically updates when resizing browser window

Dark/Light Theme

The application supports dark and light themes controlled via URL parameter:

Main Dashboard (index.html):

http://localhost:8000/templates?batch_id=BATCH-VN-CN-2021-9982&theme=dark
http://localhost:8000/templates?batch_id=BATCH-VN-CN-2021-9982&theme=light

Summary Page (summary.html):

http://localhost:8000/templates/summary.html?batch_id=BATCH-VN-CN-2021-9982&theme=dark
  • Default theme is light if no parameter is specified
  • Theme parameter: ?theme=dark or ?theme=light
  • Summary page is designed for iframe embedding with minimal UI

๐Ÿ”ง Maintenance

Update CSS

Edit the modules under templates/css/

Update JavaScript

Edit the modules under templates/js/

Update HTML shell

Edit templates/index.html

โš ๏ธ Notes

  • Use python3 server.py instead of the basic HTTP server โ€” the override system requires API endpoints for saving/loading data.
  • JavaScript modules use batch_id URL parameter to determine data paths.
  • On XL screens the dashboard/tree view stays on the left (scrollable) and previews render on the right.
  • Data overrides are stored in files (in the user_data/ folder) โ€” they persist across sessions and browsers.
  • The user_data/ folder is automatically git-ignored to prevent committing user-specific data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realtimex_manifest_ai-0.1.0.tar.gz (30.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

realtimex_manifest_ai-0.1.0-py3-none-any.whl (30.9 MB view details)

Uploaded Python 3

File details

Details for the file realtimex_manifest_ai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for realtimex_manifest_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 604fb526141f7ce751ded0f841bc1096d4c77754d265a43979de4696321bb4ad
MD5 3199623f33e22c2ba5d5de0c41bbd47e
BLAKE2b-256 53799d66c4184e9a1f11879899c66b476b8b599261288eea2278187f71ea4f94

See more details on using hashes here.

File details

Details for the file realtimex_manifest_ai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for realtimex_manifest_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 634e508b90d27b8f36d913a43b806d4c68dcfaea516d1274e84c971f8d4817f0
MD5 4b0c724e63d3a9c57bb3b3a7a07f0205
BLAKE2b-256 f1b16ff95225082c796bc8486e060cd7db1c8fdb2a67afdfa11c8a46777d85cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page