Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
README and CHANGELOG update, preparing v1.2.0 close #3, close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
dstpierre committed Feb 19, 2022
1 parent 7f6d24c commit c8ce469
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 28 deletions.
11 changes: 9 additions & 2 deletions .demo.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
APP_ENV=dev
DATABASE_URL=mongodb://mongo:27017
DATA_STORE=mongo

# For PostgreSQL
DATABASE_URL=host=db user=postgres password=postgres dbname=postgres sslmode=disable
DATA_STORE=pg

# For MongoDB
# DATABASE_URL=mongodb://mongo:27017
# DATA_STORE=mongo

JWT_SECRET=changeMe
MAIL_PROVIDER=dev
STORAGE_PROVIDER=local
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Test (Mongo data store)
run: make alltest

- name: Change DATA_STORAGE to PostgreSQL
run: sed -i 's/DATA_STORAGE=mongo/DATA_STORAGE=pg/g' .env
- name: Change DATA_STORE to PostgreSQL
run: sed -i 's/DATA_STORE=mongo/DATA_STORE=pg/g' .env

- name: Change DATABASE_URL to PG connection string
run: sed -i 's/DATABASE_URL=mongodb:\/\/localhost:27017/DATABASE_URL=user=postgres password=postgres dbname=postgres sslmode=disable/g' .env
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog for StaticBackend

### Feb 19, 2022 v1.2.0

* Created a data persistance interface to support different data store.
* Added support for PostgreSQL.
* Database tests for PostgreSQL and MongoDB.
* Default Docker Compose for demo use PostgreSQL.

### Jan 1, 2022

* Added atomic worker queue

### Nov 17, 2021

* Added graceful shutdown

### Oct 31, 2021 v1.1.0

* Added reset password flow and made the reset code generation avail from backend.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test-mdb:
test-intl:
@JWT_SECRET=okdevmode go test --race --cover ./internal

docker:
docker: build
docker build . -t staticbackend:latest

pkg: build
Expand Down
43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
**JAMstack Boston talk**: I'm gonna give a talk on Nov 23rd @ 6pm EST on
StaticBackend. If you're interested: https://www.meetup.com/JAMstack-Boston/events/281827534/


<p align="center">
<img src="https://staticbackend.com/img/logo-sb-no-text.png" alt="StaticBackend logo">
<br />
Expand All @@ -17,8 +13,9 @@ StaticBackend. If you're interested: https://www.meetup.com/JAMstack-Boston/even
# StaticBackend - simple backend for your apps

[StaticBackend](https://staticbackend.com) is a simple backend that handles
user management, database, file storage, forms, and real-time experiences via
channel/topic-based communication for web and mobile applications.
user management, database, file storage, forms, real-time experiences via
channel/topic-based communication, and server-side functions 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.
Expand Down Expand Up @@ -46,12 +43,15 @@ a good fit.

I'm personally using it to build SaaS:

* [Vivid - Automatic video clips for podcasts](https://vivid.fm)
* [Tangara - one page checkout for creators](https://tangara.io)

It can be used from client-side and/or server-side.

## How it works / dev workflow

The main idea is that StaticBackend is your backend API for your frontend apps.
A performant free and open-source Firebase alternative.
A performant free and open-source self-hosted Firebase alternative.

_Note that it can also be used from your backend code as well._

Expand All @@ -78,7 +78,7 @@ login = async () => {
console.error(res.content);
return;
}
token = res.content();
token = res.content;

createTask();
}
Expand Down Expand Up @@ -114,7 +114,9 @@ From there you build your application using the
the [real-time component](https://staticbackend.com/docs/websocket/),
the [storage API](https://staticbackend.com/docs/storage/), etc.

You may use server-side libraries for Node and Go or use an HTTP client
StaticBackend provides commonly used building blocks for web applications.

You may use server-side libraries for Node, Python and Go or use an HTTP client
and use your preferred language.

## Get started with the self-hosted version
Expand All @@ -128,7 +130,7 @@ Please refer to this [guide here](https://staticbackend.com/getting-started/self

We also have this
[blog post](https://staticbackend.com/blog/get-started-self-hosted-version/)
that also includes the above video.
that includes the above video.

If you have Docker & Docker Compose ready, here's how you can have your server
up and running in dev mode in 30 seconds:
Expand Down Expand Up @@ -167,7 +169,8 @@ This is normal, as you're trying to request protected API, but you're all set.
The next step is to visit [http://localhost:8099](http://localhost:8099) and
create your first app. Please note that in dev mode you'll have to look at your
docker compose output terminal to see the content of the email after creating
your app.
your app. This email contains all the keys and your super user account
information.

## Documentation

Expand All @@ -182,17 +185,22 @@ Please help us improve if you have any feedback.
* [Database](https://staticbackend.com/docs/database/)
* [Real-time communication](https://staticbackend.com/docs/websocket/)
* [File storage](https://staticbackend.com/docs/storage/)
* [Server-side functions](https://staticbackend.com/docs/functions/)
* [Send emails](https://staticbackend.com/docs/sendmail/)
* [Caching](https://staticbackend.com/docs/cache/)
*
* [Forms](https://staticbackend.com/docs/forms/)
* [Root token](https://staticbackend.com/docs/root-token/)

## Librairies & CLI

We [provide a CLI](https://staticbackend.com/getting-started/) for local
development if you want to get things started without any infrastructure and
for prototyping.
for prototyping / testing. Please note the dev server has a very limited
functionalities compares to the full self-hosted version.

You can use the CLI to manage your database and form submission. This is the
only interface we currently have to interact with your database, other than via
code. There will be a web UI available before v1.0 is released.
You can use the CLI to manage your database, form submissions, and deploy
server-side-functions. We have an alpha Web UI as well to manage your resources.

We have a page listing our
[client-side and server-side libraries](https://staticbackend.com/docs/libraries/).
Expand All @@ -207,12 +215,13 @@ Here's the examples we have created so far:
* [To-do list example](https://staticbackend.com/getting-started/)
* [Realtime collaboration](https://staticbackend.com/blog/realtime-collaboration-example/)
* [Live chat using server-side function & real-time component](https://staticbackend.com/blog/server-side-functions-task-scheduler-example/)
* [Jamstack Bostom talk](https://www.youtube.com/watch?v=Uf-K6io9p7w)

## Deploying in production

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.
core` built into a binary and have access to either PostgreSQL or 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.

Expand Down
29 changes: 23 additions & 6 deletions docker-compose-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,31 @@ services:
ports:
- "8099:8099"
env_file:
- ./.demo.env
- .env
depends_on:
- "db"
# - "redis"

mongo:
image: mongo:3-stretch
volumes:
- ./mongodata:/data/db/mongo
# For PostgreSQL
db:
image: postgres
restart: always
ports:
- "27017:27017"
- 5432:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ../postgres-data:/var/lib/postgresql/data
- ./sql/0001_bootstrap_db.sql:/docker-entrypoint-initdb.d/create_tables.sql

# For MongoDB
#mongo:
# image: mongo:3-stretch
# volumes:
# - ./mongodata:/data/db/mongo
# ports:
# - "27017:27017"

redis:
image: "redis:alpine"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3"

services:

db:
image: postgres
restart: always
Expand Down

0 comments on commit c8ce469

Please sign in to comment.