A lightweight, secure backend as a service (BaaS) built with Rust.
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.
- 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
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)
POST /api/v1/register- Create a new user account (needs admin privileges)POST /api/v1/login- Authenticate and receive a session token
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 watchThis runs a dev server with hot reloading. To build an optimized production build, run:
cargo leptos build --releaseBento 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?)