ZDCRM Hub
Principal frontend engineer on a bespoke CRM replacing spreadsheet chaos for a multi-business group — enquiry-to-order conversion, granular RBAC, and one-click PDF/PNG exports.
- Role
- Principal Frontend Engineer
- Timeline
- Oct 2024 – Jan 2025
- Stack
- React · Next.js · TypeScript
- Status
- Shipped

Spreadsheets were killing a growing business.
Zuzu Group was running important operational workflows across disconnected spreadsheets, chats, and individual memory. That worked only until order volume and business complexity started increasing. Enquiries were hard to track, order histories were incomplete, and payment or delivery context could disappear between team handoffs.
The added challenge was that this was not one business with one clean workflow. It was a group with different brands, branches, and staff permissions. I needed to translate that operational mess into a UI system that respected the way the business already worked, while removing the hidden fragility that came from undocumented processes.
A business can't scale if its most important workflows live in someone's head and a spreadsheet.
The CRM succeeded because I modeled operations explicitly instead of flattening everything into generic CRUD forms. Domain boundaries, validation layers, and export flows each got their own architecture, which made the frontend feel trustworthy for staff doing real business work.
Enquiry vs Order as distinct domain objects
I kept enquiries and orders separate because they represent different business commitments. Treating them as one object with status flags would have made conversion history ambiguous and complicated reporting, while distinct types preserved the operational story from first contact to fulfillment.
const convertEnquiryToOrder = async (conversionData: EnquiryToOrderConversion) => {
const enquiry = await getEnquiryDetails(conversionData.enquiryId);
const orderData = {
...enquiry.customerDetails,
...enquiry.productRequirements,
...conversionData.confirmationDetails,
status: 'confirmed',
sourceEnquiryId: conversionData.enquiryId,
};
const order = await createOrder(orderData);
await updateEnquiry(conversionData.enquiryId, { status: 'converted', convertedOrderId: order.id });
};Conversion was modeled as an explicit business transition, not a hidden status mutation.
Layered Zod schemas with conditional validation
The CRM had business rules that changed with delivery type, deposit schedules, and product variation. I used layered schemas with nested refinements so those rules lived close to the data model instead of being duplicated across event handlers and form components.
const paymentScheduleSchema = z.object({
depositRequired: z.boolean(),
depositAmount: z.number().optional(),
}).refine((data) => !data.depositRequired || Boolean(data.depositAmount), {
message: 'Deposit amount is required when deposit is enabled',
path: ['depositAmount'],
});
const orderCreationSchema = z.object({
deliveryInfo: z.object({
type: z.enum(['pickup', 'delivery']),
deliveryAddress: z.string().optional(),
}).refine((data) => data.type !== 'delivery' || Boolean(data.deliveryAddress), {
message: 'Delivery address is required for delivery orders',
path: ['deliveryAddress'],
}),
paymentSchedule: paymentScheduleSchema,
});Business rules stayed centralized even as the order form branched across multiple real-world scenarios.
html2canvas + jsPDF for client-side export
A server-side PDF service would have added backend complexity for a feature users needed instantly inside operations workflows. Client-side export kept latency low, reduced implementation overhead, and let me control rendering carefully enough to avoid common CORS issues with images.
const exportOrderSummary = async (orderId: string, format: 'pdf' | 'png') => {
const order = await getOrderDetails(orderId);
const summaryElement = document.getElementById('order-summary-export');
if (!summaryElement) throw new Error('Export element not found');
const canvas = await html2canvas(summaryElement, {
scale: 2,
useCORS: true,
allowTaint: false,
backgroundColor: '#ffffff',
});
if (format === 'png') return canvas.toDataURL('image/png');
return new jsPDF().addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, 210, 297);
};Exports became a fast user-facing feature instead of a heavyweight backend subsystem.
Conditional form logic that mirrors complex business rules.
The order creation experience had to reflect reality, not developer convenience. Staff needed forms that adapted to deposit schedules, pickup versus delivery, product variations, proof-of-payment requirements, and branch-specific business rules — all without becoming unreadable or error-prone.
I solved that by treating the form as a structured system instead of a single component. Schema-driven validation, shared field groups, and predictable watch-based UI branching kept the experience understandable for users and maintainable for me, even as requirements expanded during client feedback loops.
70%
Processing Time Reduction
95%
Data Accuracy
Via strict form validation
100%
Order Traceability
Enquiry to delivery
ZDCRM reinforced how important business understanding is before writing code. The frontend succeeded because it respected existing workflows while removing the undocumented fragility underneath them. Being the only engineer on the frontend meant every tradeoff was visible — and ownership had to extend beyond UI into systems thinking.