Stop writing the same CRUD API for every project
Routes, validation, pagination, filters, login, docs - most of a new backend is the same code as the last one. What you can safely generate, and what still deserves real code.
Start a new project and the first few days look like the last project's first few days. Set up a database. Pick Express or Django or Rails. Write a model, then five routes for it: list, get one, create, update, delete. Add validation. Add pagination, then filters, then sorting. Add sign-up and login. Make sure users can't read each other's data. Write the API docs. Repeat for the next table.
None of that is your product. It's the same code with different field names.
What a CRUD backend is made of
For each table you usually write:
- Five endpoints:
GET /items,GET /items/:id,POST /items,PUTorPATCH /items/:id,DELETE /items/:id. - Validation: required fields, types, unique values, sensible error messages.
- List options: pagination, filters (
?status=open), sorting, maybe search. - Relations: an order with its customer, a post with its comments.
- Access checks: who may list, read, create, change and delete, and the "only your own records" case.
- Docs: so the frontend (or another developer) knows what exists.
And once per project: user accounts, password reset emails, API keys, CORS, deployment, backups.
What generating it looks like
With CodeFreeAPI you describe the table instead of coding it. Create an entity, add typed fields (text, number, date, boolean, email, relation, file and more), mark the required and unique ones, and the endpoints exist:
GET /api/v1/orders list, with filters, sorting and pages
GET /api/v1/orders/:id one record
POST /api/v1/orders create (validated against your fields)
PUT /api/v1/orders/:id update
PATCH /api/v1/orders/:id change some fields (null clears one)
DELETE /api/v1/orders/:id delete
POST /api/v1/orders/bulk create many at once
The list options come with it:
curl "https://YOUR_PROJECT.codefreeapi.com/api/v1/orders?status=paid&total[gte]=50&sort=-createdAt&page=2&limit=20&populate=customer" \
-H "X-API-Key: YOUR_API_KEY"
Access rules are set per entity and method: public, signed-in users, the record's owner, or admins. Each project gets its own user accounts with sign-up, login and password reset, and interactive API docs (Swagger UI and an OpenAPI 3.0 file) that update when you change a field.
When CRUD isn't enough
Real apps have a few operations that are more than "save this record": place an order and lower the stock, send a welcome email, charge a card. That's where hand-written backends earn their keep, and where generated ones usually stop.
In CodeFreeAPI those are custom endpoints, built from steps: read records, check a condition, calculate a value, create or update records, call another service over HTTP. Keys for services like Stripe or SendGrid are stored as encrypted project secrets and never reach the browser. Webhooks tell your other systems when data changes, and scheduled jobs handle the nightly cleanup.
When to write it yourself
Generating the backend is the wrong choice when:
- The core of your product is complex server logic: heavy computation, unusual algorithms, long-running processes.
- You need full SQL: reporting queries, database extensions, your own indexes.
- You need realtime updates or a protocol other than HTTP.
- You must host everything on your own servers.
For everything else, especially the first version of something, the CRUD part is the least interesting code you'll write. Describe it, let it be generated, and spend the saved days on the part only you can build.
Build it on a real backend
Database, REST API, user login and logic, hosted for you. Free plan, no credit card; your API is live in a few minutes.