AMS Docs
Docs / Core Concepts

Core Concepts

The mental models behind AMS Platform โ€” understand these concepts and everything else clicks into place.

Multi-Tenancy

AMS is a multi-tenant platform. This means a single installation of the software serves many independent organisations simultaneously, with complete data isolation between them. Think of it like an apartment building โ€” one building, many separate apartments, each with its own locks, furniture, and residents.

Each organisation on AMS is called a Tenant. When PASHA (Pakistan Association of Shipping Agents) signs up, they get their own tenant. When LCCI (Lahore Chamber of Commerce) signs up, they get their own separate tenant. Neither can see the other's data under any circumstances.

Members as Companies

Unlike consumer platforms where a "member" is an individual person, AMS is designed for B2B associations. The primary unit of membership is typically a company or organisation, not an individual.

For example, in a shipping agents association, the member is "ABC Shipping Ltd." โ€” not Ahmed Khan personally. Ahmed Khan (the CEO) is the Primary Contact for that member company. His company may also have secondary contacts (COO, GM, etc.) who can log in with limited access.

โ„น๏ธ Individual MembershipAMS also supports individual membership associations (e.g. a professional body for doctors). In this case the "company" concept is unused and the individual is the primary member directly.

Role Hierarchy

AMS uses a 5-level role hierarchy. Permissions cascade downward โ€” higher roles have all permissions of lower roles plus additional ones. Roles are assigned per-tenant; a user's role in one tenant does not affect their access in another.

RoleScopeWho It's ForKey Capabilities
๐Ÿ‘‘ Super AdminPlatform-widePlatform operator / SaaS ownerCreate/manage all tenants, system settings, billing, impersonate any user
๐Ÿ›ก๏ธ AdminTenant-wideAssociation executive director / IT adminFull control of one organisation: members, events, finance, team, settings
๐Ÿ‘” ManagerModule-levelDepartment heads, committee chairsManage specific modules assigned by Admin (e.g. Events Manager)
๐Ÿ‘ท StaffOperationalReception, data entry, event coordinatorsDay-to-day ops: member support, event check-in, data entry
๐Ÿ‘ค MemberSelf-serviceAssociation membersOwn profile, member directory, events, jobs, chat, documents
โš ๏ธ Role AssignmentOnly Admins (and above) can assign roles. A Manager cannot promote someone to Admin. Role changes take effect immediately and invalidate cached permission sets.

Tenant Isolation

Every database query in AMS is automatically scoped to the current tenant. This is enforced at the model level via a global query scope โ€” developers cannot accidentally query across tenants.

php โ€” Automatic tenant scoping
// All queries automatically include WHERE tenant_id = ?
$members = Member::where('status', 'active')->get();
// SQL: SELECT * FROM members WHERE tenant_id = 'ten_pasha' AND status = 'active'

// The tenant_id is resolved from the request automatically:
// 1. Subdomain: pasha.ams.hkus1.s4s.host โ†’ tenant_id = ten_pasha
// 2. JWT token claims contain the tenant_id
// 3. API key is scoped to a single tenant at creation time

Module System

AMS is built as a collection of Modules. Each module is an independent feature area that can be enabled or disabled per tenant. This keeps the interface clean โ€” members only see features that are active for their association.

๐Ÿ’ฌ
Chat
Real-time channels, DMs, file sharing
๐Ÿ‘ฅ
Members
Directory, profiles, import, custom fields
๐Ÿ“…
Events
Calendar, registrations, tickets
๐Ÿ’ผ
Job Board
Post, browse, apply for jobs
๐Ÿ’ณ
Finance
Invoices, dues, payments, reports
๐Ÿ“ข
Communications
Email, SMS, newsletters, blasts
๐Ÿค–
AI Copilot
Smart drafting, summaries, automation
๐Ÿ“Š
Reports
Analytics, exports, dashboards
๐Ÿ“
Documents
File library, version control

API Authentication Model

AMS uses Laravel Sanctum for API authentication. Sanctum provides two mechanisms:

Every API token is scoped to a single tenant at creation time. Tokens can be given granular abilities (e.g. members:read, events:write) to limit their scope.

bash โ€” Token Authentication
# All API requests use Bearer token authentication
curl -X GET https://pasha.ams.hkus1.s4s.host/api/v1/admin/members \
  -H "Authorization: Bearer 1|abc123defghij..." \
  -H "Accept: application/json"

Webhook Event System

AMS emits webhooks for all major lifecycle events. Webhooks are sent as POST requests to your configured endpoint with a JSON payload and an X-AMS-Signature HMAC header for verification.

EventTriggerPayload
member.createdNew member addedFull member object
member.updatedProfile changedChanged fields + member ID
member.renewedMembership renewedMember + invoice object
event.registeredMember registers for eventRegistration + event + member
invoice.paidPayment receivedInvoice + payment details
invoice.overdueInvoice past due dateInvoice + member + days overdue

Data Model Overview

The core entities in AMS and their relationships:

text โ€” Entity Relationship
Tenant (1)
  โ””โ”€โ”€ Users (many)          โ† Admin, Manager, Staff, Member accounts
  โ””โ”€โ”€ Members (many)        โ† Member companies / individuals
       โ””โ”€โ”€ Contacts (many)  โ† Primary + secondary contacts per member
       โ””โ”€โ”€ Invoices (many)  โ† Dues, event tickets, ad-hoc charges
  โ””โ”€โ”€ Events (many)
       โ””โ”€โ”€ Registrations    โ† Which members registered
       โ””โ”€โ”€ Tickets          โ† Ticket types and pricing
  โ””โ”€โ”€ JobPostings (many)
  โ””โ”€โ”€ ChatChannels (many)
       โ””โ”€โ”€ Messages (many)
  โ””โ”€โ”€ Campaigns (many)      โ† Email / SMS campaigns
  โ””โ”€โ”€ Reports (many)        โ† Saved report configurations