A comprehensive, full-stack school management system built with Laravel 11, Blade templates, and MySQL. This application provides a complete solution for managing students, teachers, courses, exams, payments, and attendance in educational institutions.
- Real-time Statistics: View total students, teachers, parents, and earnings
- Interactive Charts: Earnings, attendance, and performance analytics using Chart.js
- Event Calendar: Track upcoming exams and events
- Top Performers: Identify and track high-achieving students
- Complete CRUD operations for student records
- Student profile pages with detailed information
- Grade tracking and exam results
- Attendance monitoring
- Payment history
- Teacher profiles and schedules
- Class assignments
- Student roster management
- Attendance tracking
- Course creation and management
- Student enrollment
- Schedule management
- Course analytics
- Exam scheduling
- Result tracking
- Grade management
- Performance analytics
- Payment recording and tracking
- Multiple payment methods
- Payment history
- Receipt generation
- Daily attendance tracking
- Class-wise attendance reports
- Attendance analytics
- Laravel 11 - PHP web framework
- MySQL - Database
- Eloquent ORM - Database abstraction
- Blade Templates - Templating engine
- Blade Templates - Server-side rendering
- Tailwind CSS - Utility-first CSS framework
- Alpine.js - Lightweight JavaScript framework
- Chart.js - Data visualization
- Vite - Frontend build tool
Before you begin, ensure you have the following installed:
- PHP (v8.2 or higher) - Download
- Composer - PHP dependency manager - Download
- MySQL (v8.0 or higher) - Download
- Node.js (v16 or higher) - For frontend assets - Download
- npm or yarn - Package manager
- Git - Version control
- XAMPP (includes PHP and MySQL) - Download
git clone https://github.com/stewardobeng/school-hub.git
cd school-hubcomposer installnpm install-
Start MySQL Server
- If using XAMPP: Start MySQL from XAMPP Control Panel
- If using standalone MySQL: Ensure MySQL service is running
-
Create Database
CREATE DATABASE school_hub;
-
Configure Environment Variables
Copy the
.env.examplefile to.env:cp .env.example .env
Edit
.envwith your MySQL credentials:APP_NAME="School Hub" APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost/school-hub/public DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=school_hub DB_USERNAME=root DB_PASSWORD=your_mysql_password
-
Generate Application Key
php artisan key:generate
-
Run Database Migrations
php artisan migrate
This will create all required tables.
-
Seed Initial Data (Optional)
php artisan db:seed
This will populate the database with sample data for testing.
npm run buildOr for development with hot reload:
npm run devFor XAMPP Users:
- Start Apache and MySQL from XAMPP Control Panel
- Access the application at:
http://localhost/school-hub/public
For Laravel's Built-in Server:
php artisan serve- Access the application at:
http://localhost:8000
school-hub/
βββ app/
β βββ Http/
β β βββ Controllers/
β β βββ Admin/ # Admin controllers
β βββ Models/ # Eloquent models
β βββ Services/ # Business logic services
β
βββ database/
β βββ migrations/ # Database migrations
β βββ seeders/ # Database seeders
β
βββ resources/
β βββ views/ # Blade templates
β β βββ admin/ # Admin views
β β βββ student/ # Student views
β β βββ teacher/ # Teacher views
β β βββ components/ # Reusable components
β β βββ layouts/ # Layout templates
β βββ css/ # CSS files
β βββ js/ # JavaScript files
β
βββ routes/
β βββ web.php # Web routes
β βββ api.php # API routes
β
βββ public/ # Public assets
βββ config/ # Configuration files
βββ storage/ # Storage and logs
βββ vendor/ # Composer dependencies
http://localhost/school-hub/public/api
GET /api/students- Get all studentsGET /api/students/{id}- Get student by IDPOST /api/students- Create new studentPUT /api/students/{id}- Update studentDELETE /api/students/{id}- Delete student
GET /api/teachers- Get all teachersGET /api/teachers/{id}- Get teacher by IDPOST /api/teachers- Create new teacherPUT /api/teachers/{id}- Update teacherDELETE /api/teachers/{id}- Delete teacher
GET /api/courses- Get all coursesGET /api/courses/{id}- Get course by IDPOST /api/courses- Create new coursePUT /api/courses/{id}- Update courseDELETE /api/courses/{id}- Delete course
GET /api/exams- Get all examsGET /api/exams/{id}- Get exam by IDPOST /api/exams- Create new examPUT /api/exams/{id}- Update examDELETE /api/exams/{id}- Delete exam
GET /api/payments- Get all paymentsGET /api/payments/{id}- Get payment by IDPOST /api/payments- Create new paymentPUT /api/payments/{id}- Update paymentDELETE /api/payments/{id}- Delete payment
GET /api/attendance- Get all attendance recordsGET /api/attendance/{id}- Get attendance by IDPOST /api/attendance- Create new attendance recordPUT /api/attendance/{id}- Update attendance recordDELETE /api/attendance/{id}- Delete attendance record
GET /api/dashboard/stats- Get dashboard statistics
Success Response:
{
"success": true,
"data": { ... }
}Error Response:
{
"success": false,
"message": "Error message",
"error": "Detailed error information"
}The application uses the following main tables:
- students - Student information
- teachers - Teacher information
- courses - Course details
- exams - Exam schedules
- payments - Payment records
- attendance - Attendance records
- course_enrollments - Student-course relationships
- exam_results - Exam results
See database/migrations/ for complete schema definition.
-
Set Environment Variables:
APP_ENV=production APP_DEBUG=false APP_URL=https://your-domain.com DB_CONNECTION=mysql DB_HOST=your-database-host DB_PORT=3306 DB_DATABASE=your_database DB_USERNAME=your_username DB_PASSWORD=your_password
-
Optimize Application:
php artisan config:cache php artisan route:cache php artisan view:cache
-
Build Frontend Assets:
npm run build
-
Set Permissions:
chmod -R 775 storage bootstrap/cache
For production, consider using:
- MySQL (managed service like AWS RDS, PlanetScale, or DigitalOcean)
- PostgreSQL (requires schema migration)
# Health check
curl http://localhost/school-hub/public/api/health
# Get all students
curl http://localhost/school-hub/public/api/students
# Get all teachers
curl http://localhost/school-hub/public/api/teachersphp artisan serve- Start development serverphp artisan migrate- Run database migrationsphp artisan db:seed- Seed databasephp artisan route:list- List all routesphp artisan tinker- Interactive shell
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run preview- Preview production build
Key configuration files:
config/app.php- Application settingsconfig/database.php- Database configurationconfig/session.php- Session configuration
Frontend assets are compiled using Vite. Configuration is in vite.config.js.
-
Check MySQL is running:
# Windows (XAMPP) # Check XAMPP Control Panel # Linux/Mac sudo systemctl status mysql
-
Verify credentials in
.env:- Ensure
DB_USERNAMEandDB_PASSWORDare correct - Check
DB_HOSTandDB_PORT
- Ensure
-
Test connection:
mysql -u root -p
If you encounter permission errors:
chmod -R 775 storage bootstrap/cache-
Drop and recreate database:
DROP DATABASE school_hub; CREATE DATABASE school_hub;
-
Run migration again:
php artisan migrate:fresh --seed
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Steward Obeng
- GitHub: @stewardobeng
- Repository: school-hub
- Laravel - The PHP Framework for Web Artisans
- Tailwind CSS - A utility-first CSS framework
- Alpine.js - A minimal framework for composing JavaScript behavior
- Chart.js - Simple yet flexible JavaScript charting
For support, email your-email@example.com or open an issue in the repository.
Made with β€οΈ for educational institutions