Skip to main content

Concepts overview

Codehooks.io is the agent-native backend platform. A complete backend — API routes, database, queues, workers, cron, auth, and frontend hosting — that deploys in seconds from the CLI. Your coding agent creates, deploys, verifies, and iterates without ever leaving the terminal.

Forget about assembling Lambda + API Gateway + DynamoDB + SQS — just focus on your business logic.

Codehooks includes these main features:

  • Studio - Developer friendly web based tools for managing both data and code
  • Node.js and JavaScript - Same language for frontend and backend development (ES6 and Typescript)
  • NPM - Node.js package manager (npm) integration
  • Node.js Express - API development with Express-like API
  • NoSQL - Document database with Mongodb-like API
  • Key-Value - Key-Value database with a Redis-like API (subset)
  • Worker Queues - Persistent queues with worker functions
  • Background jobs - Cron jobs with scheduled worker functions
  • CLI - Powerful Command Line Interface (CLI) for productivity and DevOps/CI support

Read on to learn more about how Codehooks.io simplifies backend development — whether you're building directly or through a coding agent.

Unless you've already have, please read the quick start first to learn how to install the CLI, and how to sign up/login to create your first Codehooks project.

Codehooks main concepts

Project

A project is the top level concept in Codehooks. A project is owned by an account (private or company) and contains one or multiple "spaces" with your deployed code, data and access credentials in an isolated and secure unit. You can create multiple projects within your account and you can join/invite others to a project. An example project structure is shown below:

  • [email protected] (private or corporate account owner)
    • customers (project name)
      • dev (development space)
      • prod (production space)
    • salesdb (project name for another project)
      • ...

Projects are created with the CLI command coho create (CLI docs here)

note

You can also manage your projects and spaces using the account user interface at https://account.codehooks.io.

The project application source code

A Codehooks application follows the familiar principles and best practices of modern JavaScript development. A project directory typically contains:

  • An index.js file for the application main entry code
  • A package.json file with library dependencies
  • A config.json file with project information

We also recommend that you add source control (GIT) to manage your versions and branches. Typically this will be a git repo with branches that are deployed to various spaces.

A minimal example

The following CLI commands create a project and deploy it to the Codehooks cloud. These are the same commands a coding agent like Claude Code or Cursor would run autonomously.

Create and setup a new project application:

coho create example
cd example
npm init --yes
npm install codehooks-js --save

After running the commands your project directory contains these files:

.
├── config.json
├── index.js
├── node_modules
├── package-lock.json
└── package.json

If you inspect the source file index.js you'll see the default generated application code:

/*
* Auto generated Codehooks (c) example
*/
import { app } from 'codehooks-js';

// test route for https://<PROJECTID>.api.codehooks.io/dev/
app.get('/', (req, res) => {
res.send('CRUD server ready');
});

// Use Crudlify to create a REST API for any database collection
app.crudlify();

// bind to serverless runtime
export default app.init();

We can now deploy the application (in our case example-4g9p) to the cloud with the CLI command coho deploy (CLI docs here).

coho deploy

# Server output example
Project: example-4g9p Space: dev
Deployed Codehook successfully! 🙌

After deployment we can inspect the application details with the coho info command, in this example showing our default space dev with its base endpoint URL and access token(s):

coho info --examples

Project name: example-4g9p
Team: YOUR-NAME (personal account)

API endpoint: https://example-4g9p.api.codehooks.io/dev/*

Spaces:
┌──────────────┬────────────────────────────────────────────┬──────┬──────┐
│ Name │ Tokens │ Jwks │ Env │
├──────────────┼────────────────────────────────────────────┼──────┼──────┤
│ dev (active) │ a77926ca-xxx-yyyy-zzzzz-14eee564f8d5 (RW) │ │ │
└──────────────┴────────────────────────────────────────────┴──────┴──────┘

After successful deployment we can test our application endpoint with curl. This minimal example and test shows that our application is deployed to a secure endpoint and returns the expected result:

curl -X GET 'https://example-4g9p.api.codehooks.io/dev' \
-H 'x-apikey: a77926ca-xxx-yyyy-zzzzz-14eee564f8d5'

# API output example from server
CRUD server ready

Project spaces

A project space is a self-contained and isolated bundle of code, datastores and security settings within a specific project. All projects have a default space called dev which is created automatically when you add a project. You create new spaces with the coho add command (CLI docs here). You can easily switch between different project spaces with the coho use command (CLI docs here). Spaces can also have restricted access (team ADMINs only), which is convenient for production deployments.

For example, in your project you want to have isolated development, testing and production spaces.

Project-X
└── dev
   ├── source code (git branch dev)
   ├── security settings & env variables
   └── data stores
└── test
   ├── source code (git branch test)
   ├── security settings & env variables
   └── data stores
└── prod (restricted)
   ├── source code (git branch prod)
   ├── security settings & env variables
   └── data stores

Deploy your application to the Codehooks serverless cloud

Each project space is created as an isolated resource group in the Codehooks cloud. For example, the coho add prod command creates a project space called prod. By switching to the space with the coho use prod command, this space is now the active (changed in the config.json project file). On deployment with the coho deploy command, the current version of your application source code is packed and distributed as a serverless runtime to the prod space in the Codehook cloud.

Similarily, switching to another space, e.g. by using the coho use dev, sets the dev space as the active, and coho deploy will deploy the application to the active dev space.

This is a powerful feature, which effectively enables you to run multiple versions of your application with separate settings, environments and data stores.

Built in Datastores

Persisting, querying and manipulating data is essential in any application. Codehooks comes with a built in datastore that supports streaming NoSQL and Key-Value operations. No need to think about drivers and protocols, it's built directly into the Codehooks APIs.

Data wrangling

Using the CLI command coho import, you can easily import any CSV or JSON file into a datastore. Furthermore, the coho query command lets you query and transform data in advanced ways.

Example: import and query of Stock data
coho import -c stocks -f ~/Downloads/all_stocks_5yr.csv

coho query stocks --query 'Name=GOOG&open>10' --limit 2 --table

┌───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ date │ open │ high │ low │ close │ volume │ Name │ _id │
├───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ 2013-03-… │ 15.98 │ 16.36 │ 15.93 │ 16.25 │ 8383300 │ GOOG │ 18007b5f… │
├───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ 2013-03-… │ 14.7 │ 14.93 │ 14.5 │ 14.82 │ 9125300 │ GOOG │ 18007b5f… │
└───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┘

Fast development flow

The development process with Codehooks is fast — whether you're working in an editor or your coding agent is driving the CLI.

A typical development flow:

  1. Write or generate code in index.js and other source files
  2. Set the active space, e.g. coho use dev
  3. Deploy with coho deploy
  4. Check logs with coho log --follow
  5. Fix issues and redeploy with coho deploy

Every step is a CLI command, which means coding agents can run the full create → deploy → verify → iterate loop without human intervention.

Command Line Interface (CLI)

The Codehooks CLI is how you — or your coding agent — manage projects and applications. Every operation is available as a CLI command: creating projects, deploying code, managing secrets, querying data, and checking logs. This CLI-first design is what makes Codehooks agent-native.

Codehooks also has a complete set of features for teams to collaborate. The account UI lets you create teams and invite team members.

Read more about the CLI and the full set of commands and features here.

note

You can also manage your projects and spaces using the account user interface at https://account.codehooks.io.