How to build a Qwilr alternative
How to build a Qwilr alternative with ordered prompts, data rules and failure checks. Deploy a focused tool with a tested export and restore path.
How to build a Qwilr alternative starts with a proposal page with versioned line items and an acceptance record. Create a proposal, add fixed-price line items, preview the total, publish a read-only revision and record acceptance of that exact revision. Use the Qwilr catalog prompt for the wider context.
How to build a Qwilr alternative with a clear v1
Create a proposal, add fixed-price line items, preview the total, publish a read-only revision and record acceptance of that exact revision. Write this flow into your README before generating screens. Keep identity verification, legally certified signatures and payment collection outside this version. Each would introduce a separate operating problem and a larger testing boundary.
Model the saved records
These are proposed tables for your replacement, rather than a description of the commercial product’s internals:
Proposal(id, owner_id, title, currency, draft_revision)
LineItem(id, proposal_id, revision, label, quantity, unit_cents)
Publication(id, proposal_id, revision, token_hash, published_at)
Acceptance(id, publication_id, accepted_at, request_key)
Follow ownership from every child row to its root record. Check that relationship on reads and writes. Browser filters help navigation; server authorization determines access.
Input → validation → authorized transaction → committed revision → read/export
↓ failure
retained input
Calculate proposal amounts in integer cents
Choose one currency for a proposal and keep it fixed after publication. Store prices in integer minor units. For this version, allow positive integer quantities only. Decimal quantities and currencies with different minor-unit conventions require an explicit extension to the model.
Use two fixture items: three workshops at 12500 cents each and two review sessions at 7500 cents each. The expected total is 52500 cents. Calculate it on the server from saved rows. Ignore any total submitted by the browser.
| Item | Quantity | Unit cents | Subtotal cents |
|---|---|---|---|
| Workshop | 3 | 12500 | 37500 |
| Review | 2 | 7500 | 15000 |
| Total | 52500 |
Reject negative quantities and oversized integers before arithmetic. Format the total using the selected currency and locale only at the display boundary. Exports should retain the integer amount and currency code alongside the human-readable text.
Accept one frozen publication
An acceptance must point to the publication id and revision. If the owner edits the draft after sharing it, the old public URL continues to show its frozen revision. Publish a new revision explicitly when the client should review changed terms.
Generate a random share token and store only its hash. Treat possession of that link as permission to view this proposal. Keep the owner’s editing routes behind authentication. A share link must never double as an edit token.
Acceptance is a manual acknowledgement in this small app. Label it that way. Do not claim that a click verifies a person’s identity or meets a particular electronic-signature standard. If your business requires those guarantees, keep the relevant service.
Handle withdrawn and expired proposals
An owner can withdraw a publication. Its URL should show a useful unavailable state without exposing the current draft. Decide whether an accepted publication can be withdrawn; for this guide, preserve accepted records and allow a separate superseded mark with a reason.
Set expiration on the publication, not the browser countdown. Enforce it with server time during acceptance. At the exact boundary, the transaction should reject a new acceptance and retain the previous published content for the owner’s records.
Send the same acceptance request key twice. Expect one acceptance row and the same result identifier. Open an old shared revision after publishing a new one, then verify which version each acceptance names. These fixtures catch a subtler bug than an incorrect displayed total.
A print stylesheet can provide a basic PDF through the browser. Print the frozen public revision and verify that page breaks do not separate the currency label from the total. Avoid adding a document-rendering service until you need repeatable generated files.
Choose the stack and write the first migration
Use Astro for server-rendered pages, HTMX for form updates, and Alpine.js for small local previews. Keep the database behind server routes. Start with SQLite on a Node host with persistent storage, or use a hosted SQL database when the application host has no persistent disk.
For a Cloudflare deployment, use an Astro server adapter and D1 bindings for the dynamic routes. A static Pages build alone cannot process these writes. Keep database access in one module so authorization and transaction rules are easy to inspect.
Add versioned migrations and a fixture command to the repository. Run the migration against both a fresh database and a populated development copy. Include foreign keys, unique constraints and indexes for the queries the main screen actually performs.
Prompt 1 builds the empty workflow
Explain the acceptance flow above to your coding agent, then send this first request:
Create a server-rendered Astro application using HTMX and Alpine.js.
Implement owner authentication with a maintained auth library.
Add the proposed SQL tables through a versioned migration.
Create an empty dashboard and a working first-record form.
Keep database credentials and session secrets on the server.
Document setup, migration and fixture commands in the README.
Run the app, create the first record and reload. Restart the process and read it again. An empty database should show a useful create action. A failed database connection should show a recoverable error instead of pretending there are no records.
Check the signed-out response directly. Private data must be absent from the response body, including serialized browser state. Use two owner accounts in development to check that changing an identifier cannot cross the ownership boundary.
Prompt 2 enforces the core write
Once the domain rules below are clear, ask for their implementation:
Implement the acceptance flow with server-side validation.
Enforce the domain invariant inside the database transaction.
Use stable request keys for operations that can be retried.
Return the saved identifier and revision after commit.
Reject stale edits while preserving the submitted values for review.
Add fixtures for duplicate requests, invalid parents and denied access.
Have the agent name the exact transaction boundary. A read followed by a later unrelated write can race. Send overlapping requests from two clients and inspect the resulting rows, rather than relying on a button becoming disabled.
Give every editable record a revision. Submit the loaded revision with the form. An update should match both the authorized record id and that revision. When nothing matches, return a conflict and let the person compare their attempted change with the saved version.
Prompt 3 completes the screens
Keep previews and saved results visibly distinct:
Build the owner list, detail screen and bounded public view if required.
Use the committed server response to update the interface.
Provide loading, empty, invalid, unavailable and retry states.
Keep attempted input after a failed save.
Support keyboard use with labeled controls and field-level errors.
Do not add features outside the stated v1 acceptance flow.
Use a slow connection to make pending states visible. Submit once, interrupt the response and retry using the same request key. Reopening the page should reconcile the actual saved result. A client-side success toast should appear only after the server confirms the operation.
Render user text with escaping. For any rich text you eventually add, choose a maintained sanitizer and an explicit allowlist. Test markup inside titles and notes. It should appear as text or be sanitized according to that rule.
Export and restore before deployment
Export stable identifiers, revisions, timestamps and every relationship needed to reconstruct the workflow. Put a format version at the top of the export. Do not include session cookies, raw share tokens or API credentials in a data download.
Import into a separate database first. Validate the complete file before changing saved records. Show counts and conflicts in a preview, then require an explicit commit. A failed import must leave the previous data intact. Reject unknown future format versions with an explanation.
Restore a fixture and compare both row counts and the result of the main acceptance flow. Counts alone miss broken relationships. If you cannot reconstruct the useful screen from the export, keep working on the format before trusting it with real data.
Deploy and exercise the hosted flow
Create production storage separately from development. Apply migrations before serving code that depends on them. Set secrets through the host’s secret configuration, then deploy the server build. Confirm that the domain uses HTTPS and the session cookie has appropriate secure settings.
Open the public or signed-in entry point on the deployed hostname. Perform the full acceptance flow with synthetic records, reload, and check the owner index. Then test an unavailable id and a signed-out request. The local build cannot establish that production bindings or authorization are configured correctly.
Keep logs to request ids, operation names and outcomes. Exclude user text and credentials. Add a health check that verifies required storage access without leaking private rows. Record the deployed version so a report can be connected to a particular release.
Back up before the next migration. Keep the previous artifact available and document whether a code rollback is compatible with the new schema. Prefer additive migrations while the project is young. Test restoration into a clean environment before removing your old service.
Keep the next version bounded
The basic build completes the acceptance flow with manually entered fixtures. A stronger personal tool adds permission tests, recovery, export and concurrent-edit handling. Reproducing the wider commercial service adds integrations and continuing operations; use the catalog’s three estimate levels to choose the next step.
Stop when the defined flow works on the deployed hostname and survives a restore. Write down one missing feature only when using the tool exposes a concrete need. Keep the rest outside the next coding prompt.
Continue with the related build post and the scope guide. For another implemented workflow boundary, see the HoneyBook guide.