Skip to findings
maryanneliteproperties/telecaller

Code review · 18 November 2026

Solid bones, three bugs holding the whole thing shut

A TanStack Start + Supabase telecaller app that records customer calls, transcribes them with AI and scores employees. The architecture is better than most projects this young. What is stalling it is an access-control decision left half-made, a PIN that never reaches its check, and AI work done inside a live request.

279
commits
39
branches
25
tagged releases
96.7%
TypeScript
3
open pull requests
2
contributors

What this is based on

I read what the repository publishes: the file tree, README.md, AGENTS.md, roadmap.md, package.json, commit and release history. I did not read every source file line by line, so each finding below separates what is observed in those documents from what is inferred from them.

Everything marked high severity is confirmable in minutes by someone with the code open — the six questions at the end are exactly those checks.

01 · The stack

A modern, coherent choice of parts

No framework soup here. Every dependency has a job, and the jobs do not overlap.

TanStack Start + React 19 + Vite

Full-stack router with server routes; rolldown pinned to 1.2.1 in overrides.

TypeScript end to end

96.7% of the repo. Drizzle schema types flow into the UI.

Tailwind + shadcn/ui on Radix

~28 Radix packages, components.json present — the full shadcn surface.

Supabase (Postgres + Storage + policies)

src/integrations/supabase generated client, supabase/config.toml, 1.6% PLpgSQL in-repo.

Drizzle ORM + committed migrations

database/ and drizzle/ hold SQL and migration history — schema is versioned, not clicked.

AI transcription + scoring

@ai-sdk/openai-compatible through src/routes/api/transcribe.ts (multipart + SSE), Gemini quota handling.

Audio pipeline

@audio/decode-amr and @ffmpeg/core to play what phone recorders actually produce.

Capacitor Android

capacitor.config.json plus a workflow that builds and tags the APK (Build 37 is the latest).

Vitest + ESLint + Prettier + GitHub Actions

src/test, lint/format scripts, Bun-locked reproducible CI installs.

02 · Where things live

The map a new developer needs on day one

src/routes/

File-based pages and server routes, including api/transcribe.ts (the AI boundary).

src/lib/destination*

Data-access clients. Publishable key is client-safe; the secret key is server-only by rule.

src/lib/audio-limits.ts

Upload acceptance: “is this audio?”, with the provider's file cap enforced separately.

src/components/

shadcn/Radix UI layer — sidebar, leads table, report and history screens.

database/ + drizzle/

Tables (telecaller_data, call_reports), SQL functions and migrations.

supabase/

Project config, private call-audio bucket, policies.

.github/workflows/

Lint/test plus the Capacitor Android build and release.

AGENTS.md + roadmap.md

Architectural guardrails and a dated, checkbox-level work log. The most valuable files in the repo.

03 · Scorecard

Honest marks out of ten

Architecture & boundaries

8/10

Clear server/client split, one database, documented rules.

Security posture

5/10

Good key discipline; row-level access is the open question.

Performance / payload

6/10

ffmpeg wasm + 28 Radix packages on a mobile APK.

Code hygiene

7/10

Lint, format, typed end to end; 39 branches is drift.

Test depth

4/10

Vitest exists, but verification is mostly manual browser checks.

Docs & onboarding

3/10

README is still the generator default; no env-var table.

04 · Keep doing this

Six things this repo already gets right

Key discipline is written down

AGENTS.md states that only the publishable key leaves the server and the secret key never does. A rule in the repo beats a rule in someone's head.

Upload acceptance matches reality

Accepting “any audio” and enforcing the provider cap separately is the right call. Field recorders emit AMR, 3GP and odd MIME labels; an allow-list would reject real calls.

The schema lives in Git

Drizzle migrations, PLpgSQL and supabase/config.toml in-repo means the database can be rebuilt from source — rare in a Lovable-started project.

A real release pipeline

25 tags, Bun-locked CI installs and an automated Capacitor APK build. Telecallers can be given a versioned app, not a URL.

AI spend already guarded once

PR #29 stopped duplicate analyses and repeated quota requests — the single biggest cost bug in a transcription app, caught early.

An honest work log

roadmap.md records what was verified, how, and on what date, including what is blocked. This is why a useful review is even possible from outside.

05 · Findings

Nine findings, worst first

Each one: what the repo shows, why it matters, and the fix I would ship.

F-01 High severity

Custom sessions plus Postgres row policies is the risk centre

Observed
Admin signs in with a PIN and employees with an admin-created username/password, while reads go through the destination client.
Why it matters
If those sessions are not Supabase Auth sessions, auth.uid() is null inside the database. Policies then either block everything — which looks exactly like your blank Report page — or get loosened to `using (true)`, which hands every customer name, phone number and call recording to anyone holding the publishable key.
The fix
Pick one: move employee login onto Supabase Auth so auth.uid() is real, or route every lead/report read and write through your own server routes with the secret key and let the anon role see nothing. Do not leave it half-and-half.
F-02 High severity

The Admin PIN is rejected before it is ever checked

Observed
roadmap.md, 2026-10-24: “the configured PIN is rejected by form validation before login, with no runtime errors”, blocking two activation items.
Why it matters
That is a shape mismatch, not a logic bug: the form's zod schema (length, digits-only) disagrees with the stored value, or a hashed PIN is being compared against raw input. It is currently the single thing stalling the whole admin → employee → lead chain.
The fix
Define the PIN format in one shared constant used by the form, the server and the seed. Store a hash, verify in constant time, and add one Vitest case per branch: valid, wrong, malformed, locked.
F-03 High severity

