How navj62/elekhajokha works
E-Lekha-Jokha is a multi-tenant pledge-shop SaaS. Shop staff authenticate, record customers and jewellery-backed loans, track interest and LTV risk, then release or sell pledges; acquired items can enter inventory. Owners also review operational analytics, reports, notifications and tasks, while customers can view a read-only portal. Access depends on a Razorpay subscription. The graph combines documented product capabilities with sampled routes and UI modules; several domain-to-route links are dashed where implementation wiring was not excerpted.
Main entry points: prisma.ts Prisma client · calculateLTV.ts Interest and LTV · route.ts Access service · pledges Pledge services
Components 20
Identity and access
- Subscription guard
components/SubscriptionGuard.tsx - Access service
app/api/access/route.ts
Customer pledges
- Customer workspace
app/(CustomersDetails) - Pledge services
app/api/customers/[customerId]/pledges - Interest and LTV
lib/calculateLTV.ts - Customer portal
app/view/[token]/page.tsx
Shop operations
- Inventory workspace
app/(UserDetails)/inventory - Inventory services
app/api/inventory/route.ts - Tasks and notices
app/(UserDetails)/tasks - Notification services
app/api/notifications/route.ts
Analytics and reporting
- Shop dashboard
app/(UserDetails)/dashboard/page.tsx - Reports
app/reports - Risk evaluation
app/api/cron/evaluate-risk/route.ts - Metal price updates
app/api/cron/update-prices/route.ts
Persistence and integrations
- Clerk identity
- Razorpay billing
- Cloudinary media
- PostgreSQL
- Prisma client
lib/prisma.ts
Other components
- Shop staff
Connections 30
- Shop staff → Customer workspace: manages customers
README.md - Customer workspace → Pledge services: manages pledges
- Pledge services → Prisma client: queries data
- Prisma client → PostgreSQL: persists records
lib/prisma.ts - Pledge services → Interest and LTV: uses valuation
- Pledge services → Inventory services: records pledge sales
- Customer workspace → Customer portal: shares customer view
- Customer portal → Prisma client: reads pledge data
app/view/[token]/page.tsx - Customer portal → Interest and LTV: calculates interest
app/view/[token]/page.tsx - Shop staff → Inventory workspace: manages inventory
README.md - Inventory workspace → Inventory services: loads inventory
- Inventory services → Prisma client: stores inventory
app/api/inventory/route.ts - Inventory services → Cloudinary media: uploads photos
app/api/inventory/route.ts - Shop staff → Tasks and notices: tracks work
README.md - Shop staff → Shop dashboard: reviews shop
README.md - Shop dashboard → Prisma client: loads snapshot
- Shop dashboard → Interest and LTV: shows risk
- Shop dashboard → Reports: opens reports
- Shop staff → Reports: reviews reports
README.md - Risk evaluation → Interest and LTV: evaluates LTV
app/api/cron/evaluate-risk/route.ts - Risk evaluation → Prisma client: reads pledges
app/api/cron/evaluate-risk/route.ts - Risk evaluation → Notification services: creates alerts
- Metal price updates → Interest and LTV: updates valuations
- Shop staff → Subscription guard: checks access
README.md - Subscription guard → Access service: requests access
- Subscription guard → Clerk identity: checks identity
- Access service → Clerk identity: authenticates user
app/api/access/route.ts - Access service → Razorpay billing: checks subscription
app/api/access/route.ts - Access service → Prisma client: reads subscription
app/api/access/route.ts - Notification services → Prisma client: reads alerts
app/api/notifications/route.ts