Skip to content

josepsanzcamp/SaltOS4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,347 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SaltOS 4

Build Enterprise Business Apps Declaratively in YAML/XML

Structured Business Systems β€” 10x Faster Than Traditional Frameworks

License: MIT PHP Demo Docs

πŸš€ Try Demo β€’ πŸ“– Documentation β€’ πŸ’¬ Discussions


🎯 The Problem

Building custom business applications is expensive and slow:

  • Traditional development: 6-12 months for a basic business application
  • Proprietary enterprise platforms: High recurring licensing costs + vendor lock-in
  • Customizing platforms: Expensive and complex
  • No-code tools: Limited power for complex business logic

✨ The Solution

Define your business app declaratively in YAML/XML. SaltOS 4 automatically generates:

  • βœ… Full REST API with authentication
  • βœ… Responsive web UI (desktop + mobile)
  • βœ… Complete audit trail with blockchain integrity
  • βœ… Multi-language support (EN/ES/CA)
  • βœ… Offline-first Progressive Web App
  • βœ… PDF generation from templates
  • βœ… Full-text search indexing

Example: CRM App Definition

# apps/crm/xml/customers.yaml
app: customers
template: apps/common/xml/default.xml

list:
    - [name, text, Name]
    - [code, text, Tax ID]
    - [city, text, City]
    - [active, boolean, Active]

form:
    - [name, text, Name]
    - [code, text, Tax ID]
    - [email, text, Email]
    - [phone, text, Phone]
    - [notes, textarea, Notes]
    - [type_id, select, Type]

select:
    - [type_id, app_customers_types]

attr:
    name:
        required: true
    notes:
        height: 5em

Plus database schema (dbschema.xml) and app manifest (manifest.xml). πŸ‘‰ See complete CRM example

You automatically get:

  • βœ… Full REST API (GET/POST/PUT/DELETE /api/app/customers)
  • βœ… Responsive web UI with search/filter/pagination
  • βœ… Create/Edit/Delete forms with validation
  • βœ… Blockchain-verified version history
  • βœ… File attachments & notes system
  • βœ… User/group permission system
  • βœ… Full-text search indexing

πŸ“ How Apps Are Structured

Every SaltOS app is defined by 3 declarative files:

1. UI Definition customers.yaml

app: customers

list:
  - [name, text, Name]
  - [email, text, Email]

form:
  - [name, text, Name]
  - [email, text, Email]

Defines list views, forms, and field types.

2. Database Schema dbschema.xml

<table name="app_customers">
  <field name="id"
         type="INTEGER"
         pkey="true"/>
  <field name="name"
         type="VARCHAR(255)"/>
  <field name="email"
         type="VARCHAR(255)"/>
</table>

Defines tables, fields, and relationships.

3. App Manifest manifest.xml

<app id="50"
     code="customers"
     name="Customers"
     table="app_customers"
     has_version="1"
     has_files="1"
     has_notes="1"/>

Registers the app with metadata and features.

What Gets Auto-Generated

From these definitions, SaltOS automatically creates:

Component Generated From Example
REST API YAML + Schema GET /api/app/customers/list
Web UI YAML fields Responsive list + modal forms
SQL Migrations Schema changes ALTER TABLE app_customers ADD COLUMN...
Search Index Text fields Full-text search on name, email, notes
Version Tracking manifest has_version="1" Blockchain-verified history
File Uploads manifest has_files="1" Attachment management
Permissions manifest perms User/group access control

πŸ“– Learn more in the Developer Guide


πŸ”₯ Key Features

For Developers

  • πŸš€ 10x Faster Development: Define apps declaratively, not imperatively
  • πŸ—οΈ Automatic Schema Migrations: Edit XML β†’ Database updates automatically
  • πŸ” Blockchain-Verified Versioning: Every change tracked with cryptographic integrity
  • πŸ“± PWA-Ready: Works offline with service workers
  • πŸ§ͺ Fully Tested: PHPUnit + Jest with comprehensive coverage
  • 🌍 Multi-Database: MySQL, PostgreSQL, SQLite, MSSQL

For Businesses

  • πŸ’° Zero Licensing Costs: MIT open source
  • πŸ”’ Self-Hosted: Your data stays on your servers
  • πŸ“Š Audit Compliance: Every action logged with user/timestamp
  • 🌐 Multilingual: Built-in i18n (YAML-based translations)
  • πŸ“„ PDF Generation: Custom templates for invoices/reports
  • πŸ”„ Import/Export: CSV, Excel, SQL

πŸ“Έ Screenshots

Login Dashboard Invoices Invoices
Emails Emails Help About
Emails PDF Customers PDF

πŸš€ Quick Start

Try the Demo (No Installation)

πŸ‘‰ https://demos.saltos.org/

  • Username: admin
  • Password: admin

Each visitor gets an isolated SQLite-based instance, similar to the devel Docker profile.

Local Installation

# 1. Clone repository
git clone https://github.com/josepsanzcamp/SaltOS4.git
cd SaltOS4

# 2. Create instance (symlinks code/ to instance directory)
mkdir instance
cd instance
bash ../scripts/make_instance.sh

# 3. Configure database (SQLite or MySQL)
# Edit code/api/data/config.xml

