March 6, 2022
There isn’t a much quicker way to get started than a one-click deploy button. Those buttons take care of everything for you. You can start using your self-hosted StaticBackend instance in 30 seconds.
A Heroku or Render account. That’s the only requirement.
Go to the GitHub repository README and click on the Deploy to Heroku or Deploy to Render button.
StaticBackend is now defaulting to PostgreSQL as its database engine. As a result, an instance of PostgreSQL will be created and linked to the app.
Another required dependency is Redis. A Redis instance will be provided and linked to the backend.
That’s it! The last remaining piece is the backend API itself, a Go web application. Both providers supports Go natively.
Once everything is ready, you’ll need to configure some aspects for everything to work correctly.
To create your first application, navigate to the web URL of your application.
Before entering your email, open the log streamer to view StaticBackend’s
stdin output to grab your credentials.
On Heroku, you can access the logs via the top-right More button and the “View Logs” option.
On Render, you can access logs via the Logs menu option in the left menu bar.
When you see the logs, return to your browser and create your application by entering your email (any email will do, no actual emails are sent).
You’ll need the credentials printed on the terminal from your application. Save them for later.
Since you have your
SB_PUBLIC_KEY and your
ROOT_TOKEN, you’re all set to
start issuing requests to your instance.
If you want to use the storage feature, you’ll need to provide your Amazon S3 credentials via new environment variables. Here are the variables you’ll need to create:
Please note that by default the local storage implementation is set but this uses the /tmp directory and get deleted after a restart.
STORAGE_PROVIDER=s3 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 AWS_REGION=us-east-1 AWS_S3_BUCKET=your.bucketname.here AWS_CDN_URL=https://your.cdnurlhere.com
To be able to send emails, you’ll need to provide the above AWS credentials and
set the email provider variable to
MAIL_PROVIDER=ses FROM_EMAILemail@example.com FROM_NAME=your-name 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 AWS_REGION=us-east-1 AWS_S3_BUCKET=your.bucketname.here AWS_CDN_URL=https://your.cdnurlhere.com
_Please note that only two email providers are available at this time of
ses. Feel free to look at the
self-hosting documentation to find if there
are new providers available.
That’s it! You’re all set up and ready to host an infinite number of apps on your self-hosted StaticBackend instance.
© 2021 Focus Centric Inc. All rights reserved.