Hero Quest

NextJS, React, Typescript, Postgres, Prisma, Bcrypt, Zod, Reract-Hook-Form, Tailwind, Shadcn/ui, Dotenv

A Full Stack Next.js application that turns your daily tasks into a fun thing — gamify your habits, complete quests, and track your progress over time across three life categories: Health, Work, and Social.

s

Important Functionalities

  • Session-Based Authentication — Secure session management with a Vercel cron job that automatically cleans up expired sessions from the database. Sessions are optimized with a B-tree index on the created_at field for fast lookups and efficient deletions.

  • Compact Activity Encoding — User activity (last 365 days) is stored as a string encoding rather than a separate database schema, keeping the data model lean and queries fast. All transformation operations run server-side using array parsing from the encoding string.

  • Server-Side Auth Caching — Authentication is checked on server components using a cached function (via React's cache()) that deduplicates user detail lookups within a single request lifecycle, avoiding redundant database calls.

  • Client-Side Validation — Forms are validated client-side using Zod schemas and React Hook Form, giving users immediate feedback before any server round-trip.

  • Data Access Layer (DAL) — Auth logic is encapsulated in a dedicated DAL instead of relying on Next.js middleware (the legacy proxy pattern), following modern Next.js best practices for secure and composable data access.

Back to all projects