•
8 min read
ManageX
Under Development
  • Python
  • FastAPI
  • SQLAlchemy
  • Pydantic
  • PostgreSQL
  • Alembic
  • Next.js
  • Supabase Realtime

A modular, multi-tenant management platform with fine-grained RBAC and realtime collaboration.

Built to explore the architecture behind real-world organization-based management systems.

🚧 Under active development

What is ManageX?

ManageX is a management platform designed around organizations, members, roles, permissions, and modular features.

Users can belong to multiple organizations, each organization can define its own roles and access rules, and individual module instances can have their own permissions.

The project is intentionally being built beyond a basic CRUD application, with a focus on:

  • Multi-tenant architecture
  • Fine-grained authorization
  • Modular feature design
  • Relational database modeling
  • REST API architecture
  • Realtime collaboration
  • Scalable backend design

ManageX is currently under construction, with the backend architecture being developed before the platform’s larger management modules are added.

Architecture

ManageX is organized around several interconnected domains:

DomainResponsibility
πŸ‘€ IdentityUsers and authentication
🏒 OrganizationsOrganizations and their members
🎭 RolesOrganization-specific roles
πŸ” PermissionsSystem and instance-level authorization
🧩 ModulesReusable module instances
βœ‰οΈ InvitationsOrganization membership invitations
⚑ RealtimePresence, broadcasts, and live activity

Data model

                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                           β”‚     User     β”‚
                           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                                  β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚ OrganizationUser   β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚    Organization     β”‚
                      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                             β”‚         β”‚
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         └─────────────┐
                   β–Ό                                 β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Role   β”‚                   β”‚ ModuleInstance β”‚
              β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚                                  β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”                         β–Ό
          β–Ό                 β–Ό                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚InstancePermissionβ”‚
β”‚SystemPermission  β”‚ β”‚RoleSystemPerm.   β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
          β–²                                           β–Ό
          β”‚                                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                                  β”‚RoleInstancePerm. β”‚
          β”‚                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚                    β”‚
   β–Ό                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   System     β”‚  β”‚    Instance     β”‚
β”‚   Override   β”‚  β”‚    Override     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Authorization

Authorization is one of the core parts of ManageX.

Rather than relying on a fixed set of hard-coded roles, organizations can define their own roles and assign permissions to them.

System permissions

System permissions control organization-wide features.

organization.view
organization.edit

role.view
role.create
role.edit
role.delete

member.view
member.invite
member.remove

Instance permissions

Some modules can exist as multiple independent instances within an organization.

For example:

Inventory #1
β”œβ”€β”€ view
β”œβ”€β”€ create
β”œβ”€β”€ edit
└── delete

Inventory #2
β”œβ”€β”€ view
└── edit

This allows access to be controlled at the individual module-instance level, rather than only at the module level.

Permission overrides

Roles provide the normal permission set for a user, but individual users can also receive explicit permission overrides.

Role
 β”‚
 β”œβ”€β”€ System permissions
 β”‚
 └── Instance permissions
          β”‚
          β–Ό
    User-specific
      overrides
       β”œβ”€β”€ allow
       └── deny

This makes it possible to handle cases such as:

A Manager can edit inventory, but a particular Manager can be denied access to one specific inventory instance.

Realtime collaboration

Realtime collaboration is planned as part of the platform.

The goal is to allow users working inside the same module instance to see each other’s presence and activity.

For example:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Inventory                       β”‚
β”‚                                 β”‚
β”‚  πŸ‘€ Ashim     πŸ‘€ Bob            β”‚
β”‚  ● viewing    ● editing         β”‚
β”‚                                 β”‚
β”‚  2 people currently here        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Planned realtime functionality includes:

  • πŸ‘₯ User presence
  • 🟒 Join/leave events
  • ⌨️ Activity and typing indicators
  • πŸ“‘ Broadcast events
  • πŸ”„ Live updates
  • 🧩 Module-instance-specific channels

Realtime architecture

The planned deployment architecture separates application authority from realtime communication.

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚     Next.js     β”‚
                         β”‚    Frontend     β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                           β”‚
                  REST                       Realtime
                    β”‚                           β”‚
                    β–Ό                           β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚     FastAPI     β”‚        β”‚    Supabase     β”‚
           β”‚                 β”‚        β”‚    Realtime     β”‚
           β”‚ Authentication  β”‚        β”‚                 β”‚
           β”‚ Authorization   β”‚        β”‚ Presence        β”‚
           β”‚ Business Logic  β”‚        β”‚ Broadcasts      β”‚
           β”‚ REST API        β”‚        β”‚ Activity        β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚   PostgreSQL    β”‚
           β”‚    Supabase     β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

