A server action is a function that runs on the server when a user submits a form. The browser sends the form data, the server processes it, and sends back a response — all without you writing any API endpoints.
Here's what happens when someone clicks "Save" on your form builder:
Form.create(data) to write to the databaseThis all happens in a single route file. The action export handles the form submission the same way the loader export handles page loads.
The database runs on the server. Browser code can't reach it directly — and you wouldn't want it to. If the database were accessible from the browser, anyone could read, modify, or delete data by opening the developer console.
Server actions keep the boundary clear: the browser sends data, the server decides what to do with it. Validation, authorization, and database access all happen where they can't be tampered with.
redirect() — On success, send the user to a new page (e.g., the results page after creating a form)return { errors } — On validation failure, send the errors back so the form can show them next to the relevant fieldsThis is the same pattern you'll see in every route that handles form submissions — create, update, delete. The action receives data, validates it, talks to a model, and responds.
?The loader → Page → action cycle