What does it take to run a small web app?
A small web app usually needs more services than code. You pick a host for the frontend, a server or functions platform for the API, a database, somewhere to keep files, and then you connect them all with credentials and environment variables.
In Codehooks those are one project. Your frontend build is served from the same deploy as your API routes, and the code talks to the database directly (there is no connection string to manage). Authentication works with API tokens or JWTs from Auth0, Clerk or any JWKS provider.
That makes it a good fit for dashboards, internal tools, form backends and the API behind a mobile or single-page app.
An API and a frontend in one file
A validated REST API for customers, plus the frontend that uses it. The database comes with the project, so there is nothing to configure before the first request.
import { app } from 'codehooks-js';
import * as Yup from 'yup';
const customer = Yup.object({
name: Yup.string().required(),
email: Yup.string().email().required(),
});
// GET, POST, PUT, PATCH and DELETE under /api/customer, with validation
app.crudlify({ customer }, { prefix: '/api' });
// Your React, Vue or plain HTML build, with client-side routing
app.static({
route: '/',
directory: '/dist',
default: 'index.html',
notFound: '/index.html',
});
export default app.init();
Where to go next
Complete examples you can deploy, and the docs behind them.
Lists, detail views, forms and search generated from a schema of your own collections.
Receive submissions from any HTML form, store them and get an email for each one.
A step-by-step guide to a React frontend talking to a Codehooks API.
Put a cache in front of an expensive third-party API, using the key-value store.
Questions about building apps
Common questions about building with Codehooks.
Can I host my frontend on Codehooks?
app.static() serves files from your deployed source, so a React, Vue, Svelte or plain HTML build runs from the same project as your API. Set notFound to your index.html for client-side routing, and use the headers option for cache control on hashed assets. Paid plans add custom domains with SSL. See frontend hosting in the docs.How do I add a REST API with a database?
app.crudlify(), which creates REST endpoints for your collections with optional Yup, Zod or JSON Schema validation. For anything custom you write Express-style routes and use the NoSQL database API from your handler. Both can live in the same file.How do users log in?
coho jwks , and every API call is verified against it. For something simpler, such as a shared password on an admin route, your coding agent can write the check in an app.auth() hook. See authentication for the provider URLs.Is Codehooks a no-code app builder?
Building with a coding agent
Your agent can run coho create, write the frontend and the API, and deploy with coho deploy, all from the terminal. Run coho prompt first so it has the full API reference.
Start building your app
Create a project, add your frontend and API, and deploy it in seconds.