
Celeris Realtime
A public-beta, binary-first WebSocket platform built in Rust for high-throughput pub/sub across multiple nodes and regions.
Production-ready Actix Web API template with RBAC auth, PostgreSQL via SeaORM, Kafka-powered email, and a full Docker dev setup.
A robust template for building secure, scalable REST APIs in Rust using Actix Web. Includes token-based auth with roles/permissions, email verification via OTP, background jobs, and observability. Docker Compose spins up PostgreSQL, Kafka, and Kafka UI for a smooth local dev flow.
For detailed documentation, visit the GitHub repository: https://github.com/dev-davexoyinbo/actix-web-starter-template
.env.example to .env and set valuesmake up-devmake migratemake run → http://localhost:9000For full setup, API docs, seeded users, and access control examples, see the GitHub README.
use actix_web::{web, HttpResponse};
use crate::middlewares::auth_middleware::{AccessControl, AccessControlCondition};
pub fn config(cfg: &mut web::ServiceConfig) {
cfg
// Simple role check
.route("/api/admin", web::get().to(|| async { HttpResponse::Ok().finish() }))
.wrap(AccessControl::Role("admin".to_string()).into_middleware())
// Role AND permission
.route("/api/editor-blog", web::post().to(|| async { HttpResponse::Ok().finish() }))
.wrap(
AccessControlCondition::all()
.add(AccessControl::Role("editor".to_string()))
.add(AccessControl::Permission("blog:write".to_string()))
.into_middleware(),
);
}
use actix_web::{web, middleware::from_fn};
pub fn routes(cfg: &mut web::ServiceConfig) {
cfg.route("/api/verified-only", web::get().to(|| async { "ok" }))
.wrap(from_fn(crate::middlewares::auth_middleware::require_email_verification));
}
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "users")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub name: String,
pub email: String,
pub password_hash: String,
pub email_verified_at: Option<DateTimeWithTimeZone>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}
use messaging::{AppMessageTopic, AppMessageWrapper, EmailMessage, VerifyEmailTemplate};
use crate::globals;
pub async fn send_verification_email(name: &str, email: &str, otp: &str) -> Result<(), anyhow::Error> {
let messaging = globals::messaging::get()?;
let app = common::app_config::get()?;
let msg = AppMessageWrapper {
key: None,
topic: AppMessageTopic::GeneralEmail,
message: EmailMessage {
from: format!("{} <{}>", app.app.name, app.messaging.default_email_from),
to: format!("{} <{}>", name, email),
reply_to: None,
subject: "Verify your email".into(),
template: VerifyEmailTemplate { name: name.into(), otp: otp.into() }.into(),
}.into(),
};
messaging.read().await.send_message(msg).await?;
Ok(())
}
# Login (use seeded users; see README for emails/passwords)
curl -X POST http://localhost:9000/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@email.com","password":"<ADMIN_PASSWORD>"}'
For full examples and more snippets, see the README: https://github.com/dev-davexoyinbo/actix-web-starter-template

A public-beta, binary-first WebSocket platform built in Rust for high-throughput pub/sub across multiple nodes and regions.

Framework-agnostic RBAC library for Rust with composable AccessPolicy rules and plug-and-play middleware for actix-web and tower/axum.

A Rust toolkit of distributed systems primitives backed by Redis. Strict and lax counters, instance-aware counters with automatic dead-instance cleanup, distributed locks (Mutex and RwLock), and sliding-window rate limiting.
Available for senior engineering roles, consulting, and architecture reviews.