Live Deployment: https://oliveflow.gt.tc/
Project: Student ERP (Enterprise Resource Planning for Educational Institutions)
Version: 1.0.0
Stack: PHP 8+, MySQL, Bootstrap 5, Chart.js, Bootstrap Icons
Environment: XAMPP (Apache + MySQL) on Windows
- Project Overview
- Technology Stack
- Setup & Installation
- Customization Guide (URL & Database)
- Directory Structure
- Module Details (20+ Modules)
- Navigation & Routing
- UI / Design System
- Security Implementation
- Known Limitations & Future Scope
Student ERP is a comprehensive, modular web-based ERP designed for educational institutions to strictly manage students, academic planning, attendance, fees, faculty, and system administration from a centralized dashboard.
Key Features:
- Student Information Management (SIM) — Profiles, admission records, parent directory.
- Academic Management — Programs, batches, subjects, and course mappings.
- Faculty & Staff HR — Hiring details, categories, designations, and workload allocation.
- Attendance & Examinations — Tracking student attendance and scheduling exams.
- Fees & Library — Record payments with receipts, library book catalog with copy tracking.
- Communications — Internal announcements and alerts dashboard.
| Layer | Technology |
|---|---|
| Backend | PHP 8+ (Procedural structure with robust PDO abstractions) |
| Database | MySQL 8+ via PDO prepared statements |
| Frontend UI | Bootstrap 5.3 Framework + Custom CSS |
| Icons & Charts | Bootstrap Icons 1.11, Chart.js (via CDN) |
| Fonts | Inter (Google Fonts) |
| Server | Apache (XAMPP environment recommended) |
| Authentication | PHP Sessions + Secure password_verify() |
Follow these instructions exactly to get the ERP up and running in minutes.
Ensure you have XAMPP installed and both Apache and MySQL are running in the XAMPP Control Panel.
- Open your browser and navigate to
http://localhost/phpmyadmin - Create a new database named
college_db. Ensure the collation isutf8mb4_general_ci. - Select the newly created
college_dbdatabase on the left sidebar. - Click the Import tab at the top.
- Click Go to run the import. This sets up all 20+ tables along with sample/dummy data.
- In the root directory, you will find a file named
.env.example. - Create a copy of this file and rename it to
.env. - Open
.envand update the database credentials if they differ from the defaults:DB_HOST=localhost DB_USER=root DB_PASS=your_password DB_NAME=college_db
Once the database is imported and the .env is configured, you can access the project:
URL: http://localhost/Ex_OliveFlow
Use the following credentials to access the Admin Dashboard:
- Email:
abc@domain.com - Password:
123456
Use the following credentials to access the Faculty Dashboard:
- Email:
abcf@domain.com - Password:
123456
It is highly likely you will want to deploy this app to a live server or simply change the folder name. Here is exactly where you make those changes.
Currently, the app expects to be inside a folder named studentErpFin. If you rename the folder to something like my_college_erp or upload it to a live domain (https://erp.mycollege.com), you must update the BASE_URL constant.
- Open the file:
config/config.php - Find this line:
define('BASE_URL', 'http://localhost/Ex_OliveFlow');
- Change it to your new path or live domain:
// Example local change: define('BASE_URL', 'http://localhost/my_college_erp'); // Example live domain change: define('BASE_URL', 'https://erp.mycollege.com');
Warning: If you do not update this, all CSS/JS assets and links will break!
If you name your database something different (e.g., college_db) or upload it to a production server with a specific username/password:
- Open the file:
config/config.php - Update the following constants to match your MySQL server details:
define('DB_HOST', 'localhost'); // Leave as localhost on most servers define('DB_USER', 'your_production_username'); define('DB_PASS', 'your_production_password'); define('DB_NAME', 'college_db'); // Name of your imported database
studentErpFin/
├── config/config.php # DB credentials, BASE_URL, session initialization
├── controller/
│ ├── AuthController.php # Secure login / logout handler
│ └── (Other operational controllers)
├── assets/
│ ├── css/custom.css # Full UI/UX Design System (Colors, layout)
│ └── js/custom.js # Sidebar toggles, flash messages, JS confirms
├── view/
│ ├── landing.php # Beautiful login page
│ ├── layout/header.php # Top navbar with drop-downs (includes CSS imports)
│ ├── layout/sidebar.php # Collapsible sidebar
│ ├── layout/footer.php # Script imports
│ ├── dashboard/index.php # Main dashboard with Chart.js stats
│ ├── students/ # SIM operations (index, add, edit, view)
│ ├── faculty/ # Staff HR operations (allocations, designations)
│ ├── institutes/ # Institute hierarchy and branches
│ ├── programs/ # Core academic hierarchy (programs, batches, subjects)
│ ├── fees/ # Fee records and receipt generation
│ ├── (And various other robust module folders...)
├── final_db_setup.sql # The REQUIRED database schema & dummy data
├── index.php # MAIN ROUTER (All traffic passes through here)
└── README.md # This file
| Category | Modules | Core Features |
|---|---|---|
| Auth & Profile | Login, Registration, Profile | Role-based registration (Student/Faculty/Admin), unified session management, and extended profile editing. |
| Overview | Dashboard, Analytics | Real-time visual metrics, KPI stat cards, charts representing system health. |
| People | Students, Faculty, Parent Portal | Full CRUD for profiles, automated ID generation, designation tracking, guardian mapping. |
| Academics | Programs, Batches, Subjects, Courses | Creating multi-year programs, assigning subjects, scheduling batches. |
| Operations | Attendance, Exams, Fees, Library | Date-based attendance filtering, fee transactions, exam scheduling, book cataloging. |
| Structure | Institutes, Departments, Branches | Useful for multi-campus management and isolating departmental data. |
| System | Communications, System Settings | Compose internal alerts/notices, manage institution name/branding dynamically. |
The system enforces strict access control at both the UI (sidebar/navbar) and the Router level (index.php):
- Admin: Full access to all modules, including Institute setup, Staff HR, and System Settings.
- Faculty: Can manage Academics (Programs, Batches, Subjects), Attendance, and Examinations. Cannot modify Institute structure or other Staff records.
- Student: View-only access to their own Performance, Attendance, and Courses. Can fully manage their own Profile. Access to management-level modules is strictly blocked.
While the current version stores profile data in the database, you can implement photo uploads by following these steps:
Add a profile_image column to your profile tables:
ALTER TABLE students ADD COLUMN profile_image varchar(255) DEFAULT 'default-avatar.png';
ALTER TABLE staff ADD COLUMN profile_image varchar(255) DEFAULT 'default-avatar.png';Create a folder named uploads/profiles/ in your project root and ensure it has write permissions (chmod 777 on Linux).
In view/system/profile.php, update the <form> tag:
<form method="POST" enctype="multipart/form-data">Add this logic to the POST handler in profile.php:
if (isset($_FILES['profile_pic']) && $_FILES['profile_pic']['error'] == 0) {
$target_dir = "uploads/profiles/";
$file_ext = pathinfo($_FILES["profile_pic"]["name"], PATHINFO_EXTENSION);
$new_name = $_SESSION['user_id'] . "_" . time() . "." . $file_ext;
$target_file = $target_dir . $new_name;
if (move_uploaded_file($_FILES["profile_pic"]["tmp_name"], $target_file)) {
// Update the DB with $new_name
}
}... (rest of the content)
The application boasts a premium, modern aesthetic using CSS variables located at the top of assets/css/custom.css.
Core Palette:
- Accent/Primary: Olive Green (
#4a7c59) - Secondary/Dark: Charcoal (
#2c3e50) - Danger/Alert: Maroon (
#800000) - Background: Soft Gray (
#f0f2f5)
Components:
- Cards: Soft drop-shadows with hover translation (lift) effects.
- Alerts: Dynamic fixed flash messages that auto-dismiss after 4 seconds using CSS animation.
- Forms: Customized border-focus rings reflecting the primary olive color instead of standard Bootstrap blue.
- SQL Injection Prevention: 100% usage of PDO Prepared Statements
prepare()andexecute(). - Cross-Site Scripting (XSS): Data printed to the HTML body is wrapped in
htmlspecialchars()to prevent malicious script injection. - Session Jacking Mitigation: Strict session tracking. No page can be loaded without
$_SESSION['user_id']being active. - Password Hashes: Raw passwords are NEVER stored in the database. PHP's robust
password_hash()(Bcrypt) andpassword_verify()are used. - Action Confirmation: JavaScript interception requires users to confirm irreversible actions (like deletes) using a
.confirm-deleteclass bind.
While the system handles data beautifully via database inputs, some aspects are designed for future scalability:
- File Uploads: The database schemas have hooks for student photos, signatures, and ID cards, but the actual file-system upload utility requires wiring up in a future update.
- Granular Role-Based Access Control (RBAC): Currently, all logged-in administrators have sweeping access. Future builds could restrict Faculty users to only view their designated class schedules or mark attendance specifically for their batches.
- Automated Exports: PDF/Excel generation for mark-sheets and fee receipts from the web views.
During development or testing, you might need to completely wipe the existing database and generate fresh, randomized test data. You can securely clear out all existing records without breaking table relationships using the following SQL snippet:
-- Disable foreign key checks to avoid constraint errors
SET FOREIGN_KEY_CHECKS = 0;
-- Truncate tables (order does not matter now)
TRUNCATE TABLE users;
TRUNCATE TABLE system_settings;
TRUNCATE TABLE institute_types;
TRUNCATE TABLE institutes;
TRUNCATE TABLE departments;
TRUNCATE TABLE branches;
TRUNCATE TABLE academic_programs;
TRUNCATE TABLE academic_batches;
TRUNCATE TABLE subjects;
TRUNCATE TABLE course_mappings;
TRUNCATE TABLE class_schedules;
TRUNCATE TABLE staff_categories;
TRUNCATE TABLE staff_designations;
TRUNCATE TABLE staff;
TRUNCATE TABLE staff_subject_allocations;
TRUNCATE TABLE staff_leave_balance;
TRUNCATE TABLE students;
TRUNCATE TABLE attendance;
TRUNCATE TABLE student_attendance_summary;
TRUNCATE TABLE examinations;
TRUNCATE TABLE student_grades;
TRUNCATE TABLE fee_transactions;
TRUNCATE TABLE communications;
TRUNCATE TABLE library_books;
-- Re-enable foreign key checks
SET FOREIGN_KEY_CHECKS = 1;If you want to quickly populate the database with extensive, customized, and realistic mock data after truncating, copy and paste the prompt below into an LLM like DeepSeek or ChatGPT.
This prompt is heavily detailed to ensure the AI explicitly matches the exact architecture of this ERP project:
"I have an extremely flexible, modular standard MySQL database for an educational Student ERP system where Admins can dynamically add, update, and delete entries. I have truncated the database and need realistic, custom testing data. Generate complete standard raw SQL
INSERT INTOstatements (use bulk inserts).Constraint Rules: Ensure every foreign key ID matches corresponding primary keys inserted in your referenced tables. Maintain sensible data logic and abide by all these table schemas and ENUM constraints:
users: generate 1 admin, 4 faculty, and 12 students. (roleENUM('admin', 'faculty', 'student'),statusENUM('active', 'suspended', '')). Use a standard valid bcrypt password hash.institutes,institute_types: Generate 1 detailed college institute.departments,branches: Map 3-4 distinct academic departments (e.g., CST, ECE) to the institute (typeENUM('academic', 'administrative', 'support')).academic_programs,academic_batches: Generate 3 academic programs (e.g. Diploma in CST) and link related active batches to them accurately.subjects,course_mappings: Generate 12 varied subjects (subject_typeENUM('core','elective','lab','project','seminar','workshop')). Map these to existing programs, batches, and assign them to generated faculty members.class_schedules: Schedule different subjects throughout the week referencing proper batch and faculty IDs.staff_categories,staff_designations: Add standard 'Teaching' & 'Non-Teaching' roles.staff: Insert your 4 faculty members and map them correctly to categories/designations. (genderENUM('male','female','other')).students: Insert the 12 generated students. You MUST tie them properly toprogram_id,batch_id, anduser_id. EnsurestatusENUM('active','inactive','graduated','suspended','discontinued','completed') is respected. Include realistic parent details.attendance,examinations,student_grades: Generate random robust attendance logs (statusENUM('present','absent','late','half_day')). Create exams and populated grading mappings for your students tied to subjects.fee_transactions: Generate fee tuition receipts mapping to students (payment_statusENUM('paid','partial','pending')).library_books,communications: Add 6-8 library books (statusENUM('active','lost','damaged','withdrawn')) and some standard notice alerts (message_typeENUM('notice','alert','email','sms')).Return ONLY valid SQL that is rigorously structured and ready to explicitly execute against the DB without throwing constraint check constraint errors."
Developed proudly with PHP 8, MySQL, and Bootstrap 5.