A web application for prioritizing items using urgency, value, and duration metrics.
URL: http://localhost:8000/ or http://localhost:8000/index.html
The main application interface where users can:
- Add and manage items
- Set urgency, value, and duration for items
- Navigate through stages: Items → Urgency → Value → Duration → Results
- View prioritized results sorted by CD3 (Cost of Delay Divided by Duration)
The app automatically initializes on page load, either loading existing state or starting fresh with defaults.
URL: http://localhost:8000/debug.html
A debug page for developers to view the application's internal state in JSON format. This page:
- Displays current stage, locked status, buckets configuration, and all items
- Auto-refreshes every 2 seconds to show live updates
- Useful for debugging and inspecting application state
- Not linked from the main app (hidden route for developers)
URL: http://localhost:8000/tests.html
A standalone test runner that automatically executes the full test suite. This page:
- Completely decoupled from the main app
- Automatically initializes its own app instance
- Runs all tests on page load
- Displays test results with pass/fail counts
- Shows status messages during initialization ("Initializing test environment...", "Starting app...", "Running tests...", etc.)
- Includes a "Copy Failing Tests" button when tests fail
- Not linked from the main app (hidden route for developers)
-
Start the development server:
python3 server.py
-
Open your browser and navigate to:
- Main app:
http://localhost:8000/ - Debug page:
http://localhost:8000/debug.html - Tests:
http://localhost:8000/tests.html
- Main app:
- All three pages operate independently and can be open simultaneously in different tabs
- The main app persists data in browser localStorage
- The tests page uses separate storage keys to avoid interfering with app data
- The debug page shows a read-only view of the current application state
The codebase follows a modular architecture organized by concern. Here's an overview of the file and folder structure:
index.html- Main application entry point. Contains the HTML structure and initializes the app viaapp.jsapp.js- Core application logic. Orchestrates all modules, handles business logic, and manages the application lifecycleapp-api.js- Public API functions exposed globally for testing and debugging purposesstyles.css- Global stylesheet containing all CSS for the applicationhelp.html- Standalone help documentation page with analytics trackingdebug.html- Developer debug page showing application state in JSON formattests.html- Standalone test runner pageserver.py- Simple Python HTTP server for local developmenttest-adapter.js- Test adapter providing a clean interface for test suites to interact with the apptest-data.json- Sample test data used by test suites
analytics.js- Core analytics abstraction module. Handles Amplitude initialization, environment-based API key selection (dev vs production), and providestrackEvent()andidentify()functionsstageEvents.js- Centralized analytics tracking for stage view events (View Items, View Urgency, View Value, View Duration, View Results)
items.js- Item model and business logic. Handles item creation, property updates, CD3 calculations, confidence-weighted CD3, sequence management, and notesbuckets.js- Bucket configuration model. Manages urgency/value/duration buckets, validation, defaults, and bucket operationsstages.js- Stage navigation model. Defines stage order, validates stage transitions, and manages stage controller logicconstants.js- Application-wide constants (categories, levels, property metadata, storage keys)bucketActions.js- Bucket action handlers for settings operationsderived/items.js- Derived state functions for items. Computes business logic like parking lot detection, completion checks, and permission logic (canSetValue, canSetDuration, etc.)
appState.js- Centralized state management. Handles localStorage persistence, app state retrieval/saving, and provides theStoresingleton for state access
display.js- General display utilities (JSON display, stage navigation updates, locked display, settings population)stageView.js- Generic stage view controller. Handles common view visibility logic and analytics tracking for stage transitionsforms.js- Form utility functions (HTML escaping, form helpers)display/- Stage-specific view modules:index.js- Central export point for all display functionsitemListingView.js- Item listing stage view (displays items, manages "Start Prioritizing" button)urgencyView.js- Urgency stage view (3-column layout for urgency buckets)valueView.js- Value stage view (3x3 grid for value/urgency combinations)durationView.js- Duration stage view (3x3 grid with duration dropdowns)resultsView.js- Results stage view (ranked list with CD3 scores, confidence surveys, reordering)
render/- Common rendering primitives:itemHeader.js- Reusable item header rendering (name, link, notes badge, inactive state styling)
listeners.js- Main event listener orchestrator. Sets up all event listeners and handles results view interactions (reordering)items.js- Item operation event listeners (add, remove, bulk add, property setting, navigation buttons)navigation.js- Stage navigation event listenerssettings.js- Settings form event listeners (bucket limits, weights, titles, descriptions)modals.js- Modal event listeners (notes, confidence surveys, clear data confirmation)app-controls.js- App control event listeners (help link, clear data, toggle locked)
csvExport.js- CSV export functionality. Generates CSV files with item data, handles CSV escaping, and triggers browser downloads
commands.js- Command configuration (if used for CLI or API commands)
test-runner.js- Main test runner that executes all test suitestest-core.js- Core testing utilities and assertionssuites/- Individual test suite files:basic-items.js- Basic item operations (create, update, remove)buckets.js- Bucket configuration and validation testsstages.js- Stage navigation and validation testscd3.js- CD3 calculation testscost-of-delay.js- Cost of delay calculation testsconfidence-survey.js- Confidence survey functionality testscsv-export.js- CSV export functionality testsenhanced-item-listing.js- Item listing view enhancements (new items, buttons)item-state.js- Item state management testslocked-mode.js- Locked mode behavior testsnotes.js- Item notes functionality testsproperty-validation.js- Property validation testssequence.js- Item sequence and reordering testsboard-position.js- Board position calculation testsbulk-operations.js- Bulk item operations tests
- Separation of Concerns: Models handle business logic, UI handles rendering, events handle user interactions
- Modular Design: Each module has a clear responsibility and can be tested independently
- State Management: Centralized state via
Storesingleton with localStorage persistence - Analytics Abstraction: Analytics calls go through abstraction layer for easy provider switching
- Derived State: Business logic computations extracted from UI code into
models/derived/ - Stage-Based Views: Each stage has its own view module for maintainability
- Event Delegation: Event listeners use delegation patterns for dynamic content