Skip to main content
An AI writing assistant where users chat with GPT to draft blog posts, edit copy, and brainstorm ideas. The app includes conversation history so users can pick up where they left off, user accounts with authentication, and a Pro subscription tier that unlocks unlimited messaging.By the end of this recipe you will have a production-ready AI app that you can customize, rebrand, and launch as your own product.

Tech stack

You do not need to understand these technologies. Rocket handles them automatically. This table is for reference.

Architecture overview

Here is how data flows through the app:
  1. Sign in. The user creates an account or logs in through Supabase Auth.
  2. Send a message. The user types a prompt in the chat interface. The message is sent to an API route that calls the OpenAI Chat Completions endpoint.
  3. Stream the response. GPT’s response is streamed back to the browser in real time, token by token.
  4. Save the conversation. Each message pair (user + assistant) is saved to a Supabase messages table, grouped by conversation.
  5. Track usage. A counter in Supabase tracks how many messages the user has sent today.
  6. Enforce limits. Free users are capped at 20 messages per day. When they hit the limit, the app shows an upgrade prompt.
  7. Upgrade. Clicking “Upgrade to Pro” redirects to a Stripe Checkout session for the $12/month plan.
  8. Send emails. Resend delivers a welcome email on signup and a daily usage summary for Pro users.

How long does it take?

Step-by-step build

1

Start the project

Open rocket.new and describe the app you want to build. Be specific about the core features so Rocket generates a solid foundation.
A detailed initial prompt saves you from reworking the layout later. Include the app name, core features, and UI preferences up front.
2

Connect Supabase for auth and data

Connect Supabase to handle user accounts and store all conversation data. Rocket will create the database tables and auth flow automatically.
3

Connect OpenAI

Add your OpenAI API key so the app can send messages to GPT and receive completions.
Your OpenAI API key is billed separately by OpenAI based on token usage. Monitor your spending in the OpenAI usage dashboard.
4

Build the chat interface with streaming

Make the chat feel responsive by streaming GPT’s responses token by token instead of waiting for the full completion.
Streaming makes the app feel much faster because users see the first words immediately instead of waiting several seconds for a complete response.
5

Add conversation history

Let users create multiple conversations, switch between them, and pick up past chats where they left off.
6

Implement usage limits for the free tier

Add a daily message cap for free users to control costs and incentivize upgrades.
Pick a daily limit that gives users enough value to see the product’s potential while still creating a reason to upgrade. 20 messages is a good starting point.
7

Connect Stripe for the Pro plan

Add a paid tier that removes usage limits. Stripe handles the checkout, billing, and subscription management.
Start with Stripe Test mode keys during development. Use test card number 4242 4242 4242 4242 to simulate payments. Switch to Live keys only when you are ready to accept real payments.
8

Add email notifications with Resend

Send a welcome email when users sign up and notify them about usage milestones.
9

Deploy to Netlify and test end-to-end

Push the app to production and run through the full user journey.Use the Launch button in your Rocket project to deploy to the web. Rocket handles the Netlify build configuration automatically. Make sure all required environment variables are set in your project’s integration settings before launching.Test checklist:
  • Sign up with a new email and verify the welcome email arrives
  • Start a conversation and confirm GPT responses stream correctly
  • Create multiple conversations and switch between them
  • Send 20 messages to trigger the usage limit banner
  • Complete a Stripe test checkout and verify Pro features unlock
  • Cancel the subscription and confirm the user reverts to the free tier
10

Go live

Once testing is complete, switch to production credentials and launch.
  • Switch Stripe to live mode keys in the project environment variables
  • Confirm Supabase row-level security is enabled on all tables
  • Verify the OpenAI system prompt does not leak sensitive information
  • Redeploy with the production environment variables
  • Connect a custom domain if you have one

Customization ideas

Let users choose between OpenAI GPT-4o, Anthropic Claude, and Google Gemini. Add a model selector dropdown in the chat header so users can switch models mid-conversation.
Let users upload PDFs, text files, or Markdown documents and ask the AI to summarize, edit, or rewrite the content.
Enable shared workspaces where team members can collaborate on conversations, share templates, and manage a shared Pro subscription.
Let users create and save custom personas or writing styles that modify how the AI responds.
Let users speak their prompts instead of typing, using the browser’s built-in speech recognition API.

Troubleshooting

If the full response loads after a long pause instead of appearing word by word, streaming may not be set up correctly. Ask Rocket to fix it:
Also make sure your OpenAI integration is connected and your API key has sufficient credits.
If you see errors when conversations get long, the chat history may be exceeding the model’s limit. Ask Rocket to add a safeguard:
If users see error messages when sending messages quickly, your OpenAI account may be hitting its rate limit. Ask Rocket to handle it gracefully:
If this happens frequently, you can request a higher rate limit from OpenAI in your account settings.
If messages vanish when you refresh the page or switch between conversations, they may not be saving to the database. Ask Rocket to debug: