Momants.ai Dashboard

A Next.js dashboard with Zustand, Tailwind CSS and shadcn/ui, secured with short-lived access tokens, refresh tokens and HttpOnly cookies.

Momants.ai Dashboard frontend project interface

Business value

  • Reduced token exposure

    HttpOnly cookies prevented client-side JavaScript from reading cookie-held tokens directly, reducing the risk of token theft through XSS compared with browser-accessible storage.

  • Secure session continuity

    Short-lived access tokens authorized protected requests, while refresh tokens renewed sessions without repeatedly asking users to sign in.

Overview

I used Next.js with Zustand, Tailwind CSS and shadcn/ui for the Momants.ai Dashboard, focusing on readable styling, maintainable components and efficient development. I also implemented an authentication flow using access and refresh tokens, with cookie-held tokens protected through HttpOnly cookies.

The problem

The dashboard needed an authentication approach that could authorize protected API requests and renew sessions without exposing sensitive tokens to client-side JavaScript.

My contribution

Next.js provided the React-based application framework, with Zustand for shared client-side state. I chose Tailwind CSS to keep styling visible alongside the component markup and make the implementation easier to read. Using shadcn/ui provided editable UI components that supported maintainability and development speed.

For authentication, I implemented short-lived access tokens for protected API requests and refresh tokens for session renewal. HttpOnly cookies prevented client-side JavaScript from reading cookie-held tokens directly, reducing token exposure through XSS compared with browser-accessible storage while preserving a smooth signed-in experience.

Tech stack

  • Next.js
  • React
  • Zustand
  • Tailwind CSS
  • shadcn/ui
  • Access tokens
  • Refresh tokens
  • HttpOnly cookies