A durable lockout with one admin account can lock you out for good

Observed
The 15-minute attempt limit fired on 2026-10-24 and was retained after investigation.
Why it matters
Rate limiting is correct, but with a single admin identity and no bypass the lockout is a denial-of-service you can trigger on yourself — and during a demo it is unrecoverable.
The fix
Key the limiter on account + IP, keep an attempt log you can read, and add a break-glass reset (a server-side script or an env-gated route) plus a clear “try again in N minutes” message.
F-04 Medium severity

Transcription inside a live request will not survive long calls

Observed
api/transcribe.ts takes a multipart upload and streams progress over SSE; the app is deployed on Vercel.
Why it matters
Serverless functions cap request body size and wall-clock duration. A 30-minute recording on a weak mobile uplink dies mid-stream, and the user is left with a lead that has audio but no analysis.
The fix
Upload straight to storage, then enqueue the analysis as a job with a status column (queued/running/done/failed) the UI polls. Keep SSE for progress, not for the work itself. Chunk anything over ~10 minutes.
F-05 Medium severity

AI cost needs a ceiling, not just de-duplication

Observed
Quota exhaustion and repeated requests were real enough to need a fix.
Why it matters
Per-call scoring scales with headcount. Without caps, one import of 500 old recordings is an unbounded bill — and a 429 retry loop reads as “the app is broken”.
The fix
Store provider, model and token count on every analysis; cap analyses per employee per day; back off exponentially on 429; and show an explicit “quota reached, queued for tomorrow” state instead of retrying.
F-06 Medium severity

Customer PII and call recordings carry retention duties

Observed
telecaller_data holds customer name and phone; call_reports holds audio paths and AI transcripts.
Why it matters
Recordings plus transcripts of identifiable people are sensitive. Under India's DPDP rules you need a stated purpose, a retention limit and a deletion route — and signed URLs that expire.
The fix
Add a recording-consent line to the capture screen, a retention window with a scheduled delete, short-lived signed URLs for playback, and an admin “delete this lead and its audio” action that really removes the object.
F-07 Medium severity

The mobile bundle is carrying a lot

Observed
@ffmpeg/core (wasm, tens of megabytes), an AMR decoder and ~28 Radix packages; vite.config.ts already prebundles Radix menu and tabs.
Why it matters
Inside a Capacitor APK on mobile data, that is slow cold starts for the people who use this all day. The prebundling commits are a symptom of dependency churn.
The fix
Import ffmpeg dynamically only when a format genuinely needs transcoding, prefer the AMR decoder path, split the admin-only screens out of the employee bundle, and set a budget: under ~250 KB gzipped of initial JS.
F-08 Low severity

Repo hygiene is drifting ahead of the product

Observed
39 branches, 3 open PRs and 25 tags for two contributors; README is still the default “Welcome to your Lovable project”.
Why it matters
Stale branches diverge from main until merging them is a rewrite, and a new developer cannot start because no file lists the required environment variables.
The fix
Prune merged branches, protect main (PR + passing checks), and replace the README with a one-screen guide: what the app does, the env-var table, run, test, deploy, build the APK.
F-09 Low severity

Verification is manual where it matters most

Observed
The roadmap's proof is browser clicking: “created an account through the UI, reloaded, logged in as the Employee”.
Why it matters
Thorough, but it does not survive the next refactor — and auth, upload acceptance and score windows are exactly the logic that breaks silently.
The fix
Unit-test PIN verification, session restore, audio acceptance and the call-report date window; add one end-to-end smoke path: admin creates employee → employee logs in → submits a lead with audio → report renders.

06 · Seven days

The order I would do it in

  1. Day 1

    Unblock the PIN

    One shared PIN format, hashed compare, four tests. This alone releases two roadmap items.

  2. Day 2

    Settle the access model

    Decide: Supabase Auth sessions, or server-side reads with the secret key. Write the decision into AGENTS.md.

  3. Day 3

    Prove the Report page

    With access settled, the blank report is almost certainly a policy returning zero rows. Verify with a signed-out and an employee session.

  4. Day 4

    Make analysis a job

    Status column, queue, poll. Long recordings stop failing silently.

  5. Day 5

    Cap the AI spend

    Token accounting per analysis, per-employee daily cap, backoff and a visible quota state.

  6. Day 6

    Trim the bundle

    Dynamic ffmpeg, split admin routes, measure before and after on a real Android device.

  7. Day 7

    Close the repo gaps

    README with env table, branch protection, prune the 39 branches to the live ones.

07 · Confirm these

Six checks that turn inference into fact

  • Are employee logins Supabase Auth users, or rows in your own table? Everything in finding 1 hinges on this.
  • Is the anon/publishable key able to SELECT telecaller_data directly from the browser today? Test it with curl and no session.
  • Is the call-audio bucket private with signed URLs, and how long do those URLs live?
  • Does any required secret appear with a VITE_ prefix? Anything VITE_ is compiled into the client bundle.
  • What does the AI score actually measure, and is the prompt versioned? Scores that move when a prompt changes are unfair to the telecaller.
  • Is there one staging environment, or is main deployed straight to the people using it?

Fix the PIN, settle who may read a lead, and this ships

Everything else on this page is tuning. Those two decisions are what stand between a working build and a product your telecallers can use on Monday.