Skip to content

srisaihariharan/code_kong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CodeKong ๐Ÿฆ

Alternative Credit Scoring (Multiโ€‘Step React Application)

Vite TypeScript TailwindCSS Tests License: MIT

Modern, privacyโ€‘friendly alternative credit scoring demo: structured multiโ€‘step intake, modular factor scoring, runtime validation, accessibility enhancements, and CIโ€‘ready codebase.

โ–ถ๏ธ Live Demo ยท ๐Ÿ› Issues

โœจ Feature Highlights

  • 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)

๐Ÿงฎ Scoring Factors (High Level)

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.

๐Ÿ—‚๏ธ Project Structure

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 flow

Notes:

  • 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.

๐Ÿš€ Quick Start

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)

Production Build / Preview

npm run build
npm run preview   # Serve dist/ locally

โœ… Scripts Overview

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

๐Ÿงช Testing

Vitest + jsdom. Coverage currently targets: scoring logic, factor calculators, validation schemas.

Run tests:

npm test

With coverage:

npm run coverage

โ™ฟ Accessibility

  • 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.

๐Ÿ›ก๏ธ Data Integrity & Persistence

State persisted in localStorage under a versioned key; hydration validates via composite schema to avoid stale / corrupted shapes. Invalid payloads are discarded safely.

๐Ÿ”„ CI Pipeline

GitHub Actions workflow runs: lint โ†’ typecheck โ†’ test โ†’ build on pushes / PRs to main ensuring consistent quality gates.

๐Ÿงญ Roadmap (Short)

  • 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

๐Ÿ‘ฅ Team

  • Prodhosh V.S
  • Gowreesh V T
  • Sri Sai Hariharan
  • Kailash R

๐Ÿ“ท Screenshots

Expand gallery

Personal Information Banking Information Employment History Rent Payment History Utility Payment History Education History Score Breakdown Financial Coaching Feature

๐Ÿค Contributing

Issues & pull requests welcome. Please:

  1. Fork & create a feature branch (feat/your-feature)
  2. Make changes with tests where reasonable
  3. Run npm run lint && npm run typecheck && npm test
  4. Open PR describing rationale & screenshots (if UI)

๐Ÿ“ฌ Contact

-Linkedin: Prodhosh -Linkedin: Sri sai -Linkedin: Gowreesh -Linkedin: Kailash

๐Ÿ“„ License

MIT ยฉ CodeKong Contributors. See LICENSE.


This is a demo; for real data usage add encryption, PII minimization & regulatory compliance layers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages