How ganes-ha/cricvault works
Purpose and delivery
CricVault is a lightweight, offline box-cricket scoring application. The entire product is delivered as a static page, with application UI, logic, credentials, and likely local persistence contained in index.html. README.md documents usage and static hosting.
Entry point and runtime
• Primary application entry point: index.html
• Documentation and deployment guidance: README.md
• Runtime is a browser on mobile or desktop; no server-side application, API, database, build system, or package runtime is present.
• It can be opened directly or served by any static HTTP host, including GitHub Pages or a local Python HTTP server.
Authentication and authorization boundary
Client-side login separates users into Scorer and Viewer roles. Scorers can configure matches, manage players, and record balls; Viewers can access live scoring, scorecards, and history while scoring controls remain locked.
• Credential and role definitions are maintained in the USERS array in index.html.
• This is explicitly a UI-level/shared-device protection boundary, not secure authentication: credentials are exposed in page source and there is no backend validation.
Match setup and team-selection stage
Before scoring begins, the app configures teams and player availability. It supports equal-sized teams and an optional common-player mode.
• With common-player mode disabled, players on the opposing team are hidden during selection.
• With it enabled, one shared player is selected first; that player may participate as either batter or bowler but cannot do both within the same match.
• Setup, player management, and match-start controls reside in index.html.
Ball-by-ball scoring engine
The central control flow is scorer input → ball event validation/classification → match state update → live display/statistics refresh.
• Scorers record each delivery through a keypad or equivalent scoring controls in index.html.
• Wides and no-balls add scoring outcomes but do not consume legal-ball counts.
• Wickets trigger a next-batter selection and an explicit choice of who faces the next ball.
• Viewer sessions can observe state but cannot mutate it.
Innings completion and chase logic
The scoring engine enforces target-based innings completion:
• During a chase, scoring stops immediately once the target is reached.
• Legal deliveries determine overs progression; extras affect runs and bowling figures according to their classification.
• Match state feeds live views and completed-match outputs within index.html.
Presentation and score outputs
The application exposes live scoring, scorecard, and match-history views from the same static client application.
• Batting strike rate is calculated as runs / balls × 100.
• Bowling economy is calculated as runs conceded / overs.
• UI state, scoring state, and output rendering are all part of index.html; no separate frontend modules are present.
Infrastructure and external dependencies
There are no identified external services or backend dependencies. Deployment is static-file hosting:
• GitHub Pages can serve index.html directly.
• A local static server can expose the same artifact for LAN/device access.
• Operational security requiring real identity verification would need to be introduced outside this repository, behind a backend or host-level access control.
Main entry points: index.html Match state · README.md Usage & hosting guide
Components 14
Static delivery
- Usage & hosting guide
README.md - Static HTTP host · GitHub Pages or a local server can serve the app.
Browser application
- CricVault static app · UI, logic, credentials, and local state reside in one page.
index.html - Login & role gate · UI-level shared-device protection only; credentials are exposed client-side.
index.html - USERS credentials · Defines Scorer and Viewer roles.
index.html - Match setup · Configures teams, players, and optional common-player mode.
index.html - Scorer controls · Keypad and scoring actions are locked for Viewer sessions.
index.html - Ball scoring engine · Validates and classifies deliveries before updating match state.
index.html - Match state · Holds innings, players, legal balls, runs, wickets, and target.
index.html - Innings & chase rules · Advances legal balls and stops a chase when its target is reached.
index.html - Live scoring view
index.html - Scorecard · Calculates batting strike rate and bowling economy.
index.html - Match history
index.html
Other components
- Mobile or desktop browser
Connections 14
- Usage & hosting guide → Static HTTP host: documents hosting
- Static HTTP host → Mobile or desktop browser: serves page
- Mobile or desktop browser → CricVault static app: loads
- CricVault static app → Login & role gate: initializes
- USERS credentials → Login & role gate: supplies credentials and roles
- Login & role gate → Match setup: Scorer access
- Login & role gate → Scorer controls: permits Scorer mutations
- Match setup → Match state: creates match
- Scorer controls → Ball scoring engine: submits ball events
- Ball scoring engine → Innings & chase rules: applies delivery rules
- Innings & chase rules → Match state: updates innings state
- Match state → Live scoring view: refreshes
- Match state → Scorecard: renders statistics
- Match state → Match history: provides completed matches