CONFEI
THE "ARTISAN VS. ACCOUNTANT" DILEMMA
"Confectioners are artists, not mathematicians. They spend hours perfecting a cake decoration but lose money the moment they sell it because they can't calculate the 'hidden costs' (gas, packaging, slight ingredient price hikes)."
The status quo was chaotic: pricing based on "market guessing" or messy notebooks. They needed a system that acted less like a spreadsheet and more like a Partner Manager. The technical challenge wasn't just storing recipes; it was creating a reactive pricing engine that updates an entire product catalog when the price of a single raw ingredient (like condensed milk) changes.
MODERN MONOLITH & SERVER ACTIONS
[ Confectioner ]
|
v
[ Next.js App Router ] ----> [ Supabase Auth ]
|
v
[ React Query / SWR ]
|
v
[ Server Actions / API ] --> [ Pricing Engine ]
|
v
[ Supabase PostgreSQL ] --(RLS)--> [ Next.js App Router ]While I'm a .NET advocate for enterprise cores, for this SaaS MVP, the Next.js 14 + Supabase combo was the pragmatic choice. It allowed me to merge the Backend-for-Frontend (BFF) pattern directly into the application layer.
Type Safety: We use TypeScript strictly. No any types allowed.
Zero-DevOps: Supabase handles the Postgres scaling.
Organic Tech: Custom Design System using shadcn/ui.
CASCADE PRICING ALGORITHM
The core engineering challenge was the Dependency Chain Update. A single cake is composed of multiple sub-recipes (fillings, doughs, frostings), which are composed of raw ingredients.
User updates price of "Flour"
System traverses dependency graph (Ingredient -> Dough -> Cake)
Updates Profit Margin on pending orders & Alerts user
// Simplified logic for the recursive cost update
interface ICostUpdate {
ingredientId: string;
newPricePerUnit: number;
}
async function cascadeUpdate(update: ICostUpdate) {
// 1. Update the raw ingredient
const ingredient = await db.update('ingredients', update);
// 2. Find all parent recipes relying on this ingredient
const parents = await db.findParents(ingredient.id);
// 3. Re-calculate costs recursively
// We prioritize accuracy over raw speed here, ensuring
// the user never sells at a loss.
await Promise.all(parents.map(recalculateRecipeCost));
}ORGANIC TECH DESIGN SYSTEM
I've been on both sides: if the Dev doesn't understand UX, they optimize for the server, not the human. For Confei, the goal was to hide the complexity of the math behind an interface that feels "organic."
We developed the Organic Tech design language using colors like Berry Red and Mint Green to evoke appetite, contrasting with strict data visualization.
Achieved 3 recurring paid subscribers in just 3 months of operation, relying solely on organic reach.
Active Users - Over 200 monthly active users managing their production within 4 months of launch.