Skip to content

1backend/1backend

Repository files navigation

1Backend

backend build frontend build go client build js client build go sdk
AI-native microservices platform. v0.8.2.

"Works of art make rules; rules do not make works of art."
— Claude Debussy

Overview

1Backend reimagines software development for the AI era. It lets you build modern distributed applications fast, without getting slowed down by infrastructure in the early stages. It’s a full platform: a framework, a proxy (edge, reverse, and more), and much more. It manages authorization and user accounts, microservice communication, microfrontend routing, email delivery, and many other core parts of modern app development.

It can run and program LLMs inside containers. It’s zero-trust, zero-config, and includes its own ORM, allowing development even without a database.

It’s multitenant—host multiple apps, websites, or projects on one installation. In effect, it serves as a distributed operating system for your applications.

Launching the server

Easiest way to run 1Backend is with Docker. Install Docker if you don't have it. Step into repo root and:

docker compose up

Also see this page for other ways to launch 1Backend.

Build and use your first service in 3 steps

Check out the examples folder or the relevant documentation to learn how to easily build testable, scalable microservices on 1Backend.

Here are the conceptual steps though to illustrate how simple is a 1Backend service:

Step 1: Register the user account of your service

Each service - just like humans - must have their account and manage their own credentials. Just like humans, they must remember their passwords :)).

Language-agnostic

See the Register and Login endpoints.

Go SDK example

import (
  "github.com/1backend/1backend/sdk/go/boot"
  "github.com/1backend/1backend/sdk/go/client"
)

oneBackendClient  := client.NewApiClientFactory(service.Options.ServerUrl).Client()
token, err := boot.RegisterServiceAccount(
		oneBackendClient .UserSvcAPI,
		"your-svc",
		"Your Service",
		credentialStore, // This is just a DB handle
	)

Step 2: Register your service instance address

Language-agnostic

Call RegisterInstance endpoint directly from any programming language.

Go SDK example

import (
  "github.com/1backend/1backend/sdk/go/client"
)

oneBackendClient := client.NewApiClientFactory(service.Options.ServerUrl).Client()

oneBackendClient.RegistrySvcAPI.
		RegisterInstance(context.Background()).
		Body(openapi.RegistrySvcRegisterInstanceRequest{
			Url: "https://your-service-url",
		}).Execute()

Step 3: Call your service through 1Backend

All services registered will be available under their slug at http(s)://your-1backend-host/{service-slug}/.... For more details see doc about the Proxy Svc.

CLI

Install oo to get started (at the moment you need Go to install it):

go install github.com/1backend/1backend/cli/oo@latest
$ oo env ls
ENV NAME   SELECTED   URL                           DESCRIPTION   REACHABLE
local      *          http://127.0.0.1:11337                      true
$ oo login 1backend changeme

$ oo whoami
slug: 1backend
id: usr_e9WSQYiJc9
app:
  id: app_hRKWXZzK6P
  host: unnamed
roles:
- user-svc:user
- user-svc:admin
$ oo post /prompt-svc/prompt --sync=true --prompt="Is a cat an animal? Just answer with yes or no please."
# see example response above...

Run On Your Servers

See the Running the daemon page to help you get started.

Services

For articles about the built-in services see the Built-in services page. For comprehensive API docs see the 1Backend API page.

Run On Your Laptop/PC

We have temporarily discontinued the distribution of the desktop version. Please refer to this page for alternative methods to run the software.

License

1Backend is licensed under AGPL-3.0.