Leaf Creme
A bakery commerce and operations system built around perishable inventory, FEFO allocation, order fulfillment, and payment-state consistency.
Problem
A small bakery cannot manage short-shelf-life stock reliably with a storefront plus disconnected spreadsheets. Orders, expiry dates, inventory batches, and payments need to agree on the same operational state.
Users
Bakery customers, staff, and administrators managing online, POS, and pre-order workflows.
My role
Business rules, data model, API integration, and product workflows
System path
The system is described as a sequence of responsibilities, not a list of frameworks.
01
Customer + admin UI
React workflows for commerce and bakery operations
02
FastAPI boundary
JWT, validation, role-aware routes, and service orchestration
03
Business services
FEFO allocation, order totals, and payment transitions
04
PostgreSQL
Products, variants, batches, orders, users, and payments
05
Integrations
MoMo payment paths and an n8n-backed assistant proxy
Outcomes
- Models finished products, components, and gift boxes as traceable inventory batches with expiry dates.
- Allocates stock by earliest expiry first when an order is created instead of decrementing an aggregate quantity.
- Supports POS, online, and pre-order flows plus manual, MoMo API, and MoMo QR payment paths.
- Separates backend-backed features from demo-only admin surfaces so the portfolio does not overstate completeness.
Technology
Decisions and trade-offs
Model batches, not just stock counts
Expiry-aware batches preserve traceability and make FEFO allocation possible for perishable products.
Keep order and payment state coordinated
Payment completion can advance an order only when recorded payments reach the order total.
Expose incomplete areas honestly
Voucher, category, and some analytics surfaces are explicitly bounded instead of presented as production-ready features.
Current boundaries
- Some admin analytics still need dedicated backend reporting endpoints.
- Voucher and category management remain demo-limited until complete CRUD APIs exist.
- The frontend production build still needs TypeScript cleanup in unrelated admin surfaces.
What I learned
The hard part of full-stack work is not connecting a form to an endpoint. It is keeping the business rule, database transaction, API contract, and interface state consistent when one operation changes several parts of the system.