Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrsarm/backset
"bss" is a REST service to store elements, sets, and relationships between them (in progress).
https://github.com/mrsarm/backset
Last synced: about 1 month ago
JSON representation
"bss" is a REST service to store elements, sets, and relationships between them (in progress).
- Host: GitHub
- URL: https://github.com/mrsarm/backset
- Owner: mrsarm
- License: apache-2.0
- Created: 2023-03-20T22:28:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-22T18:20:48.000Z (4 months ago)
- Last Synced: 2024-10-03T16:31:05.669Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 568 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backset Service
> ### 🚧 Work in progress, just a few endpoints implemented.
Backset Service, or `bss`, it's a REST service to store elements, sets,
and relationships between them.All objects are stored within a "tenant", and the tenant id is at
the beginning of all request URIs to identify to which tenant the
object belongs to.### 🔋 Features
- Rest API with [Actix](https://github.com/actix/actix) and **Rust** 🦀.
- Storage in **Postgres** with [SQLx](https://github.com/launchbadge/sqlx).
- SQL migrations.
- Configuration through environment variables.
- Logging configured with settings examples in the source.
- Tests and CI pipeline with GitHub Actions.
- Model driven design.
- Good serialization and error management:
- It uses the crates: [Serde](https://serde.rs/), [validator](https://github.com/Keats/validator),
[actix-web-validator](https://github.com/rambler-digital-solutions/actix-web-validator), [serde_valid](https://github.com/yassun7010/serde_valid) and
[actix-contrib-rest](https://github.com/mrsarm/rust-actix-contrib-rest).
- Dockerized, ready to use for development or production envs.### 🛠 Installation & Getting Started
You need Rust and Postgres to build and launch the app. Here are some shortcuts,
for more options see the [Installation](docs/installation.md) page.```shell
# Install SQLx
cargo install sqlx-cli --no-default-features --features native-tls,postgres# Create a .env file (edit SQL connection and whatever)
cp .env.example .env# Run Postgres, you can do so with Docker Compose
docker compose up postgres -d# Create database
sqlx database create
# ^ replace "create" with drop to delete the DB# Migrate
sqlx migrate run# Run the server (and compile if needed)
cargo run -- run
# `cargo test' to run the tests# Check is alive with
curl localhost:8558/# This command run backset in "command" mode, listing all tenants within the terminal
cargo run -- list tenants# If you have already installed the binary with `make release && sudo make install',
# you can use the binary as follow to run the server:
backset run# List tenants
backset list tenants
```### 🐴 Endpoints usage
List of endpoints with usage samples: [API](docs/api.md).
### 🐳 Docker
Dockerfile and compose files are provided, check-out the [Docker](docs/docker.md) page.
### TO-DOs
Missing:
- [x] "/tenants" model and endpoints
- [ ] "/elements" model and endpoints
- [ ] Configurable validations and behaviour, e.g. ids validation
- [ ] "/sets" model and endpointsMore stuff to add:
- [ ] Some sort of authorization.
- [ ] Random PKs configurable.
- [ ] Use Postgres from GH Action matrix to speed up CI.
- [ ] `/health?db=true&timeout=MILLIS`
and `backset health --db --timeout MILLIS` to check DB connection as well.
- [ ] The DB check could be in a new method `AppState::check_conn(Option)`.### About
**Project Home**: https://github.com/mrsarm/backset.
**Author**: Mariano Ruiz (mrsarm at gmail.com).
**License**: (2023) [Apache Software License 2.0](https://www.apache.org/licenses/LICENSE-2.0).