# School Accounting ERP This project is a comprehensive, enterprise-grade accounting and ERP system designed specifically for educational institutions, with a focus on the Ghanaian market. It provides a robust backend for managing all financial aspects of a school, from student billing to detailed financial reporting and auditing. The system is built with a clear separation of concerns, ensuring that the core accounting engine remains reliable and independent, while allowing for intelligence and visualization layers to be built on top. ## Core Principles * **Accounting First:** The system is built around a solid, double-entry accounting engine, ensuring all financial data is accurate and balanced. * **Read-Only Insights:** The intelligence and dashboard layers are strictly read-only, ensuring they can never corrupt the core accounting data. * **Auditability:** A comprehensive audit trail logs every significant financial action, providing a complete and immutable history. * **Modularity:** The system is designed in phases, allowing for incremental development and deployment. ## Features (Phases 1-5) The backend is functionally complete and provides the following features: * **Chart of Accounts:** A flexible and customizable chart of accounts to categorize all financial transactions. * **Student Management:** Manage student records and enrollment. * **Fee Structures:** Define complex fee structures and assign them to students. * **Invoicing:** Automatically generate and issue invoices to students. * **Payments:** Record and track student payments. * **Expense Management:** Manage vendors and track bills and bill payments. * **Journal Entries:** Manually create journal entries for adjustments and other accounting tasks. * **Financial Reporting:** * **Trial Balance:** Ensure the books are always balanced. * **Income Statement:** Track revenue, expenses, and profitability. * **Balance Sheet:** Get a snapshot of the school's financial position. * **Accounts Receivable (A/R) Aging:** Monitor outstanding invoices. * **Accounts Payable (A/P) Aging:** Track outstanding bills. * **Financial Controls:** * **Accounting Periods:** Close accounting periods to prevent unauthorized changes to historical data. * **Audit Trail:** * **Comprehensive Logging:** Every key financial transaction is logged for full traceability. ## Technology Stack * **Backend:** PHP 8.x (Vanilla) * **Database:** MariaDB / MySQL * **Web Server:** Apache * **Frontend:** React (rendered client-side) ## Project Structure ``` ├── api/ # API endpoints │ ├── reports/ # Financial report endpoints │ └── ... ├── db/ # Database scripts │ ├── migrations/ # Database migration files │ └── config.php # Database connection configuration ├── includes/ # Helper functions and utilities ├── mail/ # Email sending service ├── ai/ # AI/ML integration hooks ├── dashboard/ # Frontend React application │ ├── src/ │ └── ... ├── .htaccess # Apache configuration ├── index.php # Main application entry point (serves the dashboard) └── README.md # This file ``` ## Setup and Installation 1. **Environment:** Set up a standard LAMP (Linux, Apache, MySQL, PHP) stack. 2. **Database:** * Create a new MySQL/MariaDB database. * Update the credentials in `db/config.php`. 3. **Migrations:** Run the database migrations located in the `db/migrations/` directory in sequential order to set up the database schema. 4. **Web Server:** Configure Apache to use the project's root directory as the `DocumentRoot`. 5. **Access:** Open the project URL in your browser. The `index.php` file will automatically load the React-based dashboard. ## API Endpoints The core backend functionality is exposed via a series of PHP-based API endpoints in the `api/` directory. The frontend dashboard interacts with these endpoints to display data. Key endpoints include: * `/api/students_post.php` * `/api/invoices_post.php` * `/api/payments_post.php` * `/api/vendors_post.php` * `/api/bills_post.php` * `/api/reports/trial_balance.php` * `/api/reports/income_statement.php` * `/api/reports/balance_sheet.php` * `/api/reports/ar_aging.php` * `/api/reports/ap_aging.php` --- *This README provides a high-level overview. For detailed API specifications and implementation details, please refer to the source code.*