Alternative Credit Scoring (MultiโStep React Application)
Modern, privacyโfriendly alternative credit scoring demo: structured multiโstep intake, modular factor scoring, runtime validation, accessibility enhancements, and CIโready codebase.
- Multiโstep credit application wizard with local persistence (resume later)
- Full runtime validation via Zod (schemaโdriven + composite user profile)
- Modular scoring engine (separate factor calculators: rent, utility, bank, employment, education)
- Deterministic credit score + qualitative recommendation output
- Accessibility: skip link, focus management, ariaโlive status announcements
- Performance: codeโsplit steps (React.lazy) + prefetching next step bundle
- Resilient data layer: hydrated + validated localStorage state with versioned key
- Typeโsafe service + UI boundary (central hook powering all forms)
- Continuous Integration workflow (lint, typecheck, test, build)
- Defensive scoring (clamped ranges & negative input safeguards)
| Factor | Inputs Considered | Notes |
|---|---|---|
| Rent | Tenure, late & early payments, landlord rating | Rewards consistency & low delinquency |
| Utilities | Payment punctuality, diversity of utility types | Diversity signals stability |
| Banking | Income vs expenses, liquidity (balances), overdrafts, account age | Penalizes overdrafts; liquidity boosts resilience |
| Employment | Current tenure, total experience, employment type, industry | Stability weighted over job title |
| Education | Highest degree, graduation recency, field signal | Higher degrees & recent study add capped incremental lift |
Each factor returns a weighted impact; aggregate is normalized (0โ1000) and tiered.
code_kong/
โโโ index.html # HTML shell loaded by Vite
โโโ package.json # Scripts & dependencies
โโโ vite.config.ts # Vite build/dev configuration
โโโ vitest.config.ts # Vitest test runner config
โโโ vitest.setup.ts # Test environment setup (jsdom, matchers)
โโโ tailwind.config.js # Tailwind design system config
โโโ postcss.config.js # PostCSS pipeline
โโโ tsconfig.json # Root TS config (references)
โโโ tsconfig.app.json # TS app compilation config
โโโ tsconfig.node.json # TS node / tooling config
โโโ eslint.config.js # Flat ESLint configuration
โโโ LICENSE # MIT license text
โโโ README.md
โโโ Webpage Snapshots/
โโโ Banking Information Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Education History Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Employment History Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Financial Coaching Feature Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Personal Information Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Rent Payment History Screenshot.jpg # Root snapshot assets (UI examples)
โโโ Score Breakdown Screenshot.jpeg # Root snapshot assets (UI examples)
โโโ Utility Payment History Screenshot.jpeg
โโโ src/ # Project documentation
โโโ main.tsx # React entrypoint (mount root)
โโโ App.tsx # App shell & multiโstep flow
โโโ index.css # Global Tailwind layer imports
โโโ vite-env.d.ts # Vite type declarations
โโโ components/
โ โโโ ProgressBar.tsx # Step progress indicator
โ โโโ ThemeToggle.tsx # Light/Dark theme switch
โ โโโ ErrorBoundary.tsx # Runtime error isolation
โ โโโ WelcomeScreen.tsx # Initial landing screen
โ โโโ CreditScoreResult.tsx # Score + recommendation display
โ โโโ UserProfile.tsx # Aggregated user summary (optional view)
โ โโโ forms/ # Step form components (validated)
โ โโโ PersonalInfoForm.tsx
โ โโโ RentHistoryForm.tsx
โ โโโ UtilityHistoryForm.tsx
โ โโโ BankDataForm.tsx
โ โโโ EmploymentForm.tsx
โ โโโ EducationForm.tsx
โโโ hooks/
โ โโโ useCreditApplicationForm.ts # Reducer state + persistence & validation
โโโ services/
โ โโโ creditScoring.ts # Aggregates factor calculators & derives final score
โ โโโ creditScoring.test.ts # Core scoring service tests
โ โโโ factors/ # Individual scoring factor modules + tests
โ โโโ bank.ts
โ โโโ education.ts
โ โโโ employment.ts
โ โโโ rent.ts
โ โโโ utility.ts
โ โโโ factors.test.ts
โโโ validation/
โ โโโ schemas.ts # Zod schemas (per step + composite)
โ โโโ schemas.test.ts # Validation unit tests
โโโ utils/
โ โโโ userDataFactory.ts # Factory for initial/empty state
โโโ contexts/
โ โโโ ThemeContext.tsx # Theme toggle context
โโโ types/
โ โโโ index.ts # Shared domain types
โ โโโ chat.ts # (If retained; unused after auth removal)
โโโ lib/ # (removed legacy external service clients)
โโโ constants/
โโโ steps.ts # Ordered definition of multiโstep flowNotes:
- Directories/files marked (Legacy) are candidates for removal if no imports remain.
- Factor modules stay pure for testability & deterministic outputs.
- All form components rely on the central reducer hook + Zod schemas.
Requires Node >= 18 (matches engines & CI).
git clone https://github.com/srisaihariharan/code_kong.git
cd code_kong
npm install
npm run dev
# Open the printed local URL (default http://localhost:5173)npm run build
npm run preview # Serve dist/ locally| Script | Purpose |
|---|---|
| dev | Start Vite dev server |
| build | Create production bundle in dist/ |
| preview | Serve built bundle |
| lint | Run ESLint over the project |
| typecheck | TypeScript type checking only |
| test | Run Vitest test suite once |
| test:watch | Watch mode tests |
| coverage | Tests with coverage report |
Vitest + jsdom. Coverage currently targets: scoring logic, factor calculators, validation schemas.
Run tests:
npm testWith coverage:
npm run coverage- Skip navigation link for keyboard / screen reader users
- Focus automatically moved to step container on navigation
- aria-live region announces step changes & final score
- Disabled submit buttons until validation passes to prevent premature submission
Planned: consolidated error summary & enhanced ARIA descriptions for grouped numeric fields.
State persisted in localStorage under a versioned key; hydration validates via composite schema to avoid stale / corrupted shapes. Invalid payloads are discarded safely.
GitHub Actions workflow runs: lint โ typecheck โ test โ build on pushes / PRs to main ensuring consistent quality gates.
- Expand test coverage (hook persistence, accessibility behaviors)
- Enforce coverage thresholds in CI
- Factor attribution UI (visual perโfactor contribution)
- Export / import application snapshots
- Accessibility: error summary + consistent aria-describedby mapping
- Prodhosh V.S
- Gowreesh V T
- Sri Sai Hariharan
- Kailash R
Issues & pull requests welcome. Please:
- Fork & create a feature branch (feat/your-feature)
- Make changes with tests where reasonable
- Run
npm run lint && npm run typecheck && npm test - Open PR describing rationale & screenshots (if UI)
-Linkedin: Prodhosh -Linkedin: Sri sai -Linkedin: Gowreesh -Linkedin: Kailash
MIT ยฉ CodeKong Contributors. See LICENSE.
This is a demo; for real data usage add encryption, PII minimization & regulatory compliance layers.







