{"id":22484372,"url":"https://github.com/staticbackendhq/core","last_synced_at":"2025-08-02T17:32:37.921Z","repository":{"id":37288890,"uuid":"233114712","full_name":"staticbackendhq/core","owner":"staticbackendhq","description":"Backend server API handling user mgmt, database, storage and real-time component","archived":false,"fork":false,"pushed_at":"2024-05-21T17:54:43.000Z","size":1483,"stargazers_count":678,"open_issues_count":10,"forks_count":65,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-06-18T18:34:31.056Z","etag":null,"topics":["backend-api","dbaas"],"latest_commit_sha":null,"homepage":"https://staticbackend.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staticbackendhq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dstpierre","custom":["https://paypal.me/focuscentric"]}},"created_at":"2020-01-10T19:16:38.000Z","updated_at":"2024-06-16T04:49:41.000Z","dependencies_parsed_at":"2023-02-10T23:31:20.094Z","dependency_job_id":"3f8a248b-8c7a-40a4-acba-0e739667d865","html_url":"https://github.com/staticbackendhq/core","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticbackendhq%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticbackendhq%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticbackendhq%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticbackendhq%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staticbackendhq","download_url":"https://codeload.github.com/staticbackendhq/core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228499948,"owners_count":17929978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend-api","dbaas"],"created_at":"2024-12-06T17:10:49.416Z","updated_at":"2025-08-02T17:32:37.898Z","avatar_url":"https://github.com/staticbackendhq.png","language":"Go","readme":"# \u003cimg src=\"https://staticbackend.com/img/logo-sb-no-text.png\" style=\"height: 35px\" alt=\"StaticBackend logo\" /\u003e StaticBackend\n\n![build badge](https://github.com/staticbackendhq/core/actions/workflows/go.yml/badge.svg)\n[![GoReportCard](https://goreportcard.com/badge/github.com/staticbackendhq/core)](https://goreportcard.com/report/github.com/staticbackendhq/core)\n[![Go Reference](https://pkg.go.dev/badge/github.com/staticbackendhq/core/backend.svg)](https://pkg.go.dev/github.com/staticbackendhq/core/backend)\n\u003ca href=\"https://discord.gg/vgh2PTp9ZB\"\u003e\n\t\u003cimg src=\"https://img.shields.io/discord/872035652944928838?logoColor=%23DD0000\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/staticbackend\"\u003e\n\t\u003cimg src=\"https://img.shields.io/twitter/follow/staticbackend?color=DD0000\u0026style=social\"\u003e\n\u003c/a\u003e\n\n[StaticBackend](https://staticbackend.com) is a simple backend server API that \nhelps you create web applications. It handles most of the building blocks you'll \nneed on the backend.\n\n- [x] Authentication ([docs →](https://staticbackend.com/docs))\n- [x] Account-\u003eusers management ([docs →](https://staticbackend.com/docs/users))\n- [x] Database CRUD, queries and full-text search ([docs →](https://staticbackend.com/docs/database))\n- [x] Realtime/Websockets ([docs →](https://staticbackend.com/docs/websocket))\n- [x] File storage ([docs →](https://staticbackend.com/docs/storage))\n- [x] server-side functions ([docs →](https://staticbackend.com/docs/functions))\n- [x] Schedule jobs\n- [x] Send mails/sms ([docs →](https://staticbackend.com/docs/sendmail))\n- [x] Caching ([docs →](https://staticbackend.com/docs/cache))\n- [x] Handle forms ([docs →](https://staticbackend.com/docs/forms))\n- [x] Resize images \u0026 convert URL to PDF ([docs →](https://staticbackend.com/docs/extras/))\n\n\n## Table of content\n\n* [Install](#install)\n\t* [Local development](#local-development)\n\t* [Frontend client](#frontend-client)\n\t* [Backend clients](#backend-clients)\n\t* [Go package](#go-package)\n* [Usage](#usage)\n\t* [JavaScript example](#javascript-example)\n\t* [Go client example](#go-client-example)\n\t* [Go package example](#go-package-example)\n* [Documentation](#documentation)\n* [Deployment](#deployment)\n\t* [Render](#render)\n\t* [Heroku](#heroku)\n\t* [Docker](#docker)\n* [Get support](#get-support)\n* [Contributing](#contributing)\n* [How you can help](#how-you-can-help)\n\n## Install\n\nYou'll want to install different pieces depending on what you want to build. \nHere's what you can install:\n\n### Local development\n\nOur [CLI](https://github.com/staticbackendhq/cli) includes a fully functional \ndevelopment server. You don't need to install anything else.\n\n```sh\n$ npm install -g @staticbackend/cli\n```\n\n*You may \n[install the CLI manually](https://staticbackend.com/getting-started/cli) as \nwell.*\n\nThis will install as the `backend` program. Start the development server with:\n\n```sh\n$ backend server\n```\n\nThis command creates a new application and an admin user for you. You'll \nreceive a PublicKey and a RootToken.\n\nAll HTTP request to the API requires a public key. The root token allows you \nto sign in to the dashboard for this application as the owner.\n\n### Frontend client\n\nAdd the library to your dependencies:\n\n```sh\n$ npm install @staticbackend/js\n```\n\nInside your module:\n\n```javascript\nimport { Backend } from \"@staticbackend/js\";\nconst bkn = new Backend(\"dev_memory_pk\", \"dev\");\n```\n\n**dev_memory_pk** is the default local development public key and **dev** is the \ndefault region / host for the instance you're targetting.\n\nYou may also include the library inside a `\u003cscript` tag if you're not using \na module system:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@staticbackend/js@1.5.0/dist/backend.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tconst bkn = new sb.Backend(\"dev_memory_pk\", \"dev\");\n\u003c/script\u003e\n```\n\n### Backend clients\n\nWe've pre-built backend client libraries you may use directly:\n\n**Node**:\n\n```sh\n$ npm install @staticbackend/backend\n```\n\n**Go**:\n\n```sh\n$ go get github.com/staticbackendhq/backend-go\n```\n\n[View the Go package documentation](https://pkg.go.dev/github.com/staticbackendhq/backend-go)\n\n**Python**:\n\n```sh\n$ pip install staticbackend\n```\n\n### Go package\n\nYou can import a Go package directly into your Go program and build your \napplication with the same building blocks without hosting the API separately.\n\n```sh\n$ go get github.com/staticbackendhq/core/backend\n```\n\n[View the Go package document](https://pkg.go.dev/github.com/staticbackendhq/core/backend)\n\n## Usage\n\nYou may build web and mobile applications using StaticBackend as your main \nbackend API.\n\nStaticBackend is a multi-tenant platform allowing you to host multiple isolated \napplications.\n\nYou need an instance of the backend API running via the CLI for local \ndevelopment or running as a normal process with required dependencies.\n\nYou create your first application before you can start.\n\nUsing the CLI:\n\n```sh\n$ backend server\n```\n\nUsing the source code:\n\n```sh\n$ git clone https://github.com/staticbackendhq/core\n$ cd core\n$ cp .local.env .env\n$ make start\n```\n\nVisit [http://localhost:8099](http://localhost:8099) and create an application.\n\n### Javascript example\n\n*Note that the Nodejs client library has the same API / function names as the \nJavaScript library.*\n\n```javascript\nimport { Backend } from \"@staticbackend/js\";\n\nconst bkn = new Backend(\"dev_memory_pk\", \"dev\");\n\nlet token = \"\";\n\nlogin = async () =\u003e {\n\tconst res = await bkn.register(\"email@test.com\", \"password\");\n\tif (!res.ok) {\n\t\tconsole.error(res.content);\n\t\treturn;\n\t}\n\ttoken = res.content;\n\n\tcreateTask();\n}\n\ncreateTask = async () =\u003e {\n\tconst task = {\n\t\tdesc: \"Do something for XYZ\",\n\t\tdone: false\n\t};\n\n\tconst res = bkn.create(token, \"tasks\", task);\n\tif (!res.ok) {\n\t\tconsole.error(res.content);\n\t\treturn;\n\t}\n\tconsole.log(res.content);\n}\n```\n\n### Go client example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/staticbackendhq/backend-go\"\n)\n\nfunc main() {\n\tbackend.PublicKey = \"dev_memory_pk\"\n\tbackend.Region = \"dev\"\n\n\ttoken, err := backend.Login(\"admin@dev.com\", \"devpw1234\")\n\t// no err handling in example\n\n\ttask := new(struct{\n\t\tID string `json:\"id\"`\n\t\tAccountID string `json:\"accountId\"`\n\t\tTitle string `json:\"title\"`\n\t\tDone bool `json:\"done\"`\n\t})\n\ttask.Title = \"A todo item\"\n\terr = backend.Create(token, \"tasks\", task, \u0026task)\n\t// task.ID and task.AccountID would be filled with proper values\n}\n```\n\n### Go package example\n\n```go\n// using the cache \u0026 pub/sub\nbackend.Cache.Set(\"key\", \"value\")\n\nmsg := model.Command{Type: \"chan_out\", Channel: \"#lobby\", Data: \"hello world\"}\nbackend.Cache.Publish(msg)\n\n// use the generic Collection for strongly-typed CRUD and querying\ntype Task struct {\n\tID string `json:\"id\"`\n\tTitle string `json:\"title\"`\n}\n// auth is the currently authenticated user performing the action.\n// base is the current tenant's database to execute action\n// \"tasks\" is the collection name\ntasks := backend.Collection[Task](auth, base, \"tasks\")\nnewTask, err := tasks.Create(Task{Title: \"testing\"})\n// newTask.ID is filled with the unique ID of the created task in DB\n```\n\nView a \n[full example in the doc](https://pkg.go.dev/github.com/staticbackendhq/core/backend#example-package).\n\n## Documentation\n\nWe're trying to have the best experience possible reading our documentation.\n\nPlease help us improve if you have any feedback.\n\n* [Documentation with code samples for client libraries and CURL](https://staticbackend.com/docs)\n* [Go client library package](https://pkg.go.dev/github.com/staticbackendhq/backend-go)\n* [Go importable package](https://pkg.go.dev/github.com/staticbackendhq/core/backend)\n* [Self-host guide](https://staticbackend.com/getting-started/self-hosting)\n* [Install the CLI](https://staticbackend.com/getting-started/cli)\n\n**Examples**:\n\n* [To-do list example](https://staticbackend.com/getting-started/)\n* [Realtime collaboration](https://staticbackend.com/blog/realtime-collaboration-example/)\n* [Live chat using server-side function \u0026 real-time component](https://staticbackend.com/blog/server-side-functions-task-scheduler-example/)\n* [Jamstack Bostom talk](https://www.youtube.com/watch?v=Uf-K6io9p7w)\n\n## Deployment\n\nTo deploy StaticBackend you'll need the following:\n\n* Either PostgreSQL or MongoDB\n* Redis\n\nStaticBackend is a single file binary you can run as a `systemd` daemon.\n\nHere's some quick way to deploy an instance.\n\n### Render\n\n[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)\n\n### Heroku\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/staticbackendhq/core)\n\n### Docker\n\nIf you have Docker and Docker Compose ready, here's how to run StaticBackend:\n\n```shell\n$ git clone https://github.com/staticbackendhq/core\n$ cd core\n$ cp .demo.env .env\n$ docker build . -t staticbackend:latest\n$ docker-compose -f docker-compose-demo.yml up\n```\n\nOpen a browser at [http://localhost:8099](http://localhost:8099) to create \nyour first application.\n\nFor production, you'll want to configure environment variables found in `.env` \nfile.\n\n* [Self-hosting guide](https://staticbackend.com/getting-started/self-hosting/)\n* [Video showing how to self-host](https://www.youtube.com/watch?v=vQjfaMxidx4)\n* [Detailed blog post on how to self-host](https://staticbackend.com/blog/get-started-self-hosted-version/)\n\n## Get support\n\nYou may use the following channels to get help and support.\n\n* [Discord](https://discord.gg/vgh2PTp9ZB): for any help and joining the conversation.\n* [GitHub issues](https://github.com/staticbackendhq/core/issues): To report bugs / contributing code.\n* [GitHub Discussions](https://github.com/staticbackendhq/core/discussions): For ideas, feature requests and general discussions.\n\n## Contributing\n\nIf you have any feedback (good or bad) we'd be more than happy to talk. Please \nuse the [Discussions](https://github.com/staticbackendhq/core/discussions) tab.\n\nSame for contributing. The easiest is to get in touch first. We're working \nto make it easier to contribute code. If you'd like to work on something \nprecise let us know.\n\nHere are videos made specifically for people wanting to contribute:\n\n* [Intro, setup, running tests, project structure](https://youtu.be/uTj7UEbg0p4)\n* [backend package and v1.4.1 refactor and changes](https://youtu.be/oWxk2g2yp_g)\n\nCheck the [contributing file](CONTRIBUTING.md) for details.\n\n\n## How you can help\n\nIf you're looking to help the project, here are multiple ways:\n\n* Use it and share your experiences.\n* Sponsor the development via GitHub sponsors.\n* Spread the words, a tweet, a blog post, any mention is helpful.\n* Join the [Discord](https://discord.gg/vgh2PTp9ZB) server.","funding_links":["https://github.com/sponsors/dstpierre","https://paypal.me/focuscentric"],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticbackendhq%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaticbackendhq%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticbackendhq%2Fcore/lists"}