How kheemwel/odds-finder works
1. Project shape
- This is a single-page, client-side probability calculator called *Odds Finder*.
- There is no backend or API layer in the repo; all calculations happen in the browser.
2. App shell and startup
- index.html is the Vite entry document.
- src/index.tsx is the client bootstrap that mounts the app.
- src/App.tsx is the top-level UI composition point for the calculator experience.
3. UI / presentation boundary
- The UI appears to be centered around:
- a win-rate control (slider and numeric input, per README),
- live calculated outputs for several confidence thresholds,
- responsive styling for desktop and mobile.
- The app component likely wires user input directly to the calculator state layer rather than doing math inline.
4. Calculator domain logic
- src/calculator/calculator.ts is the core pure computation module.
- This is where the probability math should live: given a win rate, compute attempts needed to reach thresholds like 30%, 50%, 90%, and 99% confidence.
- This module is the main domain boundary and should be diagrammed separately from the UI.
5. State management
- src/calculator/calculator.store.ts is a dedicated state/store layer.
- It likely holds the selected win rate and exposes derived calculator results to the UI.
- This layer sits between the form controls and the pure math functions, keeping UI logic thin and making updates real-time.
6. Data flow
- The expected flow is:
- user changes win rate in the UI,
- the store updates,
- calculator functions recompute required attempts,
- App.tsx re-renders the displayed thresholds.
- This is a one-way reactive flow from input to state to derived output.
7. Testing boundaries
- src/calculator/calculator.test.ts validates the math logic.
- src/calculator/calculator.store.test.ts validates the state/store behavior.
- The presence of separate tests for logic and store indicates a clear split between deterministic computation and reactive wiring.
8. Styling and layout
- src/index.css provides global styling.
- The README says the UI uses TailwindCSS + DaisyUI, so styling is likely utility-driven with component-level theme classes.
- This affects architecture mainly at the presentation layer; it does not introduce a separate runtime subsystem.
9. Build/runtime toolchain
- The project uses Vite as the build/dev server tool.
- package-lock.json, package.json, tsconfig.json, and vite.config.ts indicate a standard TypeScript front-end toolchain.
- Vite is the only build-time infrastructure that materially affects runtime delivery.
10. PWA and static assets
- The README states Vite PWA Plugin support.
- public/ likely contains static assets used for installability/offline support, such as icons or manifest-related files.
- In architecture diagrams, treat PWA support as an edge capability around the app shell rather than a separate subsystem.
11. Important architectural takeaway
- The repo is organized around a small, testable calculation core surrounded by a thin reactive UI shell.
- The strongest boundary is between:
- presentation/state in App.tsx and calculator.store.ts,
- pure domain math in calculator.ts.
- That separation is the key to understanding and diagramming the system accurately.
12. Note on framework description
- The README describes the app as SolidJS-based, and the source is structured as TSX components in a Vite app.
- For diagramming, the exact component model is less important than the overall structure: browser-only app, reactive UI, pure calculator domain, testable store layer, and PWA packaging.
Main entry points: App.tsx App · package.json Package Manifest · vite.config.ts Vite Config · index.tsx Bootstrap
Components 14
Browser App
Client-side runtime, UI shell, and presentation assets.
- index.html · Vite entry document for the single-page app.
index.html - Bootstrap · Mounts the app into the browser DOM.
src/index.tsx - App · Top-level calculator composition and reactive UI wiring.
src/App.tsx - Global CSS · Base styling and layout rules for the app.
src/index.css - Public Assets · Static files for installability and browser delivery.
public
Calculator Domain
Pure probability logic and reactive state store.
- Calculator Store · Holds win rate state and derived calculator outputs.
src/calculator/calculator.store.ts - Calculator · Computes attempts needed for confidence thresholds from win rate.
src/calculator/calculator.ts - Store Test · Validates store updates and reactive behavior.
src/calculator/calculator.store.test.ts - Math Test · Validates probability calculations and threshold results.
src/calculator/calculator.test.ts
Tooling & Build
Vite-based development, packaging, and static deployment support.
- Vite Config · Build and dev-server configuration, including plugin wiring.
vite.config.ts - Package Manifest · Project scripts and runtime/build dependency declarations.
package.json - Lockfile · Resolved dependency versions for reproducible installs.
package-lock.json - TS Config · TypeScript compiler settings for the project.
tsconfig.json - README · Describes the app, UI behavior, and stack choices.
README.md
Connections 15
- index.html → Bootstrap: loads · The entry document loads the client bootstrap.
- Bootstrap → App: mounts · Bootstrap mounts the top-level app component.
- App → Calculator Store: reads/writes · UI state flows through the calculator store.
- Calculator Store → Calculator: derives · Store uses pure math to produce threshold outputs.
- App → Global CSS: styles · App presentation is shaped by global styles.
- App → Public Assets: uses · The app shell can consume static public assets.
- Store Test → Calculator Store: verifies · Tests the store layer behavior.
- Math Test → Calculator: verifies · Tests the core probability calculations.
- Vite Config → index.html: serves · Vite uses the entry document during development and build.
- Vite Config → Bootstrap: bundles · Vite compiles the client entry and its imports.
- Package Manifest → Vite Config: configures · Project scripts and dependencies drive the Vite setup.
- Package Manifest → TS Config: depends on · TypeScript settings support the application build.
- Package Manifest → Lockfile: pins · Lockfile fixes dependency resolution for installs.
- README → App: describes · Documentation explains the browser calculator experience.
- README → Calculator: describes · Documentation outlines the core win-rate math.