Skip to content

josepsanzcamp/SaltOS4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SaltOS 4

Build Enterprise Business Apps Declaratively in YAML/XML

CRM Β· ERP Β· Custom Workflows β€” 10x Faster Than Traditional Frameworks

License: GPL v3 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 CRM/ERP
  • Commercial solutions (Odoo, SAP): €20K-100K/year + 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: GPL-3.0 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 Email Email
Invoices Invoices Tester Tester

πŸš€ Quick Start

Try the Demo (No Installation)

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

  • Username: admin
  • Password: admin

Each visitor gets an isolated demo instance (SQLite-based).

Local Installation

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

# 2. Create instance (symlinks code/ to instance directory)
mkdir my-instance
cd my-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 localhost:8000

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

Docker Compose coming soon!


πŸ—οΈ 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             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Technologies

  • Backend: PHP 7.0-8.3 (strict types, tested)
  • Frontend: TypeScript, Bootstrap 5, TomSelect, CKEditor, 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):


πŸ†š Comparison

Feature SaltOS 4 Odoo ERPNext Bubble.io
Open Source βœ… GPL-3.0 βœ… LGPL (CE) / Proprietary (EE) βœ… GPL-3.0 ❌ Proprietary
Self-Hosted βœ… Yes βœ… Yes βœ… Yes ❌ Cloud-only
No Vendor Lock-in βœ… Yes ⚠️ Complex βœ… Yes ❌ No
Declarative Apps (YAML) βœ… Yes ❌ Python/XML ❌ Python βœ… Visual
Blockchain Versioning βœ… Yes ❌ No ❌ No ❌ No
PWA Offline Support βœ… Yes ⚠️ Limited ❌ No ❌ No
Learning Curve 🟒 Low πŸ”΄ High 🟑 Medium 🟒 Low
Customization 🟒 Easy 🟑 Complex 🟑 Medium πŸ”΄ Limited
Cost (self-hosted) €0 €0 (CE) / €€€ (EE) €0 N/A

🀝 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

GPL-3.0 β€” Free as in freedom.

SaltOS: Framework to develop Rich Internet Applications
Copyright (C) 2007-2025 by Josep Sanz CampderrΓ³s

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

πŸ’¬ 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!