Flows category icon
App Builder
Intermediate

MongoDB Data Model Plan

Design a MongoDB data model that fits your queries: embed vs reference, indexes, and validation.

5 steps15 verify checks45-75 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/5 verified

Context Pack

Paste this first. It briefs the AI on requirements, constraints, and the Definition of Done before your first build prompt.

Context Pack
PROJECT CONTEXT:
I am building on MongoDB and want a data model designed around my app's actual access patterns.

GOAL:
Produce a query-driven MongoDB model: collections, embed/reference decisions, indexes, and validation.

REQUIREMENTS:
- Access patterns listed before modeling
- Embed vs reference decided per relationship with reasoning
- Indexes matched to the query patterns
- Validation strategy (app-level or JSON Schema)
- The model tested against the real queries

CONSTRAINTS:
- Model for the queries, not for relational habits
- Avoid unbounded embedded arrays

DEFINITION OF DONE:
- Every app query maps cleanly to the model
- Indexes exist for every frequent query
- Ownership fields enable per-user scoping
- Validation rejects malformed documents

COMMON FAILURES TO AVOID:
- Modeling like SQL with joins everywhere
- Unbounded arrays that grow forever inside documents
- No indexes, causing collection scans on every list
- No ownership field, making user scoping impossible

Paste this into your AI builder first. It teaches the AI what you want before you give it the build prompt.

Related routes

More App Builder flows that share ground with this one.

Flows category icon
App Builder

Supabase Schema Plan

Design a correct Supabase schema: tables, relationships, RLS policies, and verification queries.

01Model the data
02Write the schema SQL
03Enable RLS with policies

+2 more steps to Done

Best forbuilders who have shipped a basic app before

5 steps45-75 minutesIntermediate
Flows category icon
App Builder
Generated

Add Real-Time Presence Indicators to a Chat App with WebSockets

A step-by-step flow for implementing real-time online, offline, and typing presence in a chat app using WebSockets, including backend presence tracking, frontend updates, reconnect handling, and verification.

01Inspect the existing chat architecture and choose presence data flow
02Define the presence event contract and server-side state model
03Implement authenticated WebSocket connection handling on the server

+7 more steps to Done

Best forbuilders who have shipped a basic app before

10 steps60-120 minutesIntermediate
Flows category icon
App Builder
Generated

Add Team Invites to a SaaS App

Build a real team invitation system for a SaaS app, including invite creation, email/share flow, acceptance, membership creation, role assignment, validation, and end-to-end testing.

01Audit Existing Team, User, and Auth Models
02Add Invitation Data Model and Migration
03Implement Secure Invite Creation API

+7 more steps to Done

Best forbuilders who have shipped a basic app before

10 steps60-120 minutesIntermediate

Made with Emergent