خادم مبادرتنا البرمجي هو محرك سحابي متكامل يعتمد على لغة PHP وقاعدة بيانات MySQL لمعالجة طلبات التطوع وإدارة برامج الأنشطة وحسابات المسؤولين وتوثيق البيانات الإحصائية للتقارير الجامعية.
This repository contains the backend RESTful API services, security filters, database schema migrations, and administration dashboard controllers for the Mobadratna Ecosystem.
The backend engine provides core endpoints and files:
- API Gateway Router (
api.php): Unified routing processor handling requests for initiatives, volunteer submissions, status approvals, and database updates. - Database Connection Config (
config.php,database.php): Secure PDO initialization parameters and connection pools. - Security Helpers (
helpers.php): Validation layers providing clean database input filters and XSS/SQL Injection protection. - Database Schema Migration (
database.sql): Structural tables mapping user credentials, initiatives list, and voluntary enrollment records. - Administrative Panels (
admin/): Sub-folders managing administrative tasks like initiative approvals, stats tracking, and user authorizations.
The REST engine handles secure request lifecycles:
graph TD
Client[Frontend Client Request] -->|JSON Payload| Router[api.php - API Gateway Router]
Router -->|Input Validation| Filter[helpers.php - Sanitize & Check]
Filter -->|Valid| DBConnect[database.php - PDO Secure Connection]
Filter -->|Invalid Parameters| Err[Return HTTP 400 Bad Request JSON]
DBConnect -->|Execute Prepared SQL Statement| MySQL[(MySQL Database)]
MySQL -->|Return Rowset / Result| Router
Router -->|JSON Output Response| Client
- Runtime Backend: Written in clean raw PHP 8.0+ to ensure maximum execution speeds.
- Relational Storage: Powered by MySQL mapping relationships between initiatives and volunteers.
- Database Access Security: Implemented strictly using PHP Data Objects (PDO) prepared statements to prevent SQL Injection exploits.
- HTTP Protocol Access: CORS headers and JSON response formatting for integration with static clients.
mobadratna-core-engine/
├── admin/ # Administrative backend managers and dashboards
├── uploads/ # Server directory storing poster attachments
├── api.php # API global router endpoint
├── config.php # Global configuration values
├── database.php # PDO database connection pool
├── database.sql # Database schema structure migrations script
└── helpers.php # Validation, session, and sanitization utilities
- Local Web server running PHP 8.0+ and MySQL (e.g. XAMPP, Laragon, or Docker)
# 1. Clone the backend repository inside Apache root folder (e.g. htdocs)
git clone https://github.com/Mobadratna-Org/mobadratna-core-engine.git
cd mobadratna-core-engine
# 2. Setup Database
# Create database named 'mobadratna' in MySQL phpMyAdmin
# Import 'database.sql' schema script
# 3. Configure Database connection
# Edit config.php and set database credentials (db_user, db_pass, host)
# 4. Run Apache & Test API endpoints
# Query the API: http://localhost/mobadratna-core-engine/api.phpLicensed under the MIT License.