Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

core

> 后端框架
Open source

Backend server API handling user mgmt, database, storage and real-time component

741 stars0 likes1 views
WebsiteGitHub

About

Backend server API handling user mgmt, database, storage and real-time component

StaticBackend

StaticBackend is a simple backend server API that helps you create web applications. It handles most of the building blocks you'll need on the backend.

  • Authentication (docs →)
  • Account->users management (docs →)
  • Database CRUD, queries and full-text search (docs →)
  • Realtime/Websockets (docs →)
  • File storage (docs →)
  • server-side functions (docs →)
  • Schedule jobs
  • Send mails/sms (docs →)
  • Caching (docs →)
  • Handle forms (docs →)
  • Resize images & convert URL to PDF (docs →)

note: The project was archived in June 2024 and active development restarted in January 2026.

Table of content

  • Install
    • Local development
    • Frontend client
    • Backend clients
    • Go package
  • Usage
    • JavaScript example
    • Go client example
    • Go package example
  • Documentation
  • Deployment
    • Render
    • Heroku
    • Docker
  • Get support
  • Contributing
  • How you can help

Install

You'll want to install different pieces depending on what you want to build. Here's what you can install:

Local development

Our CLI includes a fully functional development server. You don't need to install anything else.

bash
$ npm install -g @staticbackend/cli

You may install the CLI manually as well.

This will install as the backend program. Start the development server with:

bash
$ backend server

This command creates a new application and an admin user for you. You'll receive a PublicKey and a RootToken.

All HTTP request to the API requires a public key. The root token allows you to sign in to the dashboard for this application as the owner.

Frontend client

Add the library to your dependencies:

bash
$ npm install @staticbackend/js

Inside your module:

javascript
import { Backend } from "@staticbackend/js";
const bkn = new Backend("dev_memory_pk", "dev");

dev_memory_pk is the default local development public key and dev is the default region / host for the instance you're targetting.

You may also include the library inside a `


### Backend clients

We've pre-built backend client libraries you may use directly:

**Node**:

```sh
$ npm install @staticbackend/backend

Go:

bash
$ go get github.com/staticbackendhq/backend-go

View the Go package documentation

Python:

bash
$ pip install staticbackend

Go package

You can import a Go package directly into your Go program and build your application with the same building blocks without hosting the API separately.

bash
$ go get github.com/staticbackendhq/core/backend

View the Go package document

Usage

You may build web and mobile applications using StaticBackend as your main backend API.

StaticBackend is a multi-tenant platform allowing you to host multiple isolated applications.

You need an instance of the backend API running via the CLI for local development or running as a normal process with required dependencies.

You create your first application before you can start.

Using the CLI:

bash
$ backend server

Using the source code:

bash
$ git clone https://github.com/staticbackendhq/core
$ cd core
$ cp .local.env .env
$ make start

Visit http://localhost:8099 and create an application.

Javascript example

Note that the Nodejs client library has the same API / function names as the JavaScript library.

javascript
import { Backend } from "@staticbackend/js";

const bkn = new Backend("dev_memory_pk", "dev");

let token = "";

login = async () => {
	const res = await bkn.register("[email protected]", "password");
	if (!res.ok) {
		console.error(res.content);
		return;
	}
	token = res.content;

	createTask();
}

createTask = async () => {
	const task = {
		desc: "Do something for XYZ",
		done: false
	};

	const res = bkn.create(token, "tasks", task);
	if (!res.ok) {
		console.error(res.content);
		return;
	}
	console.log(res.content);
}

Go client example

go
package main

import (
	"fmt"
	"github.com/staticbackendhq/backend-go"
)

func main() {
	backend.PublicKey = "dev_memory_pk"
	backend.Region = "dev"

	token, err := backend.Login("[email protected]", "devpw1234")
	// no err handling in example

	task := new(struct{
		ID string `json:"id"`
		AccountID string `json:"accountId"`
		Title string `json:"title"`
		Done bool `json:"done"`
	})
	task.Title = "A todo item"
	err = backend.Create(token, "tasks", task, &task)
	// task.ID and task.AccountID would be filled with proper values
}

Go package example

go
// using the cache & pub/sub
backend.Cache.Set("key", "value")

msg := model.Command{Type: "chan_out", Channel: "#lobby", Data: "hello world"}
backend.Cache.Publish(msg)

// use the generic Collection for strongly-typed CRUD and querying
type Task struct {
	ID string `json:"id"`
	Title string `json:"title"`
}
// auth is the currently authenticated user performing the action.
// base is the current tenant's database to execute action
// "tasks" is the collection name
tasks := backend.Collection[Task](auth, base, "tasks")
newTask, err := tasks.Create(Task{Title: "testing"})
// newTask.ID is filled with the unique ID of the created task in DB

…

shell
$ git clone https://github.com/staticbackendhq/core
$ cd core
$ cp .demo.env .env
$ docker build . -t staticbackend:latest
$ docker-compose -f docker-compose-demo.yml up

Open a browser at http://localhost:8099 to create your first application.

For production, you'll want to configure environment variables found in .env file.

PostgreSQL connection pool

StaticBackend limits its PostgreSQL pool per running process. The defaults are intended for a small shared database:

POSTGRES_MAX_OPEN_CONNS=10
POSTGRES_MAX_IDLE_CONNS=5
POSTGRES_CONN_MAX_LIFETIME_SECONDS=1800
POSTGRES_CONN_MAX_IDLE_TIME_SECONDS=300

…

shell
$ make test-ci-local-clean

This starts an isolated Docker Compose test stack on non-default host ports, runs the PostgreSQL core pass, Mongo core pass, database provider tests, and component tests, then removes the test containers and volumes. Use make test-ci-local if you want to leave the test services running.

If you have any feedback (good or bad) we'd be more than happy to talk. Please use the Discussions tab.

Same for contributing. The easiest is to get in touch first. We're working to make it easier to contribute code. If you'd like to work on something precise let us know.

Here are videos made specifically for people wanting to contribute:

  • Intro, setup, running tests, project structure
  • backend package and v1.4.1 refactor and changes

Check the contributing file for details.

How you can help

If you're looking to help the project, here are multiple ways:

  • Use it and share your experiences.
  • Sponsor the development via GitHub sponsors.
  • Spread the words, a tweet, a blog post, any mention is helpful.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gobackend-apidbaas

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架