Skip to content

AarambhDevHub/workspace-kit-ignitia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧰 Workspace Kit - Production-Ready Backend in Rust (Ignitia Framework)

  • βœ… 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.

Rust PostgreSQL

πŸ’‘ What You Get

  • βœ… 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
  • βœ… .env setup & project ready to run locally
  • βœ… Built on Ignitia - High-performance web framework

πŸ“¦ Folder Structure

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

πŸš€ How to Run the Project

1. Clone or Unzip the Project

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.

2. Setup Your Environment

The project includes a pre-filled .env.example file.

Steps:

  1. Duplicate .env.example and rename it to .env:

    cp .env.example .env
    
  2. Update the following fields in .env:

    Key Description
    DATABASE_URL Your PostgreSQL connection string (e.g. postgres://user:password@localhost/workspace_db)
    SMTP_SERVER Your SMTP server (e.g. smtp.gmail.com)
    SMTP_PORT SMTP port (e.g. 587)
    SMTP_USERNAME Your email address or SMTP username
    SMTP_PASSWORD Your email app password or SMTP password
    SMTP_FROM_ADDRESS The name or address the emails will come from
    JWT_SECRET_KEY A secure random string used to sign tokens
    SERVER_HOST Server host (default: 127.0.0.1)
    SERVER_PORT Server port (default: 8080)

3. Install Dependencies

Ensure Rust is installed (1.70 or higher). Then:

cargo build

4. Setup PostgreSQL Database

# Create database
createdb workspace_db

# Or using psql
psql -U postgres
CREATE DATABASE workspace_db;
\q

5. Run Migrations

If you're using SQLx, install the CLI:

cargo install sqlx-cli --no-default-features --features postgres
sqlx database create
sqlx migrate run

6. Start the Server

cargo run --release

The server will start at http://127.0.0.1:8080

πŸ“¬ Postman API Collection

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/register
  • POST /api/auth/login
  • GET /api/user/me
  • POST /api/workspace/create
  • GET /api/workspace/list
  • POST /api/role/create
  • POST /api/permission/assign
  • and more...

πŸ›‘οΈ Tech Stack

  • 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

πŸ—οΈ Architecture

Layered Architecture

Request β†’ Middleware (JWT Auth) β†’ Handler β†’ Service Layer β†’ Database β†’ Response

Key Components

  1. Handlers: Process HTTP requests and responses
  2. Middleware: JWT authentication and permission checking
  3. Services: Business logic layer
  4. Database: Data persistence with SQLx
  5. Utils: Helper functions (hashing, tokens, validation)
  6. DTOs: Data Transfer Objects for API contracts

Permission System

// 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";

πŸ”’ Security Features

  • βœ… 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

πŸ“ˆ Use Case Ideas

  • πŸš€ 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

πŸ› Troubleshooting

Database Connection Issues

# Check PostgreSQL is running
pg_isready

# Test connection
psql -U postgres -d workspace_db

JWT Token Issues

  • Ensure JWT_SECRET_KEY is set in .env
  • Check token expiration settings
  • Verify Authorization header format: Bearer <token>

Email Not Sending

  • Verify SMTP credentials in .env
  • Check firewall/port settings
  • Enable "Less secure app access" for Gmail (or use App Passwords)

Port Already in Use

# Change SERVER_PORT in .env file
SERVER_PORT=8081

πŸ“¦ Dependencies

[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"] }

πŸš€ Deployment

Docker Deployment

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"]

Environment Variables for Production

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

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ž Support

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!

πŸ“œ License

MIT License - See LICENSE for details.

πŸ™ Thank You

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! πŸš€

πŸ“š Related Projects


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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published