← Back to experiments
Experiment22 August 2026

Franchisee Helpdesk

A multi-role helpdesk POC for franchise networks — ticket management, role-based dashboards, email notifications, and EC2 deployment with OpenTofu.

Next.jsExpressSQLiteAWS EC2OpenTofuResendZod

Franchisee view

Dashboard with ticket list and status counts

Deployed on EC2
Franchisee dashboard showing open and in-progress ticket counts with a ticket list.

Admin view

All tickets with status and assignee filters

Admin ticket view showing all franchisee tickets with status filters and assignee columns.

Why this exists

Replacing email-based franchise support with a central ticketing system

In a growing franchise network, support requests sent by email get lost in threads, lack visibility, and scale poorly. This POC centralises communication into a shared helpdesk where franchisees submit and track tickets, and support staff assign, update, and close them.

The app runs a separate Express API behind the Next.js frontend, with SQLite on disk — deliberately simple infrastructure for a small network that can grow later.

What it demonstrates

Role-based accessTicket lifecycleEmail notificationsSession authStatus filteringTicket assignmentEC2 + nginx deploymentOpenTofu IaC

1. Franchisees log in, submit tickets, and track their status.

2. Support staff see all tickets across franchisees with filters.

3. Tickets move through Open, In Progress, and Closed states.

4. Email notifications fire on ticket creation and status changes.

Architecture

Internet → nginx (:80/443) → Next.js (:3000)
Next.js → /api/proxy/* → Express API (:3001)
Express → better-sqlite3 → helpdesk.db
Express → Resend API → email notifications

Infrastructure

ComputeEC2 t3.small with pm2
DatabaseSQLite on EBS volume
Proxynginx with certbot TLS
IaCOpenTofu (Terraform-compatible)
SecretsAWS SSM Parameter Store
Cost~$18/month running

What I learned

Splitting the API into a standalone Express server behind the Next.js proxy made the backend independently testable and easier to reason about than mixing Server Actions with a shared SQLite connection.

OpenTofu with a user-data bootstrap script made the EC2 deployment reproducible. SSM Parameter Store for secrets kept credentials out of git and the Terraform state file, which is worth the extra setup even for a POC.

The multi-role model — franchisees see only their own tickets, staff see everything — surfaced early design decisions around session management and middleware that would have been easy to defer and harder to retrofit.