# 4. Run setup (creates tables + sample data)
php api/index.php setup
user=admin php api/index.php setup/certs
user=admin php api/index.php setup/company
user=admin php api/index.php setup/emails
user=admin php api/index.php setup/crm
user=admin php api/index.php setup/hr
user=admin php api/index.php setup/purchases
user=admin php api/index.php setup/sales

# 5. Start web server
cd web
ln -s index.htm index.php
php -S 0.0.0.0:8080

# 6. Open browser
open http://localhost:8080

Docker Profiles Overview

SaltOS 4 provides two main runtime Docker profiles:

  • devel: lightweight development environment (SQLite + PHP built-in server)
  • server: production-ready stack (Apache + PHP + MariaDB)

The server profile installs and initializes SaltOS automatically during the image build.

Development with Docker (SQLite + PHP Built-in Server)

SaltOS 4 provides a lightweight development environment using:

  • PHP built-in server
  • SQLite database
  • Minimal dependencies
  • Fast startup

Build and start development container

make develbuild
make develstart

Access

Development container management

make develstatus   # Show container status
make devellogs     # Show logs
make develbash     # Open shell inside container
make develstop     # Stop and remove container

This profile is optimized for fast development and testing.

Production Server with Docker (Apache + MariaDB)

The server profile installs and initializes SaltOS automatically during the image build.

Build and start the server

make serverbuild
make serverstart

Access

A self-signed SSL certificate is generated automatically.

Server management

make serverstatus   # Show container status
make serverlogs     # Show logs
make serverbash     # Open shell inside container
make serverstop     # Stop and remove containers

Docker Compose profiles

Docker Compose defines three profiles:

  • devel: builds and runs SaltOS using Dockerfile.devel (PHP built-in server + SQLite).

  • server: builds and runs SaltOS using Dockerfile.server (Apache + PHP + MariaDB).

  • test: starts external service containers used for unit testing:

    • Microsoft SQL Server 2022
    • PostgreSQL 17
    • GreenMail (SMTP / POP3 mail server simulation)

The test profile does not build SaltOS itself. It only provides the external dependencies required by the test suite.

Test services (unit testing)

The optional test profile starts SQL Server, PostgreSQL and GreenMail required for running the unit test suite.

make teststart     # Start test dependencies
make teststatus    # Show running containers
make testlogs      # View service logs
make teststop      # Stop and cleanup

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Web Browser (PWA)                  β”‚
β”‚  TypeScript Β· Bootstrap 5 Β· Service Worker          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ REST/JSON
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   PHP API Layer                     β”‚
β”‚  Router Β· Auth Β· Permissions Β· Versioning           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            YAML/XML App Definitions                 β”‚
β”‚  Declarative schemas β†’ Auto-generated CRUD          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     MySQL Β· PostgreSQL Β· SQLite Β· MSSQL             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Docker profiles: Development uses SQLite + PHP built-in server. Production uses Apache + MariaDB.

Core Technologies

  • Backend: PHP 7.0-8.5 (strict types, tested)
  • Frontend: TypeScript, Bootstrap 5, TomSelect, Jodit Editor, Chart.js
  • Storage: Multi-database abstraction layer (PDO)
  • Testing: PHPUnit (backend) + Jest (frontend)
  • i18n: YAML-based translations
  • PDFs: TCPDF with XML templates
  • Excel: PHPSpreadsheet (import/export)

πŸ“š Built-In Apps

SaltOS 4 ships with production-ready apps:

App Description
CRM Customers, Leads, Quotes, Meetings
Sales Products, Invoices, Orders, Taxes
Purchases Suppliers, Purchase Orders
HR Employees, Departments
Emails POP3/SMTP integration, inbox management
Company Company profile, settings
Users User & group management, permissions

πŸ” Blockchain-Verified Versioning

Every change is stored with cryptographic chain-of-custody:

// Version 1 (created)
{
  "ver_id": 1,
  "user_id": 1,
  "datetime": "2025-01-01 10:00:00",
  "data": {"app_customers": {"123": {"name": "Acme Corp", ...}}},
  "hash": ""  // First version
}

// Version 2 (updated - only deltas)
{
  "ver_id": 2,
  "user_id": 2,
  "datetime": "2025-01-05 14:30:00",
  "data": {"app_customers": {"123": {"email": "new@acme.com"}}},
  "hash": "abc123..."  // Hash of version 1
}

Tamper-proof: Any modification to historical data breaks the chain.


πŸ“– Documentation

Comprehensive docs in 3 languages (English, Spanish, Catalan):


🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Development Setup

# Run code quality and tests
make test        # Linting (phpcs + phpstan + jscs)
make utest       # PHPUnit (backend tests)
make ujest       # Jest (frontend tests)

πŸ“„ License

SaltOS is licensed under the MIT License

Copyright (c) 2007-2026 Josep Sanz CampderrΓ³s

SaltOS4 versions prior to 4.1 were licensed under GPL-3.0. Starting from version 4.1, the project is licensed under MIT.


πŸ’¬ Community & Support


πŸ™ Acknowledgments

SaltOS 4 is built on top of excellent open source projects:

Backend:

Frontend:

Testing:

  • PHPUnit β€” PHP testing framework
  • Jest β€” JavaScript testing

Full list: View all 30+ dependencies in checklibs.txt


Built with ❀️ by Josep Sanz Campderrós

⭐ Star this repo if you find it useful!

Releases

No releases published

Packages

 
 
 

Contributors