How to build a Retool alternative

How to build a Retool alternative with a focused v1, clear data rules and practical checks. Keep your saved work portable and handle failed writes before.

  • vibe-coding

How to build a Retool alternative starts with one private approval panel. We will build one complete path, save its result, and check that the next page request shows the same data. Use the Retool catalog prompt to compare this scope with the wider product.

How to build a Retool alternative with a clear v1

The owner signs in, creates the main record and opens its detail page. They make a valid change and read the result after refreshing. The first release also includes an export and a documented restore procedure. Keep builders, arbitrary SQL consoles, credentials for production databases and third-party connectors outside this build.

Write that boundary into the README before generating screens. Ask the agent to list every route that reads or changes data. A list page, detail page, create form, edit form and export endpoint are enough to begin. Avoid adding an administration dashboard until there is a real setting to administer.

Use fictional records during development. Real personal or company information can wait until authorization, backups and restore checks work. A convincing interface is easier to generate than a dependable write path, so we will check persistence at each stage.

Step 1 choose the runtime and create the schema

Use Astro for server-rendered routes, HTMX for partial form updates and Alpine.js for local controls. SQL stores the records. Start on a Node host with persistent SQLite storage, or choose a hosted relational database if the host has no durable disk. Keep the database client inside server modules.

These are proposed records for our replacement:

Request(id, owner_id, title, amount_cents, state, revision)
Decision(id, request_id, actor_id, outcome, note, created_at)

Every child must lead back to an owner. Use foreign keys and indexes that support that lookup. A route accepting a child identifier should join through its parent before returning data. UUIDs make guessing harder, but authorization still decides whether the request succeeds.

Send the first prompt:

Create an Astro server application with HTMX and Alpine.js.
Implement the proposed schema with versioned SQL migrations.
Add two fixture owners with separate records and development sessions.
Keep all database access in server modules.
Document the migration, seed and test commands in the README.
Do not generate external service integrations.

Run the migration against an empty test database. Seed both owners, stop the process and start it again. Check that each record still exists. Then run the migration command again and confirm that already-applied migrations are skipped rather than replayed.

Step 2 implement the domain rule before the layout

An approval is a state transition. Update the pending request and append its decision in one transaction. Require the current revision and a reviewer role. Never infer permission from the presence of an Approve button.

Use this acceptance fixture:

Create a pending request for a replacement laptop costing 120000 cents. A reviewer approves it once. A second approval request returns the saved decision. An attempt to approve a rejected request fails without changing its history.

Keep that fixture beside the domain function as a readable test. It should call the same code as the server mutation. A test that only reproduces a calculation in a second function cannot catch a defect in the actual save path.

Implement the domain rule and fixture described above.
Validate all fields on the server before opening the transaction.
Reject invalid changes without altering the current saved record.
Return field errors alongside the attempted values.
Test successful writes, invalid inputs and transaction rollback.

After this step, inspect saved rows directly. Confirm the expected state, values and revision. Simulate a database error after the first write in a multi-row operation. Either all required records should commit or all should roll back. Document the transaction guarantees of the selected SQL driver.

Keep approval authority separate from ownership

For the first version, make the requester and reviewer explicit roles. A requester creates a pending request and may withdraw it before a decision. A reviewer can approve or reject a pending request. Decide whether people may approve their own requests; use a separate reviewer in the fixture so the boundary is easy to inspect.

A corrected amount should produce a new pending revision. An earlier approval applies to the amount the reviewer saw. Store that amount in the decision snapshot so the history remains readable after later edits. Never attach an old approval to a newly increased amount.

Current state Action Result
Pending Reviewer approves Approved with decision snapshot
Pending Requester withdraws Withdrawn
Approved Requester changes amount Refuse; create a new request
Rejected Reviewer approves Refuse terminal-state change

Send this additional prompt after implementing the schema:

Add requester and reviewer roles to the approval fixture.
A requester cannot approve their own request.
A decision captures request revision, amount and reviewer identity.
Approved, rejected and withdrawn requests are terminal.
Represent a correction as a new request linked to the original.
Test permission checks through direct HTTP requests.

Be careful with money fields. Parse a decimal input into integer cents using a decimal-safe parser. Reject extra fractional digits rather than silently rounding them. Keep a currency code on the request if you support more than one currency, and never total unlike currencies together.

The approval screen should show the exact amount, currency and request revision above the action. A reviewer returning from lunch may have an old page open. Submit the displayed revision and refuse the decision if the requester has changed the record. Show the new revision and ask for a fresh decision.

Export decisions alongside requests. An export containing only today’s status loses who approved the amount and which revision they reviewed. In the restore fixture, open the decision history and confirm those values survived. The history should still explain the approval even when the associated requester account has been archived.

Step 3 build the create and detail forms

Start with ordinary HTML forms that submit to server routes. Make every field label explicit and show the expected unit beside numeric inputs. A blank field and a zero value may have different meanings; decide which fields permit either before accepting submissions.

