Performance Boost & Bug Fix-Next.js Dashboard
Budget / Salary$30–250
TypeFreelance project
LocationRemote
Posted2 hours ago
Bug fix + performance task in a Next.js 14 / TypeScript / Prisma / PostgreSQL
real-time dashboard app.
Context: the app polls a leaderboard endpoint every 2 seconds to show ranked
results from an Event table (user activity events with type, userId,
timestamp, and a numeric value field). Two issues:
1. Missing database indexes. The polled query filters on
(accountKey, lastActiveAt) and a separate query filters on
(accountKey, status, updatedAt) — neither has a covering index, so both
scans get slower as event history grows. Need hand-written Prisma
migration SQL adding the two composite indexes (not `prisma migrate dev`
autogenerate).
2. Leaderboard fallback silently fails as empty state. The ranking endpoint
has a primary data source and a fallback data source. When the primary
source has no data for a given session (common — different ingestion
paths populate different sources), it should fall back automatically.
Right now, if the fallback path throws ANY error, the UI shows the same
"no results yet" empty state as a genuinely empty result — there's no way
to tell "really empty" apart from "the fallback silently broke." Need:
proper error propagation from the fallback so the frontend can show a
distinct "couldn't load results" state instead of a false empty state,
plus server-side logging so failures are visible.
I'll share the specific relevant files (not the full repo) once we're talking
— a few isolated files, a schema excerpt, and a description of the exact
query patterns. Please apply only if you're comfortable working from
targeted file excerpts and a written data-model description rather than a
full running repo on day one.
Small, contained, fixed-price. Looking for someone precise and clean — this
may lead to more similar work if it goes well.
real-time dashboard app.
Context: the app polls a leaderboard endpoint every 2 seconds to show ranked
results from an Event table (user activity events with type, userId,
timestamp, and a numeric value field). Two issues:
1. Missing database indexes. The polled query filters on
(accountKey, lastActiveAt) and a separate query filters on
(accountKey, status, updatedAt) — neither has a covering index, so both
scans get slower as event history grows. Need hand-written Prisma
migration SQL adding the two composite indexes (not `prisma migrate dev`
autogenerate).
2. Leaderboard fallback silently fails as empty state. The ranking endpoint
has a primary data source and a fallback data source. When the primary
source has no data for a given session (common — different ingestion
paths populate different sources), it should fall back automatically.
Right now, if the fallback path throws ANY error, the UI shows the same
"no results yet" empty state as a genuinely empty result — there's no way
to tell "really empty" apart from "the fallback silently broke." Need:
proper error propagation from the fallback so the frontend can show a
distinct "couldn't load results" state instead of a false empty state,
plus server-side logging so failures are visible.
I'll share the specific relevant files (not the full repo) once we're talking
— a few isolated files, a schema excerpt, and a description of the exact
query patterns. Please apply only if you're comfortable working from
targeted file excerpts and a written data-model description rather than a
full running repo on day one.
Small, contained, fixed-price. Looking for someone precise and clean — this
may lead to more similar work if it goes well.
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.