- β Complete Authentication & Authorization System
- β Modular Architecture for Workspaces, Roles, Permissions
- β Built with Rust & Ignitia β Secure, Performant, Scalable
Welcome to the Workspace Kit, a commercial-ready backend API template designed for building SaaS platforms, collaboration tools, and role-based management systems. This project is crafted with best practices in Rust and uses the Ignitia web framework, making it highly reliable, secure, and easy to maintain.
- β Fully working backend API
- β Clean, production-grade codebase in Rust
- β JWT-based authentication system
- β Role-based access control (RBAC)
- β Workspace creation & user invitation logic
- β Password reset, email change & verification
- β Full Postman collection for API testing
- β
.envsetup & project ready to run locally - β Built on Ignitia - High-performance web framework
workspace-kit/
β
βββ src/
β βββ config/ # App & environment configuration
β βββ database/ # Database operations & connection pool
β βββ dtos/ # Data Transfer Objects for API responses
β βββ handlers/ # Auth, User & Workspace API Handlers
β βββ mail/ # Email sending & verification
β βββ middleware/ # Authentication Middleware with User role & Permission
β βββ utils/ # Token handling, password hashing, etc.
β βββ constants.rs # All Permission constants
β βββ routes.rs # All API routes
β βββ error.rs # Error handling
β βββ models.rs # Database models
β βββ main.rs # App entrypoint
βββ migrations/ # SQL migration files
βββ .env # Environment variables
βββ .env.example # Example environment configuration
βββ .gitignore # Git ignore file
βββ Cargo.toml # Rust project manifest
βββ LICENSE # License file
βββ README.md # Project documentation
git clone https://github.com/AarambhDevHub/workspace-kit-ignitia.git
cd workspace-kit-ignitia
Or extract the workspace-kit-ignitia.zip file you received after purchase.
The project includes a pre-filled .env.example file.
-
Duplicate
.env.exampleand rename it to.env:cp .env.example .env -
Update the following fields in
.env:Key Description DATABASE_URLYour PostgreSQL connection string (e.g. postgres://user:password@localhost/workspace_db)SMTP_SERVERYour SMTP server (e.g. smtp.gmail.com)SMTP_PORTSMTP port (e.g. 587)SMTP_USERNAMEYour email address or SMTP username SMTP_PASSWORDYour email app password or SMTP password SMTP_FROM_ADDRESSThe name or address the emails will come from JWT_SECRET_KEYA secure random string used to sign tokens SERVER_HOSTServer host (default: 127.0.0.1)SERVER_PORTServer port (default: 8080)
Ensure Rust is installed (1.70 or higher). Then:
cargo build
# Create database
createdb workspace_db
# Or using psql
psql -U postgres
CREATE DATABASE workspace_db;
\q
If you're using SQLx, install the CLI:
cargo install sqlx-cli --no-default-features --features postgres
sqlx database create
sqlx migrate run
cargo run --release
The server will start at http://127.0.0.1:8080
A ready-to-import Postman collection is included:
π Workspace-kit.postman_collection.json
Import it into Postman and start testing endpoints like:
POST /api/auth/registerPOST /api/auth/loginGET /api/user/mePOST /api/workspace/createGET /api/workspace/listPOST /api/role/createPOST /api/permission/assign- and more...
- Framework: Ignitia - High-performance Rust web framework
- Database: PostgreSQL with SQLx
- Authentication: JWT (JSON Web Tokens)
- Password Hashing: Argon2
- Email: SMTP integration
- Architecture: Layered (handlers, services, middleware, models)
- Async Runtime: Tokio
Request β Middleware (JWT Auth) β Handler β Service Layer β Database β Response
- Handlers: Process HTTP requests and responses
- Middleware: JWT authentication and permission checking
- Services: Business logic layer
- Database: Data persistence with SQLx
- Utils: Helper functions (hashing, tokens, validation)
- DTOs: Data Transfer Objects for API contracts
// Example permission constants
pub const WORKSPACE_CREATE: &str = "workspace:create";
pub const WORKSPACE_UPDATE: &str = "workspace:update";
pub const WORKSPACE_DELETE: &str = "workspace:delete";
pub const USER_INVITE: &str = "user:invite";
pub const ROLE_MANAGE: &str = "role:manage";
- β Argon2 Password Hashing - Industry-standard password security
- β JWT Authentication - Stateless authentication with access/refresh tokens
- β Role-Based Access Control (RBAC) - Granular permission system
- β Email Verification - Secure account activation
- β Password Reset - Secure password recovery
- β SQL Injection Prevention - Parameterized queries with SQLx
- β CORS Configuration - Cross-origin request handling
- β Rate Limiting Ready - Easy to integrate with Ignitia middleware
- π Team Collaboration Platform - Slack/Discord alternative
- π Project Management Tool - Trello/Asana clone
- π’ Multi-Tenant SaaS Product - Customer management platform
- π Internal Company Dashboard - Employee portal with RBAC
- πΌ Client Management System - Agency workspace management
- π Learning Management System - Course and student management
- π₯ Healthcare Portal - Patient and provider management
# Check PostgreSQL is running
pg_isready
# Test connection
psql -U postgres -d workspace_db
- Ensure
JWT_SECRET_KEYis set in.env - Check token expiration settings
- Verify Authorization header format:
Bearer <token>
- Verify SMTP credentials in
.env - Check firewall/port settings
- Enable "Less secure app access" for Gmail (or use App Passwords)
# Change SERVER_PORT in .env file
SERVER_PORT=8081
[dependencies]
ignitia = "0.2.4"
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono"] }
argon2 = "0.5"
jsonwebtoken = "9.0"
uuid = { version = "1.0", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
dotenvy = "0.15"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
lettre = "0.11"
thiserror = "1.0"
validator = { version = "0.18", features = ["derive"] }
FROM rust:1.75 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
COPY --from=builder /app/target/release/workspace-kit /usr/local/bin/
CMD ["workspace-kit"]
DATABASE_URL=postgres://user:password@db:5432/workspace_db
JWT_SECRET_KEY=<strong-random-string>
SERVER_HOST=0.0.0.0
SERVER_PORT=8080
RUST_LOG=info
Contributions are welcome! Please feel free to submit a Pull Request.
If you need installation help, feature customization, or integration services, join our official Discord community: π https://discord.gg/HDth6PfCnp
We're here to help you get started and answer your questions!
MIT License - See LICENSE for details.
Thanks for choosing the Workspace Kit! We hope this saves you weeks of backend development time.
Built with β€οΈ using Ignitia - A blazing fast Rust web framework
Happy coding! π
- Ignitia Framework - The underlying web framework
- Ignitia Chat App - Real-time chat with WebSocket support
Note: This is a production-ready template. Customize it according to your specific business needs. For enterprise support and custom development, contact us through Discord.