# Build a Mini CRM with a Coding Agent

> See a working mini CRM built on Userland. Try the live demo, copy the prompt, and track every lead from first request to won job.

- Canonical page: https://userland.fun/examples/mini-crm/
- Live demo: https://mini-crm-demo.apps.userland.fun/
- Source: https://github.com/dwrtz/userland-public/tree/main/examples/mini-crm
- Use case: [Local business apps](https://userland.fun/use-cases/local-business-apps/index.md)
- Userland docs for agents: https://docs.userland.fun/llms.txt

## Agent prompt

```text
Build and publish a lead inbox and mini CRM for my business on Userland.

What I need:
[Describe your business and your leads in your own words: what people ask you for, what you need to know about each one, and the steps a lead goes through. For example: "I remodel kitchens. Homeowners request an estimate, I call them, visit, send a quote, and mark the job won or lost."]

How to work:
1. Read https://docs.userland.fun/llms.txt first and follow the Userland docs. Don't guess how Userland works.
2. Start from the mini CRM example at https://github.com/dwrtz/userland-public/tree/main/examples/mini-crm. It has a public request form and an owner-only lead board with stages, notes, follow-up dates, and recent activity. Replace its made-up renovation company with my business and remove its demo mode.
3. If I haven't filled in "What I need", ask me first. Ask anything else you need before you build, then explain your plan in plain language: the pages, how customers send a request, who can sign in, and what gets saved about each lead.
4. Build the app. Only I should see leads: protect the lead board with a sign-in and an owner role. Customers can send a request but never see anyone else's. Keep API keys and secrets on the server, never in the browser.
5. Publish with the Userland CLI. If you need to sign in, run userland login and I'll approve it in my browser. Then set me up as the owner so I can sign in to the lead board.
6. When it's live, tell me the link, how customers send requests and how I work my leads, anything that needs a paid plan, and how to undo a release if something breaks. Note the app ID and release ID in the project README so you can publish updates later.
```

## Live demo

Open https://mini-crm-demo.apps.userland.fun/. Send an estimate request as a customer, then open the owner view to see it arrive. Move leads between stages, set follow-ups, and add notes. Use made-up details, since what you add shows on your own demo link.

## What this app does

- Takes requests from a public form that checks every field and filters out spam bots
- Shows every lead on one board, with stage filters and counts for new leads and follow-ups due
- Moves each lead from new to contacted, site visit, quoted, and won or lost
- Sets a follow-up date on any lead and flags the ones that are due or overdue
- Keeps notes and a full history for each lead, plus recent activity across all of them
- Lets only the owner sign in to see leads; customers never see anyone else's request

## Who this is for

- Contractors and home-service businesses
- Consultants and coaches
- Small agencies
- Real-estate agents
- Nonprofits following up with donors

## App spec

### User roles

- Customer, no sign-in. Sends a request from the public form.
- Owner, signs in. Sees and manages every lead.

### Screens

- Request form
- Confirmation
- Lead board with stage filters and recent activity
- Lead detail with history, stage, follow-up date, and notes
- Add a lead

### Managed resources

- Managed data for leads and their history
- App sign-in with one owner role and no public sign-up

### Routes

| Route | Purpose |
| --- | --- |
| `/` | Public request form |
| `/estimate` | Saves a request as a new lead |
| `/thanks` | Confirmation after a request |
| `/admin` | Owner lead board, with a filter for each stage |
| `/admin/leads/new` | Owner adds a lead from a call or referral |
| `/admin/leads/{id}` | Lead detail and history |
| `/admin/leads/{id}/stage` | Owner changes the stage and follow-up date |
| `/admin/leads/{id}/notes` | Owner adds a note |

### Data model

#### Lead

- `id`
- `name`
- `email`
- `phone`
- `project`
- `budget`
- `timeline`
- `details`
- `stage (new, contacted, site visit, quoted, won, lost)`
- `source`
- `follow-up date`
- `time received`

#### Activity

- `id`
- `lead`
- `lead name`
- `kind (request, added by owner, stage change, follow-up, note)`
- `new stage`
- `details (the note, or the new follow-up date)`
- `time`

## Implementation notes

The app has two parts: a public request form for customers and a private lead board for the owner. The server builds every page, so they load quickly and work without JavaScript.

**Saved information.** Userland managed data keeps two lists. Leads hold each person's details, the current stage, and the next follow-up date. Activity is a running history of every request, stage change, follow-up, and note, and it also feeds the board's recent activity. A new lead and its first history entry are saved together, so one is never saved without the other.

**Owner sign-in.** The app has a single owner role and no public sign-up. Every owner page checks for a signed-in user with that role. It sends signed-out visitors to the sign-in page and turns away anyone without the owner role. After publishing, your agent invites you, and anyone who helps with sales, as an owner.

**Spam and safety.** The request form checks every field, limits how long answers can be, uses a hidden field that catches bots, and ignores posts sent from other websites. Everything a customer types is shown as plain text, never run as code. Customers can send a request but can never read one back.

**Every lead leaves a trail.** Besides the history you see on each lead, every new lead, stage change, and note is written to the app's activity log with record numbers only, never names or email addresses. You can read it in the Userland console or with `userland apps events` when something looks wrong. On Starter and above, traffic analytics show visits to the form, top pages, and where visitors came from.

**Undo.** Every publish is a new release. Rolling back switches the live release and keeps your leads, notes, and sign-ins.

**The demo.** The live demo lets anyone see the owner side without signing in. Each visitor sees the sample leads plus what they added, and their changes to sample leads show up only for them. Entries are tied to the visitor's demo link rather than an account, so the demo asks for made-up details, and it caps how much each visitor and the demo as a whole can save. That demo mode lives in one file, and the prompt asks your agent to remove it before you share your own app.

## Variants

- Consultant CRM that tracks discovery calls, proposals sent, and signed engagements
- Coaching lead tracker that moves people from intro call to trial session to paying client
- Agency lead inbox that collects project briefs and tracks pitches and budgets
- Real-estate lead tracker for buyers and sellers, with showing and offer stages
- Workshop applicant tracker that reviews, accepts, or waitlists each applicant
- Nonprofit donor follow-up list with thank-you calls, meetings, and pledges

## FAQ

### What plan does this app need?

The app runs on the Free plan. Free covers the owner sign-in, the request form, and up to 1,000 saved records, where each lead and each history entry counts as one. Your own domain, a named address like yourbusiness.apps.userland.fun, and traffic analytics (visits to your form, top pages, and where visitors came from) need Starter or above; the lead board works without them.

### How do I undo a change?

Every publish is a new release. Ask your agent to roll back to the previous release with the Userland CLI. The live app switches back in seconds, and your leads, notes, and sign-ins stay as they are. Free keeps your last 2 releases; Starter keeps 10.

### Who can see my leads?

Only people you invite as owners. Customers can send a request but can't see any leads, including their own. In the public demo, visitors see sample leads plus what was added through their own demo link, so anyone they share that link with sees it too. The demo asks for made-up details.

### Can it email me when a new lead comes in?

Not in this example. Ask your agent to add it with an email service you choose. The service's key stays on the server as a Userland secret, and your agent should tell you if the change needs a paid plan.

### Can I change the stages and fields?

Yes. Tell your agent the steps your leads go through and what you need to know about each one. The stages, project types, and budget ranges are short lists your agent can edit.

## Related examples

- [Booking App](https://userland.fun/examples/booking-app/index.md): Booking page with open times and a request form, plus a private owner inbox to confirm, decline, and edit services.
- [Invoice Generator](https://userland.fun/examples/invoice-generator/index.md): Quote request form, private client links to accept quotes, and an owner desk that turns accepted quotes into printable invoices.
- [Waitlist App](https://userland.fun/examples/waitlist-app/index.md): Pre-launch waitlist with invite links that move people up the line, optional questions, and an owner view with a spreadsheet download.
- [Job Board](https://userland.fun/examples/job-board/index.md): Niche job board with search and category filters, an employer submission form, and an owner review queue.
- [Local business apps](https://userland.fun/use-cases/local-business-apps/index.md)
- [All example apps](https://userland.fun/examples/index.md)
