How aku-brecah/akubrecah-entertainment works
Akubrecah is a KRA taxpayer retrieval and certificate portal, with web and WhatsApp entry points. Taxpayers submit an ID or PIN, the server retrieves KRA data, masks it before payment, and supports paid certificate fulfillment; M-Pesa and Cyber Cafe subscriptions extend that journey. The product also includes a WhatsApp bot and an admin console. The graph emphasizes relationships visible in excerpts, the source index, or README; several admin and web subsystems are documented but unsampled, so their internal links are omitted.
Main entry points: retrieve/route.ts Retrieval endpoint · chat/route.ts WhatsApp chat · certificate-fulfillment.ts Certificate fulfillment · prisma.ts Postgres data
Components 27
Web portal
- Retrieval portal
app/retrieval-portal/page.tsx - KRA portal UI
components/kra-portal.tsx - Admin console
app/admin/page.tsx - Admin APIs
app/api/admin - Admin access
lib/admin-auth.ts
KRA retrieval
- Retrieval endpoint
app/api/kra/retrieve/route.ts - KRA API client
lib/kra-api.ts - TSO stations
lib/kra-stations.ts - PIN masking
lib/masking.ts
Payments and fulfillment
- Certificate endpoint
app/api/generate-certificate/route.ts - M-Pesa callback
app/api/mpesa/callback/route.ts - STK dispatch
lib/whatsapp/mpesa-dispatch.ts - Certificate fulfillment
lib/certificate-fulfillment.ts - Cyber Cafe plans
lib/cyber-subscription.ts - User subscriptions
lib/subscription.ts
Bot and operations
- Postgres data
lib/prisma.ts - WhatsApp chat
app/api/whatsapp/chat/route.ts - WhatsApp webhook
app/api/whatsapp/webhook/route.ts - Command parser
lib/whatsapp/commands.ts - Evolution API client
lib/evolution.ts - Bot payments
lib/whatsapp/payments.ts - Bot fulfillment
lib/whatsapp/fulfillment.ts - Structured logging
lib/monitoring/logger.ts
Other components
- Taxpayer
- Safaricom Daraja
- WhatsApp user
- Evolution WhatsApp
Connections 32
- Taxpayer → Retrieval portal: submits lookup
- Retrieval portal → KRA portal UI: renders
app/retrieval-portal/page.tsx - KRA portal UI → Retrieval endpoint: requests lookup
- Retrieval endpoint → KRA API client: fetches taxpayer
app/api/kra/retrieve/route.ts - Retrieval endpoint → TSO stations: resolves station
app/api/kra/retrieve/route.ts - Retrieval endpoint → PIN masking: masks results
app/api/kra/retrieve/route.ts - Retrieval endpoint → User subscriptions: checks access
app/api/kra/retrieve/route.ts - KRA API client → Postgres data: reads records
lib/kra-api.ts - KRA API client → TSO stations: uses station data
lib/kra-api.ts - Certificate endpoint → User subscriptions: gets user
app/api/generate-certificate/route.ts - M-Pesa callback → STK dispatch: maps result
app/api/mpesa/callback/route.ts - M-Pesa callback → Postgres data: updates payments
app/api/mpesa/callback/route.ts - STK dispatch → Safaricom Daraja: sends STK push
- Safaricom Daraja → M-Pesa callback: posts result
- Certificate fulfillment → Postgres data: records downloads
lib/certificate-fulfillment.ts - Certificate fulfillment → User subscriptions: gets user
lib/certificate-fulfillment.ts - Certificate fulfillment → Evolution API client: sends documents
lib/certificate-fulfillment.ts - Cyber Cafe plans → Postgres data: stores plans
lib/cyber-subscription.ts - WhatsApp user → WhatsApp webhook: sends messages
- WhatsApp webhook → WhatsApp chat: dispatches chat
app/api/whatsapp/webhook/route.ts - WhatsApp chat → Command parser: parses commands
app/api/whatsapp/chat/route.ts - WhatsApp chat → Evolution API client: sends replies
app/api/whatsapp/chat/route.ts - WhatsApp chat → Cyber Cafe plans: checks status
app/api/whatsapp/chat/route.ts - WhatsApp chat → Bot payments: starts renewal
app/api/whatsapp/chat/route.ts - Bot fulfillment → Cyber Cafe plans: checks plan
lib/whatsapp/fulfillment.ts - Bot fulfillment → Certificate fulfillment: delivers certificate
lib/whatsapp/fulfillment.ts - Bot fulfillment → Bot payments: starts payment
lib/whatsapp/fulfillment.ts - Bot payments → STK dispatch: dispatches STK
lib/whatsapp/payments.ts - Evolution API client → Evolution WhatsApp: sends messages
lib/evolution.ts - Admin console → Admin APIs: manages records
- Admin APIs → Admin access: checks access
- Retrieval endpoint → Structured logging: logs events
app/api/kra/retrieve/route.ts