This monorepo contains the official collection of reusable platformOS modules. These modules are designed as composable building blocks that follow platformOS DevKit best practices and can be used independently or together to build complex applications on the platformOS platform.
platformOS modules are reusable software components that help decompose complex systems into smaller, maintainable pieces. They follow a three-layer architecture pattern:
- Core functionality (provided by foundation modules)
- Vendor/community contributions (feature modules)
- Project-specific code (your application)
This modular approach lowers application complexity, improves maintainability, and reduces time to market by enabling code reuse across projects.
These modules provide core functionality that other modules depend on:
The foundation module - required by almost all other modules.
Establishes architectural patterns and conventions for the entire ecosystem. Provides:
- Command Pattern: 3-stage (Build/Check/Execute) for business logic
- Event System: Async communication via activities and consumers
- Module Registry: Dependency management and version tracking
- Validators: Built-in input validation helpers
- Utilities: Email sending, API calls, global variables, session storage
Dependencies: None (zero dependencies)
Links: README | Marketplace
Authentication and authorization module - required by modules that need auth/RBAC.
Provides comprehensive user management with session-based authentication and Role-Based Access Control (RBAC). Features:
- Registration & Authentication: CRUD operations for users, sign in/out
- RBAC Authorization: Role-based permissions system with built-in roles (anonymous, authenticated, superadmin)
- Password Reset: Complete password recovery flow with email notifications
- 2FA: Two-factor authentication with OTP/QR codes
- Impersonation: Admin ability to log in as another user
- OAuth2 Integration: Extensible OAuth provider support (see oauth-github, oauth-google, oauth-facebook modules)
Dependencies: core, common-styling
Links: README | Marketplace
Design system and CSS/JavaScript utilities.
Provides reusable UI components and styling utilities with:
- CSS variables system (pos-config.css) for theming
- Theme support (light/dark mode)
- Responsive design utilities
- Form and button components
- JavaScript utilities in
window.posnamespace - Scoped with
pos-prefix to avoid conflicts
Dependencies: None
Links: README | Marketplace
Testing framework - often used as a dev dependency for unit/integration tests.
Liquid-based testing framework for writing and running tests on platformOS. Features:
- Assertion library (equal, presence, valid_object, etc.)
- Test runner with HTML and JSON output formats
- Email inspection tools (
/_tests/sent_mails) - Background test execution
- CI/CD integration via
pos-cli test run
Dependencies: None
Note: Only runs in staging/development environments for security.
Links: README | Marketplace | CLAUDE.md
These modules provide specific functionality and typically depend on foundation modules:
Real-time chat using WebSockets with inbox functionality and message storage.
Dependencies: core, user, common-styling
Links: README
Universal payment interface supporting multiple gateways with event-based transaction tracking.
Features:
- Gateway abstraction pattern
- Transaction model with status tracking
- Event system (payment_transaction_pending/succeeded/failed/expired)
- Gateway request logging
Dependencies: core
Links: README
Stripe payment gateway implementation with Stripe Checkout integration and webhook handling.
Dependencies: core, payments
Links: README
Fake payment gateway for testing purposes. Does not process real payments - used to simulate successful or failed payment transactions during development.
Dependencies: core, payments
Links: README
Background report generation system with CSV export functionality and document management.
Dependencies: core, user, tests
Links: README
OpenAI integration for embeddings and AI-powered features.
Dependencies: core
API endpoints for triggering data exports with authentication via constant.
Dependencies: core
Links: README
OAuth2 provider implementations for external identity provider authentication. These modules integrate with the user module to enable social login.
GitHub OAuth2 provider implementation.
Dependencies: core, user
Links: README
Google OAuth2 provider implementation.
Dependencies: core, user
Links: README
Facebook OAuth2 provider implementation.
Dependencies: core, user
Links: README
GitHub Action for reserving CI instances, managing authorization tokens, and releasing instances for platformOS CI/CD workflows. This tool prevents conflicts when running multiple tests simultaneously by managing a pool of shared instances (ci.1-ci.6).
Features:
- Reserve/release CI instances from shared pool
- Get authorization tokens for GitHub Actions
- Prevent test conflicts across parallel workflows
- Persistent log access with timestamped report paths
Type: GitHub Action (not a platformOS module)
Links: README | GitHub Action
- pos-cli - Essential tool for managing platformOS projects
- A platformOS instance (create one at partners.platformos.com)
- platformOS Check (optional but recommended)
Modules can be installed from the Partner Portal Modules Marketplace:
# Install a module
pos-cli modules install <module-name>
# Download source code for local development
pos-cli modules download <module-name>
# Deploy to your instance
pos-cli deploy <env>Each module directory contains:
pos-module-<name>/
├── modules/
│ └── <machine-name>/ # The actual module (distributed part)
│ ├── public/ # Module source code
│ └── template-values.json # Module metadata & dependencies
├── app/ # Example application (not distributed)
├── package.json # npm scripts for development
└── README.md # Module documentation
# Real-time sync during development
pos-cli sync <env>
# View instance logs
pos-cli logs <env>
# Run tests
pos-cli test run <env> [test-name]
# Create migrations
pos-cli migrations generate <env> <name>
# GraphQL explorer
pos-cli gui serveAll modules follow this pattern for business logic:
- Build: Normalize input, set defaults, type conversions
- Check: Validate inputs using core validators
- Execute: Run GraphQL mutation (only if valid)
{% liquid
function object = 'modules/<module>/commands/<resource>/<action>/build', object: object
function object = 'modules/<module>/commands/<resource>/<action>/check', object: object
if object.valid
function object = 'modules/<module>/commands/<resource>/<action>/execute', object: object
endif
return object
%}Events enable async, loosely-coupled communication:
{% liquid
# Publish event
function activity = 'modules/core/commands/events/publish', type: 'user_created', object: user_data
%}Consume events by creating consumers in lib/consumers/<event_name>/.
- Permissions:
<resource>.<action>(e.g.,user.create,orders.manage.all) - Commands:
<resource>/<action>(e.g.,users/create,order/cancel) - Queries:
<resource>/search(multiple) or<resource>/find(single) - Events:
<action>_<resource>(past tense:user_created,payment_succeeded) - CSS Classes:
pos-prefix (e.g.,.pos-button,.pos-form)
Most modules depend on pos-module-core as the foundation. Authentication/authorization features require pos-module-user. Testing capabilities require pos-module-tests (often as a dev dependency).
core (foundation - no dependencies)
├── user + common-styling
│ ├── chat (+ common-styling)
│ ├── reports (+ tests)
│ ├── oauth-github
│ ├── oauth-google
│ └── oauth-facebook
├── payments
│ ├── payments-stripe
│ └── payments-example-gateway
├── openai
└── data-export-api
common-styling (standalone)
tests (standalone)
Modules can be customized without forking by using the override system:
- Copy file from
modules/<module>/public/toapp/modules/<module>/public/ - Modify the copy - it will take precedence
- Configure
app/config.yml:
modules_that_allow_delete_on_deploy:
- core
- user
- <your-module>Organize endpoints using REST conventions:
GET /articles- List articlesPOST /articles- Create articleGET /articles/:id- Show articlePATCH /articles/:id- Update articleDELETE /articles/:id- Delete article
- Pages: Act as controllers, handle business logic
- Partials: Handle presentation only
- Commands: Encapsulate business rules
- Queries: Encapsulate data access
Write tests in app/lib/test/*_test.liquid:
{% liquid
function result = 'modules/user/commands/user/create', email: '[email protected]', password: 'password'
function contract = 'modules/tests/assertions/valid_object', contract: contract, object: result, field_name: 'user_create'
function contract = 'modules/tests/assertions/equal', contract: contract, given: result.email, expected: '[email protected]', field_name: 'email'
%}- platformOS Documentation
- platformOS Modules Guide
- Partner Portal
- Modules Marketplace
- pos-cli GitHub
- platformOS Check (Linter/LSP)
Each module in this monorepo follows semantic versioning and can be developed independently. Refer to individual module READMEs for specific contribution guidelines.
Individual modules may have their own licenses. Please refer to each module's directory for specific licensing information.