FastAPI remains the authority.

Supabase Realtime is only intended to provide realtime communication such as presence and broadcasts.

Authentication, authorization, permissions, and business rules remain under the control of the FastAPI backend.

Realtime clients are never treated as an authority for determining whether an operation is allowed.

Database models

ManageX currently contains 12 interconnected SQLAlchemy models covering identity, organizations, roles, permissions, modules, and authorization relationships.

User

ColumnTypeConstraints
idintPK
emailstrunique, indexed
usernamestrunique, indexed
first_namestr
middle_namestrNone
last_namestr
password_hashstr
is_activebooldefault True

Organization

ColumnTypeConstraints
idintPK
namestrnot null
owner_idintFK β†’ users.id

OrganizationUser

ColumnTypeConstraints
idintPK
user_idintFK β†’ users.id
organization_idintFK β†’ organizations.id
date_joineddatetime
role_idintNone
is_activebooldefault True

Unique constraint:

(user_id, organization_id)

Invite

Handles organization membership invitations.

organization_id
user_identifier
invited_by
status
created_at

Supported states:

pending
accepted
rejected
seen

Role

Roles belong to an organization.

id
name
organization_id

Role names are unique within an organization.

SystemPermission

Defines organization-wide permissions.

id
feature
action

Examples:

role.create
role.delete
member.invite
organization.edit

RoleSystemPermission

Association table between roles and system permissions.

role_id
system_permission_id

Uses a composite primary key.

ModuleInstance

Represents an individual instance of a module inside an organization.

id
name
template
organization_id

InstancePermission

Defines permissions available for a particular module instance.

id
instance_id
action

RoleInstancePermission

Association table between roles and instance permissions.

role_id
instance_permission_id

Uses a composite primary key.

SystemPermissionOverride

Allows individual users to override system-level permissions.

id
user_id
permission_id
effect

InstancePermissionOverride

Allows individual users to override permissions for specific module instances.

id
user_id
instance_permission_id
effect

Current progress

  • User authentication
  • Organization creation
  • Organization membership
  • Organization invitations
  • Custom organization roles
  • System permissions
  • Module instances
  • Instance-level permissions
  • User permission overrides
  • Database migrations with Alembic
  • REST API
  • Complete permission enforcement
  • Management modules
  • Realtime user presence
  • Realtime broadcasts
  • Live activity indicators
  • Frontend
  • Automated tests
  • Production deployment

Roadmap

Foundation
    β”‚
    β”œβ”€β”€ Authentication ──────────────── βœ“
    β”œβ”€β”€ Organizations ──────────────── βœ“
    β”œβ”€β”€ Membership ─────────────────── βœ“
    └── Invitations ────────────────── βœ“
    β”‚
    β–Ό
Authorization
    β”‚
    β”œβ”€β”€ Roles ──────────────────────── βœ“
    β”œβ”€β”€ System permissions ─────────── βœ“
    β”œβ”€β”€ Instance permissions ───────── βœ“
    β”œβ”€β”€ Permission overrides ───────── βœ“
    └── Permission enforcement ─────── 🚧
    β”‚
    β–Ό
Modules
    β”‚
    β”œβ”€β”€ Module architecture ────────── 🚧
    β”œβ”€β”€ Management features ────────── πŸ“‹
    └── Module workflows ───────────── πŸ“‹
    β”‚
    β–Ό
Realtime
    β”‚
    β”œβ”€β”€ Supabase Realtime ──────────── πŸ“‹
    β”œβ”€β”€ User presence ──────────────── πŸ“‹
    β”œβ”€β”€ Broadcast events ───────────── πŸ“‹
    └── Activity indicators ────────── πŸ“‹
    β”‚
    β–Ό
Platform
    β”‚
    β”œβ”€β”€ Frontend ───────────────────── πŸ“‹
    β”œβ”€β”€ Testing ────────────────────── πŸ“‹
    └── Production deployment ─────── πŸ“‹

Legend: βœ“ Complete Β· 🚧 In progress Β· πŸ“‹ Planned

Project goals

ManageX is being built as a large-scale portfolio project to explore the architectural problems that appear in real-world management platforms.

The main goals are:

  • Build a proper multi-tenant architecture
  • Implement fine-grained RBAC
  • Support instance-level authorization
  • Explore user-specific permission overrides
  • Build modular management features
  • Design a relational database around real application requirements
  • Build and maintain a REST API
  • Explore realtime collaboration
  • Learn production-oriented deployment architecture

The project is still under construction, and the architecture will continue to evolve as new requirements are introduced.