boot

DueClock

2 min read
Venkat Nithin
Next.jsTailwindCSSMongoDBNextAuthReact QueryZodPWA

Executive Summary

DueClock is a highly-scalable, multi-tenant B2B platform designed to solve the chaotic compliance tracking problem for Chartered Accountants. It centralizes client deadlines, communication, and team management into a unified, mobile-first Progressive Web App (PWA).

The Architecture

Recognizing that CAs are frequently on the move or working from client sites, I architected DueClock as a Progressive Web App (PWA). By leveraging the Next.js App Router, the application utilizes aggressive Server-Side Rendering (SSR) for immediate initial loads, while the PWA service workers cache critical assets to ensure the app feels as responsive and native as an iOS/Android application, even on spotty cellular networks.

Hard Engineering Problems Solved

1. Multi-Tenant Role-Based Access Control (RBAC)

A CA firm isn't a single user; it's a hierarchy. I designed a strict multi-tenant data model where users belong to specific "Firms" with inherited permissions.

  • Implemented Role-Based Access Control (Admin vs. Staff).
  • Secured API routes using middleware that intercepts the session JWT, verifying not just authentication, but ensuring the user has the explicit firmId and role required to mutate specific client records.

2. Frictionless Single Sign-On (SSO)

To eliminate onboarding friction for busy accountants, I bypassed traditional email/password flows entirely.

  • Integrated NextAuth.js for secure Google OAuth2 authentication.
  • Customized the OAuth callbacks to automatically provision new users in the MongoDB database and seamlessly map their Google identities to the internal Firm architecture.

3. Bulk Data Operations & Communications

Managing hundreds of tax clients manually is a bottleneck.

  • Engineered a robust CSV Import/Export engine that parses bulk client data, validates it against strict Zod schemas to prevent database corruption, and batches the inserts.
  • Integrated automated communication pipelines (Email and WhatsApp templates) allowing CAs to blast deadline reminders to multiple clients with a single click.

Code Quality

The entire application is written in strict TypeScript. By combining Zod on the backend for payload validation and React Query on the frontend for stale-while-revalidate data fetching, the app maintains complete type-safety across the network boundary while completely eliminating UI loading flickers.

Interested in working together?

I'm always open to discussing new projects and opportunities.