How shreeganeshkanoujiya/kosh works
Kosh is a multi-company petty-cash application. Staff sign in, record expenses manually or from UPI screenshots and receipts, then submit them for review; approval updates cash balances and feeds dashboards and reports. The README documents the route → service → repository structure and the approval states. The graph preserves those stages and major capabilities; several UI/API and unsampled subsystem links are shown as unverified where the supplied excerpts do not establish their runtime wiring.
Main entry points: api API routes · repositories Data repositories · transaction.service.ts Expense rules · auth.service.ts Authentication
Components 19
User experience
- App pages
src/app/(app) - Expense entry
src/components/transactions/entry-form.tsx - Approval view
src/components/approvals/approvals-view.tsx
Expense workflow
- Expense rules
src/services/transaction.service.ts - Approval policy
src/services/entry-policy.ts - UPI extraction
src/services/ocr.service.ts - Receipt handling
src/services/attachment.service.ts
Business capabilities
- Cash dashboard
src/services/dashboard.service.ts - Reports and export
src/services/report.service.ts - Company administration
src/services/role.service.ts - Audit trail
src/services/audit.service.ts
Request and identity
- API routes
src/app/api - Authentication
src/services/auth.service.ts - Session validation
src/services/session.service.ts - SMTP mail
Persistence
- File storage
src/lib/storage - Data repositories
src/repositories - PostgreSQL
src/lib/db/prisma.ts
Other components
- Company staff
Connections 24
- Company staff → App pages: uses
README.md - App pages → Expense entry: records expenses
- Expense entry → API routes: submits entries
- Approval view → API routes: reviews entries
- API routes → Expense rules: dispatches
src/app/api/transactions/route.ts - API routes → Authentication: dispatches
src/app/api/me/route.ts - API routes → Reports and export: dispatches
src/app/api/reports/route.ts - API routes → Company administration: dispatches
src/app/api/roles/route.ts - Expense rules → Approval policy: enforces states
README.md - Expense rules → Data repositories: reads and writes
README.md - Reports and export → Data repositories: reads data
README.md - Data repositories → PostgreSQL: queries
src/repositories/entry.repository.ts - API routes → UPI extraction: dispatches
- UPI extraction → Receipt handling: uses screenshot
- API routes → Receipt handling: dispatches
src/app/api/attachments/route.ts - Receipt handling → File storage: stores files
- API routes → Cash dashboard: dispatches
- API routes → Audit trail: dispatches
- API routes → Session validation: checks identity
- Authentication → Session validation: starts sessions
src/services/auth.service.ts - Session validation → Data repositories: persists sessions
src/services/session.service.ts - Authentication → SMTP mail: sends reset mail
src/services/auth.service.ts - Company administration → Data repositories: reads and writes
README.md - Audit trail → Data repositories: writes events
src/services/audit.service.ts