PLEN

Off-Work: Multi-Tenant Leave Management System

Off-Work is a multi-tenant SaaS platform that lets companies register as their own organisation and manage their employees' holidays and leave requests. Every tenant works in complete isolation, with its own employees, departments, leave policies, closure days and approval workflows. Employees submit requests and check their balances in seconds, while managers and HR review requests and plan around shared, real-time calendars.

Next.jsTypeScriptMantine UIMongoDBBetter AuthResendRecharts

Solution: A Self-Service SaaS for HR Teams

Instead of spreadsheets and e-mail threads, Off-Work centralises the entire leave process in one place. It is built as a modern Next.js 16 application using the App Router, TypeScript and the Mantine component library, and secured end-to-end by Better Auth's organization and admin plugins. A two-layer security model — an edge middleware cookie check reinforced by full server-side session verification — keeps every tenant's data isolated, while transactional e-mails are delivered through Resend and React Email. MongoDB with Mongoose stores the data model (employees, departments, leave requests and closure days), and Mantine charts plus Recharts power the analytics.

Employee Area (/me)

Manager & HR Area (/team)

Architecture & Solutions:

  • Multi-Tenant Architecture: Tenancy is handled through Better Auth's organization plugin as the single source of truth, and every Employee profile is scoped to an organizationId — guaranteeing complete data isolation between companies.
  • Two-Layer Security Model: An edge middleware performs a fast cookie-presence check, while auth.api.getSession() verifies the full cryptographic session and role server-side inside the layout files.
  • Route Groups & Roles: A clean split between the (marketing), (auth), (app)/me and (app)/team route groups maps directly onto the Employee, Manager and HR roles, enforced consistently on the server.
  • Typed Data Layer: Mongoose models (Employee, Department, LeaveRequest, ClosureDay) together with shared TypeScript types keep the whole data layer type-safe and predictable.
  • Transactional Email: Password reset, e-mail verification and other notifications are built with React Email and delivered through Resend.
  • Working-Day Engine: Utilities that combine bank holidays and company closures to count working days correctly across every request and calendar view.
  • Responsive, Accessible UI: Mantine UI components, dark/light colour schemes and fully responsive calendar and table views for phones, tablets and desktops.

Business Value:

Companies using Off-Work benefit from:

  • ✓Less admin overhead: Automated balances, working-day counting and approvals remove hours of manual HR work every month.
  • ✓Full visibility: Real-time calendars and a team dashboard surface availability and pending requests before they become a staffing problem.
  • ✓Multi-tenant by design: Every company is an isolated organisation with its own employees, departments, policies and data — a single deployment serves many customers.
  • ✓Audit-ready reporting: Charts and tables on leave usage, sick days, tenure and turnover give HR and finance the numbers they need, when they need them.
  • ✓Secure & extensible: Role-based access, transactional e-mail and a typed, component-based codebase make the platform safe to run and easy to grow.