# From idea to app

A worked path from a first prompt to a published app with sign-in and a database, using Plan mode, the canvas, Lyna Cloud and publishing.

This guide builds a small app from start to finish: a booking page for a yoga studio, with classes stored in a database and sign-in for members. Swap in your own idea as you go.

The editor with a yoga studio booking app on the canvas and the chat showing the plan it was built from.

## The path

1. Describe the idea and plan it.
2. Build the first version.
3. Polish the design on the canvas.
4. Add a database and sign-in.
5. Test it.
6. Publish it.

1) ### Describe the idea and plan it

   Create a project, then switch the chat to **Plan** mode (`Cmd/Ctrl + .` opens the mode menu). Describe who the app is for, the pages it needs and what each page does:

   > A booking site for a small yoga studio. Pages: home with the week's classes, a class page with a Book button, a sign-in page, and "My bookings" for members. Calm, light design with one accent color.

   The AI answers with a plan. Ask for changes until it matches what you want. See [Chat modes](/features/ai/chat-modes).
2) ### Build the first version

   Switch to **Build** mode and ask the AI to build the plan. It writes a React app with TypeScript and Tailwind CSS and shows each step. Every turn that changes files ends with a version you can go back to. See [Version history](/features/projects/version-history).

   Build in small steps: one page or one feature per message works better than everything at once.
3) ### Polish the design

   Select an element on the [canvas](/features/design/canvas) and change it in the [Styles](/features/design/styles) panel, or select it and tell the AI what to change. Set your colors and fonts once in [Brand and design system](/features/design/brand-and-design-system) so every page follows them. Check the phone and tablet sizes with [frames and devices](/features/design/frames-and-devices).
4) ### Add a database and sign-in

   Open **Settings > Lyna Cloud > Database** and set up a database (a paid plan is needed). Then ask:

   > Create a classes table and a bookings table linked to users, with row level security so members only see and change their own bookings. Add email sign-in and protect the My bookings page.

   Check the result in [Database](/features/cloud/database) and [Users and auth](/features/cloud/users-and-auth).
5) ### Test it

   Use the app in the preview: sign up, book a class, sign out. Open the [devtools](/features/test-and-debug/devtools) to read console errors. On an error, choose **Ask the agent to fix this** to send it to the chat.
6) ### Publish it

   Choose **Publish**, review the security check, and publish. Your app is live at a Lyna address in about a minute. See [Publishing](/features/publish/publishing), then [Launch on a custom domain](/tips-and-tricks/launch-on-a-custom-domain).

## Tips along the way

- Set [project rules](/features/ai/rules) early, such as "use the Brand colors only" or "every page must work on a phone".
- Attach a screenshot or a sketch when words are not enough. See [Attachments and screenshots](/features/ai/attachments-and-screenshots).
- If a change goes wrong, revert to the previous version instead of asking for many fixes.
- Use `/compact` or a new chat when a conversation gets long.

## Related

- [Prompting best practices](/prompting/best-practices): Write prompts that work.
- [Best practices](/tips-and-tricks/best-practices): Habits for better results.
- [Launch on a custom domain](/tips-and-tricks/launch-on-a-custom-domain): Your own address.
