A complete, lightweight, scalable multi-tenant SaaS platform for Internal Audit management built with PHP 7.x+ and MySQL.
- Multi-Tenant Architecture: Complete tenant isolation with subscription-based access control
- Role-Based Access Control (RBAC): 7 predefined roles with granular permissions
- Audit Universe Management: Track all auditable entities (processes, departments, branches, systems)
- Audit Programs: Annual/quarterly audit planning
- Risk Assessment Module: Complete risk register with heatmap visualization
- Audit Plans & Engagements: Comprehensive audit lifecycle management
- Audit Checklists: Reusable templates with execution tracking
- Findings Management: Track audit findings with severity levels
- Corrective Actions: Action tracking with due dates and reviews
- Compliance Management: Track regulatory compliance requirements
- Evidence Repository: Secure document management
- Notifications & Alerts: Automated email notifications for key events
- Dashboards: Role-specific dashboards for different user types
- Reports: Export audit data to CSV format
- REST API: Documented API with API key authentication
- Password hashing with bcrypt
- CSRF protection on all forms
- SQL injection prevention (prepared statements)
- XSS protection (output escaping)
- File upload validation (type, size, MIME)
- Session management with regeneration
- Tenant data isolation
- Security headers (X-Frame-Options, X-XSS-Protection, etc.)
- Three subscription plans: Basic, Professional, Enterprise
- Quota enforcement for:
- Audit plans
- Checklists
- Users
- Storage size
- Corrective actions
- Usage tracking and statistics
- Trial period support
- PHP 7.0 or higher (7.x - 8.x)
- MySQL 5.7+ or MariaDB 10.2+
- Apache/Nginx web server
- mod_rewrite enabled (Apache)
- PDO PHP Extension
- Fileinfo PHP Extension
git clone <repository-url> SplashAudit
cd SplashAuditCopy the example environment file and configure your settings:
cp .env.example .envEdit .env and set your database credentials:
DB_HOST=localhost
DB_PORT=3306
DB_NAME=splash_audit
DB_USER=root
DB_PASS=your_password
Create a MySQL database and import the schema:
mysql -u root -pCREATE DATABASE splash_audit CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
exit;mysql -u root -p splash_audit < database.sqlEnsure the storage directory is writable:
chmod -R 775 storage/
chmod -R 775 storage/uploads/
chmod -R 775 storage/logs/Create a virtual host or configure your document root to point to the public directory.
Example Apache configuration:
<VirtualHost *:80>
ServerName splashaudit.local
DocumentRoot /path/to/SplashAudit/public
<Directory /path/to/SplashAudit/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/splashaudit_error.log
CustomLog ${APACHE_LOG_DIR}/splashaudit_access.log combined
</VirtualHost>Example Nginx configuration:
server {
listen 80;
server_name splashaudit.local;
root /path/to/SplashAudit/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.env {
deny all;
}
}Navigate to: http://localhost or your configured domain
- Email:
admin@splashaudit.com - Password:
Admin@123
- Email:
admin@demo.com - Password:
Demo@123
IMPORTANT: Change these passwords immediately after first login!
- Full system access
- Manage all tenants
- Platform-level configuration
- Manage company users
- Manage audit programs
- Manage company settings
- Full access to all tenant features
- Create and manage audit plans
- Assign audits to auditors
- Approve audit reports
- View all reports
- Perform assigned audits
- Execute checklists
- Create findings
- Document evidence
- Respond to findings
- Submit evidence
- Create and manage corrective actions
- Review corrective actions
- Approve/reject submissions
- Read-only access to all modules
The system provides a RESTful API for integration with external systems.
All API requests require an API key in the header:
X-API-KEY: your_api_key_here
API keys can be found in the database api_keys table or generated via the admin panel.
Endpoint: POST /api/findings/create
Request Body:
{
"audit_plan_id": 1,
"title": "Security Vulnerability Found",
"description": "SQL injection vulnerability in login form",
"severity": "high",
"cause": "Lack of input validation",
"effect": "Potential data breach",
"criteria": "OWASP Top 10",
"assigned_to": 5
}Response:
{
"success": true,
"finding_id": 42,
"message": "Finding created successfully"
}Endpoint: POST /api/corrective-actions/add
Request Body:
{
"finding_id": 42,
"action_description": "Implement input validation and parameterized queries",
"due_date": "2024-12-31",
"responsible_user_id": 8
}Response:
{
"success": true,
"corrective_action_id": 15,
"message": "Corrective action created successfully"
}Endpoint: GET /api/audits/status?audit_plan_id=1
Response:
{
"success": true,
"audit": {
"id": 1,
"title": "Q4 2024 IT Audit",
"status": "in_progress",
"planned_start": "2024-10-01",
"planned_end": "2024-12-31",
"actual_start": "2024-10-05",
"actual_end": null,
"findings_count": 12
}
}Endpoint: GET /api/findings/list?status=open
Response:
{
"success": true,
"count": 5,
"findings": [
{
"id": 1,
"title": "Finding Title",
"severity": "high",
"status": "open",
"created_at": "2024-01-15 10:30:00"
}
]
}{
"error": "Error message description"
}Common HTTP Status Codes:
200- Success201- Created400- Bad Request401- Unauthorized (invalid API key)404- Not Found405- Method Not Allowed500- Internal Server Error
The system uses 25+ tables organized as follows:
tenants- Company/organization recordssubscription_plans- Available subscription tierstenant_subscriptions- Active subscriptionsinvoices- Billing invoicespayments- Payment records
users- User accountsapi_keys- API authentication keysaudit_universe- Auditable entitiesaudit_programs- Audit programsaudit_plans- Individual audit plansaudit_checklists- Reusable checklistschecklist_items- Checklist questionsaudit_work_items- Checklist executionrisks- Risk registerfindings- Audit findingscorrective_actions- Action itemscorrective_action_reviews- Review recordscompliance_areas- Compliance frameworkscompliance_requirements- Specific requirementscompliance_checks- Compliance assessmentsfiles- Document repositorynotifications- Email notificationsusage_tracking- Quota usageactivity_logs- Audit trail
SplashAudit/
├── app/
│ ├── controllers/ # Application controllers
│ │ ├── AuthController.php
│ │ ├── DashboardController.php
│ │ ├── AuditController.php
│ │ ├── RiskController.php
│ │ ├── FindingController.php
│ │ ├── CorrectiveActionController.php
│ │ ├── ReportController.php
│ │ ├── UserController.php
│ │ └── Api*.php (API controllers)
│ ├── models/ # Data models
│ │ ├── User.php
│ │ ├── Tenant.php
│ │ ├── AuditPlan.php
│ │ ├── Finding.php
│ │ └── ...
│ ├── views/ # View templates
│ │ ├── layouts/
│ │ ├── auth/
│ │ ├── dashboard/
│ │ └── ...
│ ├── core/ # Core framework
│ │ ├── Database.php
│ │ ├── Router.php
│ │ ├── Controller.php
│ │ ├── Model.php
│ │ ├── View.php
│ │ ├── Session.php
│ │ └── Auth.php
│ └── helpers/ # Helper classes
│ ├── FileUpload.php
│ ├── Validator.php
│ ├── Email.php
│ └── QuotaChecker.php
├── config/ # Configuration files
│ └── config.php
├── public/ # Public web root
│ ├── index.php
│ ├── .htaccess
│ └── assets/
│ ├── css/
│ └── js/
├── storage/
│ ├── uploads/ # Uploaded files
│ └── logs/ # Application logs
├── database.sql # Database schema
├── .env.example # Environment template
└── README.md
- Create Model: Extend the
Modelclass inapp/models/ - Create Controller: Extend the
Controllerclass inapp/controllers/ - Create Views: Add templates in
app/views/ - Update Router: Routes are automatically handled by the Router class
Always ensure tenant isolation when querying data:
// Good - tenant isolation enabled
$model = new YourModel();
$records = $model->findAll(); // Automatically filters by tenant_id
// Direct queries - include tenant_id
$sql = "SELECT * FROM table WHERE tenant_id = ?";
$results = $this->db->fetchAll($sql, [Auth::tenantId()]);- Always use prepared statements
- Validate and sanitize user input
- Escape output in views
- Use CSRF tokens on forms
- Validate file uploads
- Log sensitive operations
- Verify database credentials in
.env - Ensure MySQL service is running
- Check database user permissions
- Check storage directory permissions (
chmod 775 storage/) - Verify
upload_max_filesizeandpost_max_sizeinphp.ini - Ensure allowed file extensions are configured
- Check session directory permissions
- Verify
session.save_pathin PHP configuration - Clear browser cookies
- Ensure mod_rewrite is enabled (Apache)
- Check
.htaccessfile exists inpublic/ - Verify web server configuration
- Database Indexes: Indexes are included in schema for common queries
- Query Optimization: Use pagination for large result sets
- Caching: Implement caching layer for repeated queries (optional)
- File Storage: Consider CDN for uploaded files in production
- Change default passwords immediately
- Use HTTPS in production
- Set strong session configuration
- Regularly update PHP and MySQL
- Implement rate limiting on API endpoints
- Regular security audits
- Keep storage directory outside web root in production
mysqldump -u root -p splash_audit > backup_$(date +%Y%m%d).sqltar -czf storage_backup_$(date +%Y%m%d).tar.gz storage/This is a complete internal audit SaaS system built for educational and production use.
MIT License - Feel free to use, modify, and distribute.
- Complete multi-tenant architecture
- Full audit lifecycle management
- Risk assessment module
- Findings and corrective actions
- Compliance management
- REST API
- Role-based access control
- Subscription and quota management
- Comprehensive reporting
Built with PHP 7.x+, MySQL, and modern web technologies.