Plan and describe your app
In Momen, AI Copilot can do the building, but what to build, who it is for, how the data fits together, and how payment works are still your decisions. The clearer you are and the more precisely you describe it, the more often AI gets it right the first time; the earlier you check what it built, the less you redo.
This page first lists the essentials of a good description, then walks through planning a complete app in five stages, using an online course app as the example.
Essentials of a good description
- Say who it is for: which roles the app has and what each needs to do, for example “students browse and buy courses; admins publish courses and view orders”.
- Scope this version: list the features to build now, and also the ones to leave out for now, so AI does not build beyond the scope.
- State the key business rules: who can see which data, how amounts are calculated, which statuses an order goes through. AI cannot decide these for you, and they are where mistakes are most likely.
- Discuss first, then build: start in Research mode, which only answers questions and proposes an approach without changing the project; once the plan is settled, switch to Build mode. See Using AI Copilot.
- Build in steps: build the core flow first, inspect and confirm it, then add features one at a time. The bigger the request, the harder it is to get every feature right.
- Use images: attach a screenshot of the layout you want, or of the problem you see.
- Check after each turn: look at what this turn built before moving on. See Inspect and take over.
Planning a complete app in five stages
Requirements and MVP
Decide what to build and who it is for, and start with only the core.
User journey
Decide how users get through the app step by step; this determines the pages you need.
Data modeling
Decide what information to store and how it relates; this determines the tables you need.
UI and experience
Decide what each page looks like and where the key actions go.
Logic
Decide what happens behind each action, especially where money and permissions are involved.
You can settle each stage first and tell AI everything at once, or settle it step by step in conversation.
The sections below walk through the five stages with an online course app.
Requirements and MVP
MVP (Minimum Viable Product): keep only the features that solve the core problem, launch, then iterate on real feedback. The most common beginner mistake is trying to build a full-featured platform in one go.
Decide
- Problem: instructors need to sell their knowledge; students need to buy and learn.
- Roles:
- Student: browse courses, buy, watch videos.
- Instructor / admin: publish courses, manage orders.
- MVP features:
- ✅ Course list and details
- ✅ Payment (Stripe)
- ✅ Video playback
- ❌ (Later) Community forum, points store, live streaming
Tell AI
Put the roles, the features to build, and the features to leave out into one description. Saying what not to build keeps AI from building beyond the scope:
Build an online course app.
Roles: students and admins. Students browse courses, buy them with Stripe, and watch the full video after buying; admins publish courses and view orders.
This version only: course list, course details (with a preview video), purchase, My Courses.
Not now: community forum, points store, live streaming.Check
When AI proposes its plan, compare it with your feature list: ask it to drop anything extra and add anything missing, then let it build.
User journey
A user journey is the path a user takes through the app to reach a goal. Once the path is clear, so are the pages you need and how they link.
Decide
For a student buying a course:
- Entry: open the home page from a shared link or search.
- Browse: see interesting titles and covers in the course list.
- Details: select a card to open the details page with the introduction and preview video.
- Purchase: select “Buy Now” to start checkout.
- Success: payment is confirmed and the app goes to “My Courses”.
- Learn: select a purchased course to play the full content.
Tell AI
Put this journey straight into your description. AI uses it to decide which pages to build, how they link, and what data each step needs.
Check
In Design → Interface, check that the page list covers every step of the journey, then walk through the journey from start to finish in Mirror.
Data modeling
The data model determines what your app can store and how information relates. It is the step that most reflects engineering thinking, and the one most worth checking early: if the data structure is wrong, pages and logic have to change with it.
Decide
- Table: the core objects in the app, such as
accountandcourse. - Field: what each table stores, such as
titleandprice. Every field has a type, such as Text, Decimal, Boolean, Date, Image, File, or JSON. - Relation: how tables connect.
- 1:1 (one-to-one): an account has exactly one profile.
- 1:N (one-to-many): an account can place many orders; a category holds many courses.
- N:N (many-to-many): a student takes many courses, and a course has many students. A many-to-many relation needs a junction table.
Tip: In Momen, every table has default id, created_at, and updated_at fields.
Tell AI
You usually do not need to write out the tables; AI derives them from your requirements and user journey. If you already know some key rules, include them, for example “a course can be bought by many students, and students can only watch courses they have bought” or “prices are exact to the cent”.
Check: reference data model
| Table | Fields | Description |
|---|---|---|
| account | id (BigInt), username (Text), profile_image (Image), email (Text), phone_number (Text) | Basic account info and authentication. |
| course | id (BigInt), title (Text), cover (Image), price (Decimal), video_file (File), description (Text), stock (BigInt) | Course content, metadata, and inventory. |
| order | id (BigInt), status (Text), amount (Decimal) | Transaction records. |
| enrollment | id (BigInt) | Junction table for the account–course many-to-many relation, recording which students can access which courses. |
Key relations:
- account – order (1:N): who placed the order.
- course – order (1:N): which course the order is for.
- account – enrollment (1:N) and course – enrollment (1:N): together, through the
enrollmentjunction table, they link accounts and courses as many-to-many.
AI’s table and field names may differ from the table above. Focus on three things:
- Every table is there, especially the junction table for a many-to-many relation;
- Prices and amounts use the Decimal type;
- A student’s purchased courses can be reached through the relations.
Some field changes can only be made by deleting and adding the field again once it has been synced to the backend, so check this before building pages. See Set Up the Database and Inspect and take over.
UI and experience
UI (user interface) is about visuals; UX (user experience) is about flow and usability.
Decide
- Home page: use a grid or list that highlights each course’s cover and price.
- Details page: put the preview video at the top, and pin the “Buy Now” button to the bottom so it is easy to reach on a phone.
Tell AI
Describe the overall style and the key interactions, for example “a clean, bright style with blue as the primary color” or “pin a Buy Now button to the bottom of the details page”. If you are unsure about the style, ask AI to propose a few directions first.
Check
- The home page list is bound to the
coursetable, not filled with fixed sample content; - The Buy Now button on the details page stays pinned to the bottom while the page scrolls.
Positions and spacing are often faster to adjust directly on the canvas than to describe to AI. See Inspect and take over. For how layout works, see Layout System.
Logic
With the UI and data in place, Action (frontend) and Actionflow (backend) connect them.
This is the part AI must get right and you must check: logic that touches sensitive data such as amounts and stock has to run on the server. Below is the full flow behind “Buy Now” in the course app.
Decide: the purchase flow
When the user selects “Buy Now”, the system runs this sequence:
Why it is designed this way: the three key steps in detail
- Create Order Record - Server-Side Security Before initiating the payment flow, you must create the order record on the server side. ⚠️ Critical Security Principle: Order creation logic must be executed within an Actionflow, not directly from the frontend database operations.
- Config: Create an Actionflow with the following logic:
- Receive Course ID and User ID from frontend
- Query course data on the server to get real price and stock information
- Perform necessary validations (e.g., sufficient stock, valid price)
- Create an
orderrecord withPendingstatus using the server-retrieved real price - Return Order ID and amount to frontend
- Why:
- 🔒 Prevent Price Tampering: Frontend cannot manipulate price, stock, or other sensitive data
- ✅ Ensure Data Consistency: Server-side unified business logic validation
- 📊 Traceability: Provides a reliable Order ID anchor for subsequent payment processes
- Call Payment Action - Bind Server-Verified Context
- Config: Bind the server-returned
order.id,amount, andcurrency(from Step 1) to thePaymentaction’s input parameters. - Why:
- 🔒 Security: Use the server-verified amount returned from Step 1, not client-side values that could be tampered with
- 📌 Traceability: Pass
order.idso the payment callback knows which order to update - ✅ Data Integrity: Ensure the payment gateway receives the exact amount validated by your server
- Handle Business Logic This is where the core business rules are defined. Momen provides a built-in Actionflow that triggers automatically by payment gateway webhook.
- System Auto-Handling: The system automatically records a
Payment Recordand parses the payment result into different branches. - User Config: Inside the built-in Actionflow, locate the “Success” and “Failed” branches to add your business logic:
- Success: Change the
order.statustoPaid, create anenrollmentrecord to grant access to the course. - Failed: (Optional) Change the
order.statustoFailed, log the error and notify the user. - Processed: System automatically skips to prevent duplicate processing. No user configuration needed.
- Success: Change the
- Why:
- Frontend Risk: Logic running in the browser (Frontend) is untrusted because users can use developer tools to manipulate variables or fake a “Success” signal to bypass payment.
- Backend Security: This Actionflow runs in a trusted server environment completely isolated from the user. It relies on a direct, verified signal (Webhook) from the payment provider to the server. Since the user cannot touch or intercept this server-to-server communication, it is impossible to spoof a payment.
For how frontend actions and backend Actionflows divide the work, see Interaction model.
Tell AI
Add one line to your requirements, such as “create the order on the server when buying, read the price from the database, and grant the course after a successful payment”. AI Copilot can also create the payment configuration itself; merchant keys are referenced as secrets, so the plaintext never passes through the conversation. See Payment overview.
Check
Check each item of the payment logic once it is built:
- The order is created in an Actionflow, not written to the database directly from the frontend;
- The order amount comes from the course price queried on the server, not from a value passed in by the frontend;
- The payment action is bound to the order ID and amount returned by the Actionflow;
- In the payment callback Actionflow’s Success branch, the order is updated to paid and an
enrollmentrecord is created.
If you cannot tell, ask AI to debug-run the create-order Actionflow and check each node’s inputs and outputs. See Verify against the live app.
You now know what to decide, what to tell AI, and what to check at each stage of planning an app. Next, learn how to operate AI Copilot in Using AI Copilot; for how to inspect and take over what it builds, see Inspect and take over.