Case Study - Order Processing System with Stage-Based Workflow
A comprehensive order management dashboard that replaced an unreliable email-based workflow with a structured, stage-based processing system featuring in-app notifications and complete audit trails.
- Client
- Stalwart US
- Year
- Service
- Full-Stack Development, System Architecture, Database Design

Overview
Stalwart US processes orders for clients and needed to replace their email-based workflow that was causing significant operational problems.
I built a comprehensive order processing dashboard that handles everything from order creation to final delivery, with clear stage progression, vendor assignments, in-app notifications, and detailed cost tracking.
The Challenge
Email-Based Processing Was Failing
The company relied on Gmail for all order management, which created critical issues:
Email Blocks High volume of emails triggered Gmail's spam filters and sending limits. Orders were being missed or delayed because emails weren't being delivered.
Manual Communication Staff had to manually message processors, abstractors, and clients for each order stage. This was time-consuming and error-prone.
No Visibility Tracking order status required searching through email threads. There was no central place to see what was being worked on.
Assignment Confusion No clear system for who was working on what, leading to duplicate work or dropped orders.
No Audit Trail Difficult to track when tasks were assigned, accepted, or completed. No way to measure vendor performance.
The Solution
Stage-Based Order Processing
I designed a system that mirrors the actual title search workflow with six clearly defined stages:
- Searching - Initial document search
- Ground Searching - Verification at ground level
- Screening - Document screening and review
- Abstracting - Abstract creation
- Examining - Final quality check
- Submitted - Delivery to client
Each stage can be assigned to different vendors based on their specialization and current workload. Admins can bypass stages when needed for flexibility.
In-App Notifications
When an admin assigns an order:
- Notification is created in the system
- Task appears in vendor's dashboard with "Pending Accept" status
- Clear visibility of new assignments without email dependency
- No more missed orders due to email issues
Comprehensive Cost Tracking
Every processing stage tracks:
- Search costs
- Copy costs
- Additional fees
- Per-stage processing fees
- Payment status (paid/unpaid)
This replaced spreadsheet-based tracking and gave accurate visibility into order profitability.
Technical Implementation
Technology Stack
Core Framework:
- Next.js 13 with TypeScript
- Pages Router with API routes
Backend:
- tRPC for type-safe APIs
- Prisma ORM with PostgreSQL
- NextAuth for authentication with JWT sessions
File Storage:
- AWS S3 with presigned URLs for secure uploads/downloads
UI:
- Ant Design component library
- TailwindCSS for custom styling
- TanStack Table for data grids
- React Hook Form with Zod validation
- React Quill for rich text notes
Role-Based Access Control
Four user roles with specific permissions:
Admin
- Full system access
- Create and assign orders
- Reassign tasks between vendors
- View all orders and reports
- Manage users and clients
Vendor
- View assigned tasks only
- Accept or reject assignments
- Process orders (add costs, upload files, add notes)
- Mark tasks complete
Client
- View their orders
- Track order progress
Abstractor
- Specialized abstracting role
Order Workflow Implementation
Orders have nine statuses for clear tracking:
- New - Just created
- Designate - Ready for assignment
- WIP - Work in progress
- Completed - Finished
- Vendor Rejected - Vendor declined task
- Clarification - Needs more info
- Partially Completed - Partial work done
- Priority - Flagged as urgent
- Cancelled - Order cancelled
Processing Transactions
Each stage assignment creates a processing_transaction record that tracks:
- Assigned vendor
- Reassigned vendor (if changed)
- Start and end times
- Acceptance time
- Task status
- Costs incurred
- Files uploaded
- Payment status
This provides complete audit trail for every order.
Vendor Task Processing
Vendors have a dedicated processing form with:
- Search cost and copy cost inputs
- Automatic total calculation
- Order status selection
- Recorder and judgment links
- Number of pages
- Rich text search notes
- Drag-and-drop file upload to S3
- Success/failure feedback
Order Types Supported
The system handles 20+ title search types:
- Current owner, full searching, two owner
- Mortgage and assignment
- Judgment, deed, taxes
- Municipal lien searches
- Document retrieval
- Commercial variants
- Year-based searches (20, 30, 40, 60 years)
Plus priority levels (regular, rush, super rush) and turnaround times.
Key Features Delivered
Admin Dashboard
- Order creation with full property details
- One-click assignment to vendors
- Reassignment with reason tracking
- Order status overview
- Processing stage visibility
- Cost and payment tracking
Vendor Dashboard
- Assigned tasks list
- Task acceptance/rejection
- Order processing form
- File upload interface
- Search notes editor
Notification System
- In-app notifications stored in database
- Notifications for new assignments
- Notifications for reassignments
- Linked to processing transactions
File Management
- AWS S3 integration
- Presigned URLs for security
- Files linked to orders and transactions
- Organized by order ID
Data Management
- Geographic hierarchy (State > County > City)
- Client management with multiple contacts
- Vendor profiles with bank details
- Performance metrics (rating, accuracy, efficiency)
What We Did
- Next.js Development
- tRPC API Design
- PostgreSQL Database
- AWS S3 Integration
- Role-Based Access Control
- Workflow Engine
- Cost Tracking System
- Processing Stages
- 6
- Order Types Supported
- 20+
- User Roles
- 4
Results
Before vs. After
| Aspect | Email-Based | New System |
|---|---|---|
| Order Assignment | Manual email | One-click with notification |
| Status Tracking | Search emails | Dashboard view |
| File Sharing | Email attachments | Centralized S3 storage |
| Communication | Individual emails | In-system notes |
| Audit Trail | None | Complete history |
| Cost Tracking | Spreadsheets | Automated per-stage |
Business Impact
- Eliminated email blocks - Orders never lost due to Gmail limits
- Reduced manual messaging - Automated notifications replace email chains
- Clear accountability - Every assignment and action logged
- Faster processing - Vendors see tasks immediately
- Better cost tracking - Automated totals per order and stage
- Performance visibility - Vendor metrics for informed assignments
Ongoing Improvements
The system continues to evolve based on operational feedback and lessons learned during development.
Areas for Improvement
Real-Time Notifications Currently notifications are stored in the database but vendors must refresh to see them. WebSocket integration would push notifications instantly when orders are assigned, improving response time.
Order Processing Flow The order processing logic handles stage transitions but could be more robust. Better validation for edge cases, clearer error messages, and more atomic transactions would improve reliability.
Authentication & User Management The current auth uses a custom email provider with bcrypt password hashing. Improvements could include:
- Password reset functionality
- Email verification
- Better session management
- More granular permissions beyond the four roles
Address/Location Handling The city/county/state hierarchy creation logic is complex and has duplicate code between createOrder and updateOrder. This could be refactored into a shared utility function.
Cost Tracking Updates When vendors process orders, the cost fields (search_cost, copy_cost) are tracked on processing_transactions but not automatically rolled up to the order's costing table.
Planned Enhancements
- Client Portal - Direct order submission by clients
- Reporting Dashboard - Analytics on turnaround time and costs
- Bulk Import - CSV upload for multiple orders
- SLA Tracking - Alerts for orders approaching deadline
- WebSocket Notifications - Real-time push notifications for assignments
Conclusion
The Stalwart US Order Processing System replaced an unreliable email workflow with a structured, traceable, and efficient platform. Orders flow through defined stages with clear ownership, in-app notifications keep vendors informed without email dependency, and comprehensive tracking provides full visibility into operations.
The system continues to evolve based on operational feedback, with each iteration addressing edge cases discovered during daily use.
Project Type: Full-Stack Order Management System Duration: 4 months initial development + ongoing improvements Technologies: Next.js, TypeScript, tRPC, Prisma, PostgreSQL, AWS S3 Users: Admin staff, Vendors (internal & external), Clients