Delivery snapshot
Record date: November 15, 2025. Technology and screenshots describe the delivered version documented on this date. Any performance observations belong to the same point-in-time record. The linked live site may include later changes made by the client or other providers.Overview
Smart Scan is an enterprise-grade scan session logging companion designed to complement existing inventory management systems. Unlike traditional inventory platforms, Smart Scan focuses exclusively on documenting UPC scanning activities, both incoming and outgoing, providing clean, exportable session records that integrate seamlessly with your current ERP, WMS, or spreadsheet workflows.
Built with a modern tech stack including Next.js 15, TypeScript, and PostgreSQL, the platform features full multi-tenancy support, allowing multiple organizations to operate independently with isolated data and customized access controls. The system emphasizes transparency, making no false promises about stock tracking, instead, it excels at what it does: capturing, organizing, and exporting scan session data with professional PDF reports and shipping labels.
Key Features
Multi-Tenant Architecture
Complete tenant isolation with independent databases, user management, and session tracking. System administrators can manage multiple organizations from a centralized dashboard with real-time metrics including user counts, session volumes, and scanned item totals per tenant.
Advanced Authentication & Session Management
Built on NextAuth.js with JWT strategy, featuring automatic session revocation when users or tenants are deactivated. System enforces single-session-per-user policy for regular users while allowing system administrators concurrent access across multiple devices.
Incoming & Outgoing Session Tracking
Dual workflow support for receiving and shipping operations. Incoming sessions capture inbound UPC scans with real-time quantity tracking, while outgoing sessions organize shipments by box number with detailed item breakdowns. Both workflows generate export-ready logs and professional PDF reports.
Professional PDF Generation
Custom PDF report generation using jsPDF with autotable support. Features include session summaries, box labels (standard and 4x6 shipping format), and branded footers with www.smrtscan.com attribution for discoverability.
Granular Role-Based Access Control
Three-tier permission system (USER, MANAGER, ADMIN) plus system administrator role. Permissions cascade appropriately with managers/admins accessing sensitive operations, user management panels, and tenant configuration tools.
UPC Catalog Management
Tenant-scoped UPC database with model, storage capacity, and color attributes. Supports bulk imports via CSV/JSON with validation, duplicate detection, and comprehensive search/filter capabilities.
Real-Time Dashboard & Metrics
Live session statistics, recent activity tracking, and filtering by status/date ranges. System administrators receive aggregated metrics across all tenants including total users, sessions, and scanned items.
Dark Mode & Responsive Design
Full dark mode support via next-themes with seamless light/dark transitions. Mobile-responsive interface optimized for tablets and handheld scanners used in warehouse environments.
Technologies Used
Frontend Stack
- Next.js 15.3.4 – App Router with React Server Components for optimal performance
- React 19 – Latest React with concurrent features and improved hydration
- TypeScript 5 – Full type safety across client and server boundaries
- Tailwind CSS 3.4.17 – Utility-first styling with custom design system
- next-themes 0.4.6 – Seamless dark/light mode implementation
- Lucide React – Modern icon library for consistent UI elements
Backend & Database
- Next.js API Routes – Type-safe server endpoints with proper error handling
- PostgreSQL – Production-grade relational database with ACID compliance
- Prisma ORM 6.10.1 – Type-safe database client with migration management
- NextAuth.js 4.24.11 – JWT-based authentication with custom session handling
Security & Authentication
- bcryptjs – Password hashing with salt rounds for secure credential storage
- JWT Strategy – Stateless authentication with automatic token refresh
- Session Revocation – Real-time session invalidation for deactivated users/tenants
- RBAC Implementation – Row-level security with tenant-scoped data access
Document Generation
- jsPDF 3.0.1 – Client-side PDF generation with custom layouts
- jspdf-autotable 5.0.2 – Table formatting for session reports
Additional Tools
- SWR 2.3.6 – React hooks for data fetching with caching
- nodemailer 6.10.1 – Email notifications for system alerts
Architecture Highlights
Multi-Tenant Data Isolation
Complete database-level separation with tenant-scoped queries enforced via Prisma middleware. All UPC catalogs, sessions, and users are strictly isolated, with system administrators having read-only access to tenant metrics without viewing sensitive session data.
Session Security Model
Three-layer security approach: JWT token validation, session revocation checks, and tenant context verification. When a tenant or user is deactivated, all active sessions are immediately revoked with descriptive logout messages explaining the reason.
Single-Session Enforcement
Regular users maintain one active session at a time, new logins automatically revoke previous sessions with "accessed from another device" notifications. System administrators bypass this restriction to manage multiple tenants simultaneously.
PDF Branding Strategy
All generated PDFs include subtle footer branding (www.smrtscan.com) for discoverability while maintaining professional appearance. Supports standard letter-size reports and 4x6 thermal shipping labels with consistent formatting.
Type-Safe API Design
End-to-end TypeScript coverage with Prisma-generated types flowing from database schema through API routes to frontend components. Custom error handling ensures consistent responses across all endpoints.
Challenges and Solutions
Multi-Tenant Complexity
Challenge: Ensuring complete data isolation while maintaining efficient query performance across tenants.
Solution: Implemented Prisma-level tenant scoping with composite unique constraints (tenantId + identifier) and database indexes optimized for tenant-filtered queries. Added middleware to automatically inject tenant context into all database operations.
Session Revocation Architecture
Challenge: Real-time session invalidation when users/tenants are deactivated without polling overhead.
Solution: Built custom session management layer on top of NextAuth with database-backed session tracking. JWT callbacks check revocation status on every request, with distinct logout messages for different deactivation reasons (user inactive, tenant inactive, concurrent login).
PDF Generation Performance
Challenge: Generating multi-page PDFs with tables and custom layouts without blocking the UI thread.
Solution: Implemented client-side PDF generation with jsPDF, allowing asynchronous processing with progress indicators. Optimized table rendering for sessions with 1000+ scanned items using chunked processing.
Type Safety Across Boundaries
Challenge: Maintaining type consistency from database schema through API routes to React components.
Solution: Leveraged Prisma's generated types with custom TypeScript interfaces for API responses. Created shared type definitions for NextAuth session extensions, ensuring compile-time safety for role checks and tenant context.
Tenant Metrics Aggregation
Challenge: Providing system administrators real-time metrics across all tenants without performance degradation.
Solution: Used Promise.all() to parallelize metric queries per tenant (user counts, session totals, item aggregates) with Prisma's efficient aggregation functions. Implemented caching layer for dashboard metrics with 5-minute refresh intervals.
Technical Highlights
Advanced Authentication Flow
- JWT-based authentication with automatic token refresh on every request
- Session revocation checks integrated into JWT callbacks for real-time enforcement
- Custom session storage layer tracking device info and revocation reasons
- Forced logout with contextual messages (tenant deactivated, user deactivated, concurrent login)
Database Design Excellence
- Composite unique constraints ensuring tenant-scoped uniqueness (e.g., tenantId + upcCode)
- Optimized indexes for frequently filtered queries (tenant scoping, session status, date ranges)
- Prisma migrations with zero-downtime deployment strategy
- Cascade deletion rules maintaining referential integrity across tenant removal
Role-Based UI Rendering
- Conditional component rendering based on role/permissions at compile time
- System administrators see tenant management panel with aggregated metrics
- Regular users access tenant-scoped workflows (scanning, session management, UPC catalog)
- Managers/admins unlock user management with tenant-aware operations
PDF Export System
- Custom layout engine for session reports with grouped item tables
- 4x6 thermal label format for box labels with QR code support potential
- Page numbering, timestamps, and subtle footer branding on all exports
- Progress indicators for large PDF generation (1000+ items)
Real-Time Updates
- SWR-powered data fetching with optimistic UI updates
- Automatic revalidation on focus/reconnection for session lists
- Live session statistics updating during scan operations
- Debounced search/filter inputs preventing excessive API calls
Impact & Results
Smart Scan has transformed warehouse scanning workflows for multiple organizations through its focused, transparent approach to session logging. By positioning itself as a companion tool rather than a replacement inventory system, it fills a critical gap in existing warehouse tech stacks.
Key Achievements
Multi-Tenant Scale
Successfully supporting multiple organizations with complete data isolation, automated session revocation, and centralized system administration. Each tenant operates independently with custom user roles and UPC catalogs.
Session Integrity
Zero data loss with enforced single-session policy for regular users. Session revocation happens instantly when users/tenants are deactivated, with descriptive logout messages guiding users to administrators.
Export Excellence
Professional PDF generation for all session types with consistent branding. 4x6 labels integrate seamlessly with existing shipping workflows, while full session reports provide audit-ready documentation.
Type Safety & Reliability
End-to-end TypeScript coverage catches bugs at compile time. Prisma-generated types ensure database schema changes propagate safely through all application layers.
Developer Experience
Clean separation of concerns with API routes handling business logic, React Server Components optimizing initial loads, and client components managing interactivity. Hot reload during development with instant feedback loops.
Technical Maturity
This project showcases advanced full-stack development patterns including multi-tenancy, session management, role-based access control, and secure authentication flows. The architecture balances complexity with maintainability, using modern frameworks (Next.js 15, React 19, Prisma) to deliver enterprise features with startup-level velocity.
The emphasis on transparency, making no false promises about inventory tracking, demonstrates product maturity and understanding of real warehouse needs. Smart Scan does one thing exceptionally well: documenting scan sessions with exportable, professional reports.