The form posts data, the server validates it, and a successful response redirects to the detail page. The detail page reads committed rows. HTMX can shorten that round trip later, but the first version should work with JavaScript disabled.

Build create, list and detail routes for the saved records.
Use accessible labels and field-level validation messages.
Preserve submitted values when validation or persistence fails.
Redirect after successful ordinary form submissions.
Show an empty list with one create action and no sample production data.

Create the fixture through the interface. Refresh its detail page, open the list and follow the record link back. Compare displayed values with the saved rows. Enter angle brackets in a text field and confirm they render as plain text. Try a very long title and check that the server enforces the documented limit.

Step 4 protect edits from retries and conflicts

Two browser tabs can load the same revision. The first saves a valid change. The second must receive a conflict instead of silently replacing that change. Include the expected revision in the form and match it inside the mutation query.

A retry needs another rule. Generate a submission key when displaying a new operation, then retain it through recoverable failures. Store that key with its result. When a response is lost after commit, retrying the key returns the original result instead of creating another operation.

Add expected-revision checks to every edit.
Persist request keys for operations that create records or decisions.
Return a conflict with the current saved revision and attempted input.
Keep request-key lookup scoped to the authenticated owner.
Test a lost response followed by a retry with the same key.

Open the same record in two tabs and perform the stale edit sequence. The newer data must survive. Then submit the same create payload twice with one key and count the records. Repeat with a different owner’s session: no saved result or private field should leak through the retry response.

Request Expected outcome
Valid current revision Saved result with a new revision
Older revision Conflict and retained input
Repeated request key Original result
Wrong owner No private record contents
Failed transaction Previous state remains

Step 5 connect the useful views

A secondary view should derive from saved records. Keep its filters in the URL where practical so a reload preserves the view. Include a clear way to remove the filters. An empty filtered result should explain that records may exist outside the current selection.

Input → authorized validation → transaction → saved rows
                                               ↓
                                   detail, list and export
Failure → retain input and show a retry action

For this build, the useful outcome is one private approval panel. Keep labels consistent between the detail view and list. A change that appears successful in a local preview should display a pending indicator until the server returns its committed result. On failure, restore the saved presentation while retaining the attempted value for correction.

Ask the agent to add keyboard navigation and a small-screen layout. Use the interface at a narrow width, tab through the controls, and activate the main action without a mouse. Check long titles and validation text so they remain readable without covering the save button.

Step 6 export records and prove restoration

Export stable identifiers and a schema version. Include the fields needed to reconstruct ownership relationships and history. Describe whether archived records are included. A CSV can help with inspection, but JSON is usually easier for restoring related records without losing types.

Add an authenticated JSON export with a schema version.
Write a restore command targeting an empty development database.
Validate the whole archive before inserting any records.
Refuse duplicate identifiers and missing parent references.
Compare restored records with the exported fixture.

Download an export as the first owner. Confirm that the second owner’s records are absent. Restore into a fresh database, sign in and open the restored detail page. Check the domain fixture again. Count records, compare identifiers and inspect a historical value rather than relying on a success message from the importer.

Keep the original export until the restored application passes these checks. If import fails midway, roll back the operation and report which record failed without printing private contents into shared logs. Never test restoration by overwriting the only production database.

Step 7 deploy the server and its storage together

A static site build can display pages, but these mutations require a server runtime. For Cloudflare, configure the current Astro adapter and bind D1 to the server routes. For a Node deployment, verify durable storage or connect the hosted database before serving traffic. Put secret values in the host’s secret settings.

Create a staging database and apply migrations there first. Seed fictional records, deploy the app and repeat the fixture through the public staging URL. Verify that sessions use secure cookies and state-changing forms reject cross-site requests. Disable any development session shortcuts before production.

Document staging and production deployment for the chosen host.
List required secret names without including secret values.
Add a health route that reveals no records or credentials.
Document backup, restore and migration rollback procedures.
Run the acceptance fixture against staging before production.

Use separate database bindings for staging and production. Check the actual binding after deployment by creating a fictional staging record and confirming it never appears in production. Test expired sessions by opening an edit form, expiring the session, then submitting. The response should ask for sign-in while explaining how to preserve unsaved input.

Handle the failures you will see first

A missing record should show a useful unavailable page with a route back to the list. An empty workspace should offer creation. A database outage should show a recoverable error and a request identifier, with details confined to server logs. Keep private record contents out of those logs.

Test a failed export and a rejected stale edit separately. A successful page load says little about either operation. Check other views after every important mutation: the list, detail page and downloaded export should agree about the committed result.

A basic prototype covers one owner’s happy path. A maintained version adds authorization tests, conflict handling and tested restoration. Replacing the whole commercial product adds support and compatibility obligations far beyond this scope. Finish the fixture and export before extending the feature list.

Read the Retool post for the wider scope decision. Use the scope article and prompt article when changing the build request. The Trello guide offers another example of a saved workflow with ordered records.

Related articles

Read all articles →