StaticBackend is a simple backend that handles user management, database, file storage, and real-time experiences via channel/topic-based communication for web and mobile applications.
You can think of it as a lightweight Firebase replacement you may self-host. No vendor lock-in, and your data stays in your control. You may contribute to the product.
We've decided to open the core of the product and have a permissive license with the MIT license.
We provide a CLI for local development if you want to get things started without any infrastructure and for prototyping.
You'll need docker (or access to a MongoDB and Redis instances).
- Clone this repository
$> git clone [email protected]/staticbackendhq/core.git
- In a terminal start the docker services
$> docker-compuse up
- Create a file named
.env
with the following environment variables:
APP_ENV=dev
DATABASE_URL=localhost
[email protected]
FROM_NAME=your-name
JWT_SECRET=something-here
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_SECRET_KEY=your-aws-key
AWS_SES_ENDPOINT=https://email.us-east-1.amazonaws.com
- Compile and run the API server
$> make start
You have multiple options to use the backend:
- You may use our server-side client libraries (currently Go and Node)
- From your client-side applications using our JavaScript library
- You may use your own HTTP client
To start using the backend you'll need to create an account on your local instance.
You'll need to install our CLI and have it running in local mode so it will talk to your local backend instance.
$> backend account create [email protected]
Make sure you use a real domain and make sure you're all set sending email via your AWS account.
In dev
mode emails are printed to the stdout so you will see the account
information for your new database account.
Once you have those info you're ready to start calling the API from client-side or server-side application.
Refer to our main documentation for more information.
We've not written anything yet regarding deploying, but once you have the
core
built into a binary and have access to MongoDB and Redis in production you
should be able to deploy it like any other Go server.
We'll have documentation and an example soon for deploying to DigitalOcean.
This is still pre-v1 and API might change. All contributions highly appreciated, please make sure to discuss before starting anything.
We've the following features in the pipeline:
- ~Serverless function would enable having some backend functions directly runnable from the backend server.
- Message Queueing system (this is related to having custom function running first)
- Try to make StaticBackend as useful as possible aka listening to feedback