Generated: July 2025
Repository:tavola-romagna/
Iteration: 4 (building on ANALYSIS.md → ANALYSIS-ITER2.md → ANALYSIS-ITER3.md)
Status: Feature-rich marketplace — 46 commits, 53 Prisma models, 75 API routes, 44 pages, ~110K LOC
The project evolved from "feature-rich marketplace" to a comprehensive regional food commerce ecosystem with AI capabilities, producer intelligence, community infrastructure, and multi-language tourism commerce. All 10 features proposed in the Iter3 analysis have been implemented, bringing the total to 46 committed features across 3 implementation rounds:
| # | Feature (Iter3 Proposal) | Iter3 Status | Current Status |
|---|---|---|---|
| 1 | AI Recipe Engine & Basket Builder | ❌ No recipes | ✅ LLM-powered recipe generation, weekly auto-menus, "Cosa cucino stasera?" basket builder wizard, ingredient-to-product mapping, recipe rating + approval pipeline |
| 2 | Producer Analytics & Revenue Intelligence | ❌ Basic order lists | ✅ ProducerDailySales + ProductCategoryBenchmark models, demand forecasting (moving averages), price alerts ("il tuo miele è sotto la media"), analytics dashboard with date-range filtering |
| 3 | Progressive Web App (PWA) & Offline Mode | ❌ Server-only | ✅ Service worker with cache-first strategy, manifest.json with emerald theme, IndexedDB offline cart + order queue, background sync, install prompt after 3rd visit, offline banner |
| 4 | Automated Testing & CI/CD | ❌ Zero tests | ✅ Vitest config, 4 test files (analytics, recipe-engine, stripe, validation), GitHub Actions CI (lint → prisma generate → test → build) |
| 5 | Producer Cooperative Network | ❌ Not built | ✅ Cooperative + CooperativeMembership models, cooperative storefront pages, member management, federation product discovery API (/api/federation/products) |
| 6 | Dynamic Pricing & Yield Management | ❌ Static prices | ✅ PricingRule model with 5 rule types (expiry markdown, bulk discount, surge, time-of-day, delivery slot), pricing evaluation engine, admin pricing panel, auto-expiry scanning |
| 7 | Blockchain Traceability | ❌ Not built | ✅ SHA-256 hashing of SupplyChainEvent chain, CertificationRecord model (Bio/DOP/IGP/DeCo), mock Polygon anchoring, QR code component, "Viaggio del Prodotto" page with timeline |
| 8 | Subscription Personalization | ❌ Fixed boxes | ✅ UserDietaryProfile model (restrictions, allergies, budget, family size), BoxComposition with satisfaction scoring, BoxExperiment A/B testing framework, dietary profile form, preview + swap UI |
| 9 | Community: Events, Forum, Adoption | ❌ Not built | ✅ Event + EventBooking (4 event types), ForumPost + ForumComment with likes, AdoptionProgram + Adoption (olive tree, grapevine, beehive), community hub pages, booking forms, post composer |
| 10 | Multi-Language & Tourism Commerce | ❌ Italian only | ✅ Custom i18n with 4 locales (IT/EN/DE/FR), message dictionaries, language switcher, TourismItinerary model, HospitalityPartner with commission, ShipHomeOrder for international delivery |
| Metric | Iter 1 | Iter 2 | Iter 3 | Iter 4 (Current) | Δ (Iter3→4) |
|---|---|---|---|---|---|
| Git commits | 1 | 18 | 32 | 46 | +14 |
| TypeScript/TSX files | 21 | ~55 | 124 | 236 | +112 |
| Pages/Routes | 8 pages, 2 APIs | 22 pages, 17 APIs | 26 pages, 37 APIs | 44 pages, 75 API routes | +18 pages, +38 APIs |
| Prisma models | 0 active | 16 | 31 | 53 | +22 |
| Components | 8 | 8 shared | 8 shared | 23 components | +15 |
| Test files | 0 | 0 | 0 | 4 unit test files | +4 |
| Total LOC (src/) | ~2,300 | ~8,000 est. | ~64,500 | ~110,400 | ~+46K |
| Prisma schema lines | ~200 | ~350 | ~520 | 845 | +325 |
| i18n languages | 1 (IT) | 1 (IT) | 1 (IT) | 4 (IT/EN/DE/FR) | +3 |
| Layer | Iter 3 | Iter 4 (Current) |
|---|---|---|
| Data Layer | Prisma + SQLite (31 models) | Prisma 7.8 + SQLite (53 models) — full domain coverage including community, AI, analytics |
| Auth | Sessions + rate limiting + CSRF | Same foundation — no OAuth or MFA added |
| Payments | Mock Stripe + coupons + loyalty + splits | Same mock — still zero real payment processing |
| AI/ML | None | Recipe engine with LLM integration (mock), demand forecasting (moving averages), box personalization |
| Notifications | Multi-channel: in-app + SSE + email + WhatsApp | + Web Push API (mock), push subscription management |
| Traceability | None | SHA-256 event hashing, mock blockchain anchoring (Polygon), QR code generation |
| Community | None | Forum (posts/comments/likes), events (4 types + booking), adopt-a-tree programs |
| Analytics | Basic admin stats | Producer-level analytics: daily sales aggregation, category benchmarks, price alerts, demand forecasting |
| i18n | Italian hardcoded | 4-locale system (IT/EN/DE/FR) with message dictionaries, language detection, switcher component |
| Pricing | Static producer-set prices | Dynamic pricing engine with 5 rule types, admin configuration, automated expiry markdowns |
| Offline | None | PWA with service worker, IndexedDB cart/order queue, background sync |
| Testing | None | Vitest + 4 test files + GitHub Actions CI pipeline |
| Tourism | None | Itinerary builder, hospitality partnerships, ship-home international orders |
- AI-assisted commerce —
RecipeDraftpipeline: LLM generation → ingredient-to-catalog matching → approval queue → recipe cards with add-all-to-cart — transforms passive catalog browsing into active meal planning - Blockchain-anchored provenance —
stableStringify()→ SHA-256 hash → Merkle chain per product — deterministic hashing ensures supply chain event immutability (currently mock-anchored to Polygon) - Cooperative federation —
Cooperative→CooperativeMembershipwith revenue shares +/api/federation/productsendpoint for cross-instance discovery — designed for multi-region Tavola network - Dynamic pricing rules engine —
PricingRulemodel with JSON conditions/actions →evaluatePrice()function chains rules by priority → applies cumulative discounts/surcharges based on context (expiry, quantity, time, demand) - Subscription personalization pipeline —
UserDietaryProfile→BoxCompositionalgorithm (preferences → seasonality → surplus → producer balance → allergen exclusion) →BoxExperimentA/B framework with satisfaction tracking - Custom i18n layer — Lightweight
t(key, locale, params)function with per-locale message dictionaries — avoidsnext-intldependency while supporting 4 languages with parameterized interpolation - IndexedDB offline queue —
OfflineCartItem+OfflineOrderEntrypersisted in IndexedDB → background sync viaSyncManagerAPI → automatic reconciliation on reconnect
All Iter3 proposed features have been implemented. The remaining gaps are now operationalization and depth rather than breadth:
- Still 100% mock integrations — Stripe, Resend, Cloudinary/S3, Twilio (WhatsApp), OpenAI, blockchain (Polygon) — zero real transactions possible
- Minimal test coverage — 4 test files covering ~5% of the 75-endpoint API surface; no E2E tests, no Playwright
- No deployment — no production URL, no Vercel/hosting configuration, no environment management
- SQLite at 53 models — concurrent write limitations, no FTS5, JSON stored as strings (no typed JSON), no migrations strategy for production
- In-memory state everywhere — rate limiter, audit log, SSE connections all in-memory; lost on server restart
- No GDPR/privacy compliance — no consent management, no data export/deletion, no cookie banner
- No real-time data pipeline — analytics aggregation is on-demand (no cron jobs, no background workers, no message queue)
- Seed data still thin — original 6 producers, 15 products; insufficient for demonstrating AI recipes, cooperative dynamics, or marketplace discovery
- No observability — no structured logging, no APM, no error tracking (Sentry), no performance monitoring
- No OAuth/social login — custom session-only auth with no Google/Apple/Facebook login, no MFA
- Cart state fragmentation — client-side demo cart coexists with server-side
CartItemmodel - Blockchain is purely mock — SHA-256 hashing exists but no actual on-chain anchoring; no wallet integration
Previous barriers resolved: No AI/ML ✅, No testing ✅ (partial), No mobile/PWA ✅, No i18n ✅, No community features ✅, Static pricing ✅
Remaining barriers (operationalization-focused):
- Zero real money flow — the platform cannot process €1 in real revenue; this blocks all user validation
- No production deployment — no URL to share; requires
npm run devlocally to demo - Data poverty — 15 products cannot demonstrate AI recipe generation, dynamic pricing, or meaningful analytics
- Mock AI — recipe engine references LLM but uses static/template generation; no real OpenAI integration
- Legal gaps — no terms of service, no privacy policy, no GDPR compliance, no food safety disclaimers
- No real producer onboarding — no self-service producer signup flow, no KYC, no document upload
With 53 models and 75 API endpoints spanning commerce, community, AI, analytics, and tourism, the feature set is beyond any single Italian regional food platform:
| vs. Competitor | Iter 3 Gap | Iter 4 Gap | Tavola Advantage |
|---|---|---|---|
| Cortilia | Small (operations) | Ahead on features | AI recipes, blockchain traceability, cooperative network, community forum — Cortilia has none |
| Too Good To Go | Ahead (features) | Far ahead | Full marketplace with subscriptions, gift boxes, tourism, AI recipes; TGTG is surplus-only |
| Alvearechedicibo.it | Small | Ahead | Dynamic pricing, subscription personalization, multi-language, producer analytics |
| Local farm e-commerce (Shopify) | Ahead | Far ahead | Community features, cooperative federation, traceability — no Shopify farm store offers this |
| Amazon Fresh Italy | Medium | Small-Medium | Producer storytelling, food provenance, cooperative economics, community — but Amazon has real infrastructure |
| Segment | TAM | SAM | Tavola Addressable |
|---|---|---|---|
| Italian local food direct-to-consumer | €4.2B/yr | €850M (Emilia-Romagna) | €50-80M (Forlì + Romagna coast) |
| Food tourism (Romagna, 7M tourists/yr) | €1.1B/yr | €200M (food experiences) | €10-20M (ship-home + gift boxes) |
| Subscription food boxes (Italy) | €180M/yr | €35M (regional/artisan) | €5-10M (personalized Romagna boxes) |
| Producer SaaS (analytics, tools) | €120M/yr | €25M (Italian co-ops/small farms) | €2-5M (cooperative network fees) |
Total addressable for Tavola Romagna: €67-115M/yr — up from previous estimates due to tourism commerce and producer tools.
These 10 features target operationalization, real-world integration, and advanced intelligence — the platform has exceptional breadth, and now needs depth, real connections, and production readiness.
| # | Feature Name | Description | Why Implement | Complexity | Impact |
|---|---|---|---|---|---|
| 1 | Production Deployment & Real Integration Pipeline | Deploy to Vercel/Railway with PostgreSQL (Neon/Supabase), wire real Stripe Connect keys, real Resend emails, real Cloudinary uploads. Environment management (dev/staging/prod). Database migration strategy. Health checks and uptime monitoring. | Nothing else matters until real euros flow. 46 features and 110K LOC have zero value if no user can access the platform. This is the #1 existential blocker. Every competitor — even a farmer's WhatsApp group — can process real payments today. | Medium | 10 |
| 2 | Comprehensive Seed & Demo Data Engine | Seed script generating 30+ producers, 200+ products across all categories, 500+ orders with realistic temporal distribution, 50+ reviews, 10+ recipes, 3 cooperatives, 20+ events, pricing rules, traceability events. Faker.js-based with configurable density. Demo mode toggle for investor/partner presentations. | 15 products and 6 producers make the platform look empty. AI recipes need ingredient variety. Analytics need historical order data. Dynamic pricing needs demand patterns. Cooperative pages need multiple members. Every feature built in Iter1-3 underperforms without realistic data volume. | Low | 9 |
| 3 | Real-Time Data Pipeline & Background Jobs | Implement a job scheduler (BullMQ/node-cron) for: daily analytics aggregation, pricing rule expiry scans, subscription box composition, surplus auto-creation from approaching-expiry inventory, weekly menu generation, notification digests. WebSocket upgrade for real-time (replacing SSE polling). Redis for sessions + rate limiting + job queues. | The platform has 7+ features that depend on scheduled computation (analytics, pricing, subscriptions, surplus, recipes, notifications, experiments) but zero background processing. Everything runs on-demand via API calls. This creates stale data, missed opportunities (un-discounted expiring products), and unreliable notifications. | High | 9 |
| 4 | OAuth & Social Login + User Profiles | Google, Apple, Facebook OAuth via NextAuth.js/Auth.js. Rich user profile: avatar, delivery addresses (multiple), payment methods, order preferences, communication preferences. Account linking (social → existing account). MFA via TOTP. Password reset flow. Session management dashboard (view/revoke active sessions). | Custom session auth with no password reset, no social login, and no MFA is a hard blocker for real consumer adoption. Italian consumers expect Google login. Producer accounts need MFA for financial security. Rich profiles enable personalization across recipes, subscriptions, and recommendations. | Medium | 9 |
| 5 | E2E Testing & Quality Infrastructure | Playwright E2E tests for 8 critical journeys (browse→cart→checkout, auth flow, producer dashboard, recipe→basket, gift box→unbox, subscription management, forum posting, event booking). Visual regression testing with Percy/Chromatic. API contract testing for all 75 endpoints. Load testing with k6. Error tracking with Sentry. Test coverage dashboard. | 4 unit tests covering ~5% of a 75-endpoint surface is dangerously inadequate. The 110K LOC codebase is one refactor away from silent regressions across the 44 pages. Production deployment (Feature #1) is reckless without proper test coverage. E2E tests serve as living documentation of the platform's capabilities for investors and new contributors. | Medium | 8 |
| 6 | Intelligent Recommendation Engine | Collaborative filtering: "Clienti che hanno comprato X hanno anche comprato Y." Content-based: product similarity by category, origin, season, organic status. Context-aware: time-of-day suggestions (breakfast items in morning), seasonal recommendations, weather-based (warm soup when cold). Cross-feature recommendations: recipes → products, events → producers, forum posts → products. Homepage personalization based on browsing/purchase history. | The platform offers 200+ potential products but provides no intelligent discovery. Every major e-commerce platform uses recommendations to increase AOV and engagement. The data signals already exist: orders, reviews, dietary profiles, seasonal calendar — they just need to be connected. Recommendations are the natural extension of the recipe engine: "Hai cucinato la piadina — prova lo squacquerone del Podere Romagnolo." | High | 8 |
| 7 | Producer Self-Service Onboarding & KYC | Complete producer registration flow: business details, food safety certifications upload, product catalog builder (guided wizard), photo upload, delivery zone selection, Stripe Connect onboarding with real KYC verification, admin approval queue with automated checks. Producer mobile app (React Native or PWA-optimized) for order management, stock updates, and event creation. | The platform currently has 6 hardcoded producers. Real marketplace growth requires a self-service producer pipeline. Every day without producer self-onboarding is a day the marketplace can't grow its supply side. Italian food regulations require specific documentation (HACCP, partita IVA, SCIA) — building this into onboarding prevents compliance issues later. | High | 8 |
| 8 | GDPR Compliance & Legal Framework | Cookie consent banner (Iubenda/CookieBot integration), privacy policy generator compliant with Italian GDPR implementation (D.Lgs. 196/2003 + Reg. UE 679/2016), data export (DSAR) endpoint, account deletion with cascade, consent management for marketing/analytics, terms of service, food safety disclaimers for marketplace model, age verification where needed (wine). Data Processing Agreement template for producers. | Legal compliance is non-negotiable for EU launch. GDPR violations carry fines up to €20M or 4% of revenue. Italian food marketplace regulations require specific disclaimers. Without ToS, the platform has no legal basis for transactions. This feature is boring but blocking — no Italian lawyer would approve launching without it. | Medium | 8 |
| 9 | Advanced Producer Analytics & Business Intelligence | Upgrade analytics from simple aggregations to actionable intelligence: customer cohort analysis (new vs. returning by period), product lifecycle analysis (launch → growth → maturity → decline), seasonal demand prediction with weather data correlation, competitor price tracking (web scraping local markets), profitability analysis per product (factoring delivery costs), automated monthly report (PDF export). Interactive data exploration with drill-down. | Iter3 built the analytics foundation (daily sales, benchmarks, alerts) but it produces dashboards, not decisions. Producers need answers to "should I plant more tomatoes?" and "is my cheese overpriced?" — not just charts. Advanced BI justifies charging producers a monthly platform fee (€29-49/mo) instead of pure commission, creating predictable SaaS revenue alongside marketplace GMV. | High | 7 |
| 10 | Marketplace Operations Dashboard & Logistics | Admin super-dashboard: real-time order flow (incoming → assigned → picked → in-delivery → delivered), delivery driver assignment and route optimization, producer payout management with automated weekly settlements, customer support ticket system with order lookup, platform health metrics (uptime, API latency, error rates), financial reconciliation (daily revenue vs. payouts vs. commission). Delivery driver mobile interface. | The platform has consumer-facing features and producer tools but no operational layer. When real orders flow, someone needs to manage delivery logistics, handle refunds, track payouts, and resolve disputes. Without operations tooling, the first 10 orders will require manual spreadsheet management. This is what separates a demo from a business. | High | 7 |
Scoring Criteria (consistent with Iter 1, 2 & 3):
- User Impact (40%): Does it solve a real pain point or enable a core workflow?
- Market Differentiation (30%): Does it create competitive moat or unique positioning?
- Adoption Potential (20%): Will it attract new users or expand use cases?
- Technical Leverage (10%): Does it enable future features or integrations?
- Effort Estimate: 3–4 person-weeks
- Prerequisites: Vercel/Railway account, Stripe Connect account (real keys), Resend account, Cloudinary account, Neon/Supabase PostgreSQL instance
- Implementation Phases:
- Database migration — Migrate from SQLite to PostgreSQL (Neon serverless). Update Prisma provider, resolve SQLite-specific syntax (LIKE queries → trigram search). Run migration on 53 models. Set up connection pooling (PgBouncer/Prisma Accelerate). Seed production database with initial catalog data — Week 1
- Deployment pipeline — Deploy to Vercel with environment variables (dev/staging/prod). Configure custom domain. Set up GitHub Actions deployment (CI passes → auto-deploy to staging → manual promote to production). Health check endpoint. SSL/TLS configuration — Week 1-2
- Real integrations — Wire Stripe Connect with real keys (test mode first): producer onboarding webhooks, real checkout sessions, payout scheduling. Connect Resend for transactional emails (order confirmation, password reset, notifications). Configure Cloudinary for real image uploads with transformation pipeline. Connect OpenAI API for recipe generation — Week 2-3
- Observability — Sentry for error tracking, Vercel Analytics for web vitals, uptime monitoring (UptimeRobot/Better Stack), structured logging with Pino, environment-specific configuration — Week 3-4
- Success Metrics: Platform accessible at production URL; first real Stripe test-mode transaction completes end-to-end; image upload returns real CDN URL; email delivery rate > 95%; uptime > 99.5%
- Risks & Mitigations: SQLite → PostgreSQL migration issues → test with full schema on Neon staging first; Stripe Connect onboarding complexity → start with "Standard" accounts (simplest); cost management → Neon free tier (0.5 GB), Vercel hobby (100GB bandwidth), Resend free (100 emails/day) keeps initial costs at $0/mo
- Effort Estimate: 2 person-weeks
- Prerequisites: Faker.js (
@faker-js/faker), existing data models - Implementation Phases:
- Data generation framework — Install Faker.js with Italian locale. Create factory functions for all 53 models with realistic Italian data: producer names (Podere, Fattoria, Apiario + Romagna locations), product names (regional specialties), prices (market-realistic ranges per category). Configurable density: "demo" (30 producers, 200 products) vs. "stress test" (100+ producers, 1000+ products) — Week 1
- Temporal data & relationships — Generate 6 months of historical orders with realistic patterns: weekday vs. weekend volume, seasonal variation (peak in summer tourism), repeat customers. Create review histories, subscription lifecycles, forum posts with comments, event bookings, adoption records. Ensure referential integrity across all 53 models — Week 1-2
- Demo mode — Toggle-based demo mode that loads presentation-ready data: curated "hero" producers with compelling stories, photogenic products, active events, popular recipes. Investor pitch route (
/demo) with guided walkthrough of key features. Reset-to-clean script — Week 2
- Success Metrics: Seed completes in < 30 seconds; all 44 pages render with meaningful data; AI recipe engine generates recipes from seeded products; analytics dashboard shows trends; cooperative pages show multiple active members
- Risks & Mitigations: Unrealistic data → validate prices against Italian food market data; faker locale gaps → supplement with hand-curated Italian food vocabulary; seed script fragility → make idempotent with upsert operations
- Effort Estimate: 4–5 person-weeks
- Prerequisites: Redis instance (Upstash serverless), job scheduler (Vercel Cron or BullMQ)
- Implementation Phases:
- Redis infrastructure — Replace in-memory stores: rate limiter → Redis sliding window, sessions → Redis session store, SSE → Redis pub/sub for multi-instance support. Upstash serverless Redis for zero-config scaling. Connection pooling and graceful degradation (fall back to in-memory if Redis unavailable) — Week 1
- Job scheduler — Implement scheduled jobs using Vercel Cron Functions (or BullMQ for self-hosted): daily analytics aggregation (ProducerDailySales, CategoryBenchmarks), hourly expiry pricing scan, weekly menu generation, daily surplus auto-creation from approaching-expiry inventory, weekly subscription box composition, notification digest compilation. Job dashboard in admin panel — Week 2-3
- Real-time upgrade — Migrate from SSE polling to WebSocket connections (Socket.IO or Partykit). Real-time order tracking for consumers, instant new-order alerts for producers, live inventory updates. Connection management with heartbeat and auto-reconnect — Week 4-5
- Success Metrics: Analytics data always < 24h stale; expiring products auto-discounted 100% of the time; subscription boxes composed 3 days before delivery with zero manual intervention; WebSocket connection stability > 99%; Redis operations < 5ms p99
- Risks & Mitigations: Redis cost → Upstash free tier (10K commands/day) sufficient for MVP; WebSocket on serverless → use Partykit or dedicated WebSocket service; job failures → dead letter queue with retry logic and admin alerts; data consistency → exactly-once processing with idempotency keys
- Effort Estimate: 3 person-weeks
- Prerequisites: Auth.js (NextAuth v5), Google/Apple/Facebook developer accounts
- Implementation Phases:
- Auth.js migration — Replace custom session system with Auth.js. Configure providers: Google (highest priority — dominant in Italy), Apple (iOS users), email magic link (passwordless). Database adapter for Prisma. Preserve existing user data with migration script. Maintain backward compatibility during transition — Week 1
- User profile enrichment — Rich profile page: avatar upload (via Cloudinary), multiple delivery addresses with labels ("Casa", "Ufficio"), saved payment methods (Stripe customer), communication preferences (consolidate NotificationPreference with i18n language preference). Profile completion progress bar — Week 2
- Security features — TOTP-based MFA for producer accounts (financial operations require 2FA). Password reset flow via email. Active session management (view all devices, revoke sessions). Account linking: merge social login with existing email account. Audit log of security-relevant actions — Week 3
- Success Metrics: Google login conversion > 60% of new signups; profile completion rate > 70%; MFA adoption for producers > 80%; password reset success rate > 95%; session management page usage > 30% of users
- Risks & Mitigations: Auth migration data loss → run parallel systems for 2 weeks, migrate verified users only; OAuth provider approval delays → Google is instant, Apple requires enrolled developer account; existing session invalidation → graceful logout-all with re-login prompt
- Effort Estimate: 4 person-weeks
- Prerequisites: Playwright, test database, CI minutes budget
- Implementation Phases:
- API test coverage expansion — Expand from 4 to 30+ test files. Test every critical API path: full checkout pipeline (cart → coupon → loyalty → split → payment → order), auth lifecycle, inventory management, recipe generation, forum CRUD, event booking, cooperative management. Use Prisma test database with transaction rollback — Week 1-2
- Playwright E2E suite — 8 critical user journeys: (1) Guest browse → search → product detail, (2) Register → login → add to cart → checkout, (3) Producer dashboard → add product → manage orders, (4) Recipe browse → basket builder → cart, (5) Gift box → send → unbox landing, (6) Subscription signup → profile → preview → swap, (7) Forum post → comment → like, (8) Event browse → book → confirm. Headless Chrome in CI — Week 2-3
- Quality infrastructure — Sentry error tracking with source maps. API contract testing with Zod schema validation (ensure API responses match expected shapes). Performance benchmarking with Lighthouse CI (track web vitals per PR). Test coverage reporting with Codecov. Visual regression testing for key pages — Week 3-4
- Success Metrics: Test coverage > 60% overall, > 90% on checkout/auth paths; CI pipeline runs in < 8 minutes; zero P0 regressions in production; all 75 API routes have at least 1 test; E2E suite green rate > 95%
- Risks & Mitigations: Test database management → isolated test DB per CI run with auto-cleanup; E2E flakiness → deterministic seed data, retry logic, network-level mocking for external services; CI cost → parallel test sharding across 3 workers keeps under GitHub Actions free tier
- Effort Estimate: 4–5 person-weeks
- Prerequisites: Sufficient order history data (Feature #2), user profiles, product metadata
- Implementation Phases:
- Collaborative filtering — Build user-item interaction matrix from orders, reviews, and cart additions. Implement item-based collaborative filtering: "Clienti che hanno comprato Piadina hanno anche comprato Squacquerone (82%)." Pre-compute similarity scores nightly (background job from Feature #3). Serve via
/api/recommendations/[userId]endpoint — Week 1-2 - Content-based recommendations — Product similarity engine: same category, same producer, same season, organic status, price tier. Context-aware rules: morning → breakfast items, Friday → weekend entertaining, December → gift suggestions, rainy day → comfort food recipes. Weight signals: purchase history (40%), browsing (20%), profile preferences (20%), seasonal relevance (20%) — Week 2-3
- Cross-feature recommendations — Recipe → ingredient products ("Per questa ricetta ti servono..."), Event → producer products ("Dopo la visita da Marco, prova i suoi formaggi"), Forum post → mentioned products, Subscription box → complementary products. Homepage personalization: featured section adapts to user history. "Scopri Qualcosa di Nuovo" exploration widget that surfaces underexposed producers — Week 4-5
- Collaborative filtering — Build user-item interaction matrix from orders, reviews, and cart additions. Implement item-based collaborative filtering: "Clienti che hanno comprato Piadina hanno anche comprato Squacquerone (82%)." Pre-compute similarity scores nightly (background job from Feature #3). Serve via
- Success Metrics: Recommendation click-through rate > 8%; recommendation-driven AOV increase > 15%; producer exposure fairness (Gini coefficient < 0.4 across producer impressions); personalized homepage engagement +25% vs. static; "also bought" widget adoption on > 50% of product pages
- Risks & Mitigations: Cold start (new users) → popularity-based fallback + onboarding quiz signals; filter bubble → explicit "exploration" percentage (20% recommendations from outside user's usual patterns); data sparsity → content-based can work with zero interaction data; recommendation quality → A/B test personalized vs. editorial curation
- Effort Estimate: 5–6 person-weeks
- Prerequisites: Real Stripe Connect (Feature #1), image uploads (exists), admin approval (exists)
- Implementation Phases:
- Registration flow — Multi-step producer signup wizard: (1) Business details (name, partita IVA, location), (2) Food category selection, (3) Certification upload (HACCP, Bio, DOP documents as PDF/image), (4) Product catalog builder (guided: name → description → price → photos → seasonality), (5) Delivery zone selection from map — Week 1-2
- Stripe Connect KYC — Real Stripe Connect onboarding: identity verification, bank account linking, payout scheduling (weekly/monthly). Custom onboarding flow using Stripe Account Links. Status tracking: "In verifica" → "Approvato" → "Attivo". Handle edge cases: additional documents requested, failed verification, restricted accounts — Week 3-4
- Admin verification pipeline — Enhanced admin approval queue: document review UI, automated checks (partita IVA validation via Agenzia delle Entrate API, certification expiry check), producer scoring rubric. Onboarding analytics: time-to-approval, drop-off funnel, approval rate. Post-approval producer welcome email with getting-started guide — Week 5-6
- Success Metrics: Producer self-signup completion rate > 50%; time from registration to first product listed < 48 hours; KYC approval rate > 80%; 10+ new producers onboarded within first 3 months; producer churn within first 90 days < 20%
- Risks & Mitigations: KYC compliance complexity → use Stripe's built-in verification (they handle regulatory burden); producer tech literacy → phone-assisted onboarding option for first 20 producers; Italian bureaucracy → pre-fill forms with partita IVA lookup; quality control → manual review for first 50 producers, then automate common patterns
- Effort Estimate: 2–3 person-weeks
- Prerequisites: Legal review (Italian privacy lawyer), deployment domain
- Implementation Phases:
- Cookie consent & privacy — Integrate Iubenda (Italian-specific compliance). Cookie consent banner with granular categories (necessary, analytics, marketing). Privacy policy page auto-generated for Italian GDPR (D.Lgs. 196/2003). Data processing register. Cookie audit of all tracking — Week 1
- Data rights endpoints — DSAR (Data Subject Access Request) endpoint: export all user data as JSON/CSV. Account deletion with full cascade across 53 models (orders anonymized, not deleted for financial records). Consent management: per-purpose consent tracking (marketing emails, analytics, profiling for recommendations). Right to rectification (profile editing already exists) — Week 1-2
- Legal pages & food compliance — Terms of Service (marketplace model: platform connects buyers and sellers, doesn't sell food directly). Food safety disclaimer (producers responsible for HACCP compliance). Age verification gate for alcohol products (wine category). Producer Data Processing Agreement (DPA). Refund and cancellation policy compliant with Italian consumer protection (D.Lgs. 206/2005, 14-day withdrawal right for non-perishable goods) — Week 2-3
- Success Metrics: Cookie consent opt-in rate > 60%; DSAR response time < 48 hours; zero GDPR complaints; legal pages available in all 4 languages; account deletion completes in < 5 seconds; producer DPA signed by 100% of active producers
- Risks & Mitigations: Legal accuracy → hire Italian privacy lawyer for review (€1-2K budget); cascade deletion complexity → build dependency graph of all 53 models before implementing; consent retroactivity → existing users prompted to accept updated terms on next login; food regulation varies by region → start with Emilia-Romagna requirements, expand later
- Effort Estimate: 4–5 person-weeks
- Prerequisites: Sufficient historical data (Feature #2), background jobs (Feature #3), chart library (Recharts)
- Implementation Phases:
- Cohort & lifecycle analysis — Customer cohort matrix: month-of-first-purchase → retention by month. Product lifecycle classification (launch/growth/maturity/decline based on 12-week trend). Customer LTV prediction based on order frequency and AOV trends. Automated weekly "Rapporto Settimanale" summary email to producers — Week 1-2
- Predictive analytics — Seasonal demand prediction using 12-month historical patterns + temperature/weather correlation (OpenWeatherMap API). Stock-out risk scoring (predicted demand vs. current inventory). Optimal pricing suggestions based on elasticity estimation (small price changes → observe demand response). Revenue forecasting with confidence intervals — Week 2-3
- Business intelligence tools — Interactive drill-down: click a product → see customer demographics, repeat rate, seasonal pattern, price history. Comparative benchmarks: "Il tuo fatturato è nel top 20% dei produttori di formaggio." Profitability analysis: revenue − platform commission − delivery costs = net margin per product. Exportable PDF monthly report with charts and recommendations — Week 4-5
- Success Metrics: Producer analytics DAU > 60%; price adjustment actions taken from recommendations > 25%; revenue forecast accuracy within ±15%; weekly report email open rate > 50%; producer NPS for analytics tools > 40
- Risks & Mitigations: Insufficient data for ML → start with rules-based recommendations, upgrade to ML at 1000+ orders; weather API costs → cache daily forecasts, use free tier (1000 calls/day); producer data literacy → progressive disclosure (summary first, drill-down for advanced users); analysis paralysis → highlight top 3 actionable insights, don't overwhelm with charts
- Effort Estimate: 5–6 person-weeks
- Prerequisites: Real deployment (Feature #1), Stripe payouts, order volume
- Implementation Phases:
- Operations command center — Real-time order flow board: kanban view (incoming → assigned → picked up → in delivery → delivered). Order assignment to delivery slots/drivers. Live map of active deliveries (Mapbox/Leaflet). Escalation alerts: orders not picked up after 2 hours, delivery past estimated time. Customer support lookup: search by order ID, email, phone — Week 1-2
- Financial operations — Automated weekly producer payouts via Stripe Connect transfers. Commission tracking (15% platform fee). Reconciliation dashboard: daily revenue → platform commission → producer payouts → delivery costs → net margin. Refund processing with reason tracking. Invoice generation for producers (monthly) — Week 3-4
- Delivery logistics — Delivery driver mobile interface (PWA): assigned orders, route optimization (Google Maps Directions API), proof of delivery (photo + customer signature), communication with customer (one-tap call). Driver assignment algorithm: zone-based, capacity-aware, time-optimized. Delivery cost calculation: distance-based with zone multipliers. Customer real-time tracking ("Il tuo ordine è in consegna — arrivo stimato: 14:30") — Week 5-6
- Success Metrics: Average order-to-delivery time < 24 hours; delivery success rate > 98%; producer payout accuracy 100% (zero disputes); customer support resolution time < 4 hours; operations dashboard adoption by admin team > daily usage; delivery cost per order < €3.50
- Risks & Mitigations: Delivery driver recruitment → start with producer self-delivery, add dedicated drivers at 50+ daily orders; route optimization complexity → Google Maps API for MVP, custom optimization later; payout disputes → transparent dashboard showing exact calculations visible to producers; scalability → start with manual ops for first 100 orders/week, automate progressively
These high-value integrations combine newly proposed Iter4 features with the existing 46-feature foundation:
| Integration | Features Combined | Value Created |
|---|---|---|
| "First Real Transaction" | Deployment (#1) + Seed Data (#2) + OAuth (#4) | The minimum viable product loop: a real user signs in with Google, browses realistic catalog, pays with real Stripe, producer gets notified. This is the moment the platform becomes a business. |
| Smart Surplus Auto-Discovery | Background Jobs (#3) + Dynamic Pricing (Iter3) + Inventory (Iter2) | Cron job scans inventory daily → products within 3 days of expiry auto-get PricingRule → auto-create SurplusListing → push notification to nearby users. Zero producer effort to reduce waste. |
| Recommendation-Driven Recipes | Recommendations (#6) + AI Recipe Engine (Iter3) | Recommendation engine identifies a user's preference pattern → AI generates personalized recipe using their preferred producers' products → "Marco, stasera prova la piadina con lo squacquerone — è appena arrivato fresco!" |
| Onboarding-to-Analytics Pipeline | Producer Onboarding (#7) + Analytics (#9) + Cooperatives (Iter3) | New producer signs up → KYC verified → auto-assigned to regional cooperative → analytics dashboard shows category benchmarks → "Il prezzo medio per il miele nella tua zona è €12/kg — il tuo è €9." |
| GDPR-Aware Personalization | GDPR (#8) + Recommendations (#6) + Subscription Personalization (Iter3) | User consents to profiling → recommendation engine activates → subscription box personalization unlocks. User revokes consent → system gracefully degrades to popularity-based defaults. Compliance and UX aligned. |
| Tested Deployment Pipeline | E2E Tests (#5) + Deployment (#1) + CI (Iter3) | PR opened → CI runs 30+ unit tests + 8 E2E journeys → staging auto-deploy → manual QA → production promote. First time the platform has a safe change management process. |
| Live Operations + Driver Tracking | Operations Dashboard (#10) + PWA (Iter3) + Push Notifications (Iter2) | Customer places order → operations dashboard assigns driver → driver accepts on mobile PWA → customer gets push "Il tuo ordine è in consegna" → live map tracking → proof of delivery photo → satisfaction survey. |
| Tourist Lifecycle | Seed Data (#2) + Recommendations (#6) + Tourism (Iter3) + Ship Home (Iter3) | Tourist arrives → browses in-hotel QR menu → orders welcome box → attends farm tour → recommendations suggest favorite products → books ship-home order → becomes recurring international subscriber. Full lifecycle in one platform. |
| Cooperative Financial Intelligence | Operations (#10) + Analytics (#9) + Cooperatives (Iter3) | Cooperative admin sees aggregated financials: member revenue, shared delivery costs, joint marketing ROI, revenue share calculations — all automated. Replaces the spreadsheet that killed the last co-op's enthusiasm. |
| Producer Growth Loop | Onboarding (#7) + Analytics (#9) + Events (Iter3) + Forum (Iter3) | New producer onboards → analytics shows demand gaps → suggests hosting a tasting event → event generates forum posts from attendees → posts drive new customer acquisition → analytics show growth. Self-reinforcing flywheel. |
┌─────────────────────────────────────────────────────────────────┐
│ PROJECT VIABILITY SCORECARD (ITERATION 4) │
├─────────────────────────────────────────────────────────────────┤
│ Current Market Fit: [8/10] ████████░░ (= from 8) │
│ Growth Potential: [9/10] █████████░ (= from 9) │
│ Technical Foundation: [7/10] ███████░░░ (-1 from 8) │
│ Community Health: [2/10] ██░░░░░░░░ (= from 2) │
│ Competitive Position: [9/10] █████████░ (= from 9) │
│ Feature Completeness: [9/10] █████████░ (NEW metric) │
│ Operational Readiness: [2/10] ██░░░░░░░░ (NEW metric) │
├─────────────────────────────────────────────────────────────────┤
│ OVERALL SCORE: [7/10] ███████░░░ (= from 7) │
└─────────────────────────────────────────────────────────────────┘
Score Changes & New Metrics Justified:
- Market Fit (8→8): Feature breadth now exceeds any direct competitor, but market fit requires users interacting with real features — which hasn't been tested. Score can't increase without production deployment.
- Technical Foundation (8→7,
⚠️ decreased): 110K LOC across 236 files with only 4 test files is worse than 64K with 0 tests — the surface area doubled while coverage stayed near zero. The 53-model Prisma schema on SQLite is accumulating technical debt (JSON-as-strings, no FTS5, no concurrent writes). In-memory rate limiter and audit log work for dev but are production-dangerous. The architecture is impressive in breadth but increasingly fragile. - Competitive Position (9→9): The feature set is unmatched by any Italian regional food platform. AI recipes + blockchain traceability + cooperative federation + dynamic pricing + subscription personalization is a combination no competitor offers. But features without production deployment are claims, not moats.
- Feature Completeness (NEW, 9/10): Added this metric because the gap between features-built and features-operational is the core story. 53 models, 75 API endpoints, 44 pages, 23 components, 4 languages — this is startup-grade feature breadth from a solo developer.
- Operational Readiness (NEW, 2/10): Added to highlight the existential gap. Zero real payments, zero real users, zero production deployment, near-zero tests, no legal compliance, no ops tooling. This is the score that determines whether Tavola Romagna becomes a business or remains a portfolio piece.
- Community Health (2→2): Still solo. Bus factor of 1 with a 110K-LOC codebase is the single biggest risk.
Overall holds at 7/10 because the project has reached an inflection point: additional features yield diminishing returns while operational debt compounds. The platform is feature-complete for launch — possibly over-complete.
Bottom Line: Tavola Romagna is a technical tour de force — 46 features, 53 data models, and 110K lines of code that rival funded startups in scope. But the project is now in feature surplus and operational deficit. The gap between what's built and what works in production has widened with every iteration. The single most important next step is Feature #1: Production Deployment with Real Integrations. Deploy to Vercel, connect real Stripe, send real emails, and put the URL in front of 3 real Romagna producers. The second priority is Feature #2 (Seed Data) to make the platform look alive, and Feature #4 (OAuth) to let real users sign in. No further features should be built until the first real €1 has been transacted. The platform has proved "can we build it?" — it now needs to answer "will anyone use it?"