- Rust 99.2%
- SCSS 0.8%
| src | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| bento.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Bento
A lightweight, secure backend as a service (BaaS) built with Rust.
Overview
Bento provides a robust API for user authentication, database features, file storage, and message passing. It's designed to be integrated into your application stack with minimal setup, offering secure and convenient authentication/storage/messaging primitives out of the box.
Key Features
- User Registration & Authentication: Secure account creation and login flows
- Session Management: Sessions with unique IDs automatic expiration
- Role-Based Access Control: Simple user/admin permission system
- Database Features (SQL & Non-SQL): Upcoming
- File Storage: Upcoming
- Message Passing: Upcoming
Frontend & API
Bento ships with a Leptos frontend by default, providing a full-stack solution out of the box. Leptos is a Rust web framework that offers fine-grained reactivity and server-side rendering, making for a performant and well-integrated default.
For developers who want to build custom frontends (React, Vue, mobile apps, etc.), the REST API can be exposed by enabling the rest-api feature flag:
cargo leptos watch --features rest-api
(or similar for other commands, such as build)
API Endpoints (when rest-api feature is enabled)
POST /api/v1/register- Create a new user account (needs admin privileges)POST /api/v1/login- Authenticate and receive a session token
Getting Started
To run this server, either run the binary or download the source and run the following:
# Install cargo leptos if you haven't already
cargo install --locked cargo-leptos
# Run the server (SSR)
cargo leptos watch
This runs a dev server with hot reloading. To build an optimized production build, run:
cargo leptos build --release
Tech Stack (Credits)
Bento is built in Rust. This is mostly because I simply prefer the language, but also comes with advantages such as performant, native code and memory/type safety.
This project would not be possible without the following awesome open-source projects:
- The Rust Programming Language
- Axum (web server framework)
- Leptos (frontend framework)
- redb (embedded data store)
- Tailwind CSS (self-explanatory?)