A modern, responsive, and intuitive web application for managing student records, built with Laravel 10, Bootstrap 5, JavaScript (Fetch API), and SweetAlert2.
- Overview
- Key Features
- Tech Stack
- System Architecture & Routes
- Database Schema
- Installation & Getting Started
- Directory Structure
- Screenshots & UI Workflow
- Author & Acknowledgements
- License
The Student Management System (SM) provides administrative staff and educators with an effortless, single-dashboard interface to create, browse, view, update, and delete student profiles.
Rather than redirecting users across separate pages for each operation, the application leverages Bootstrap modals, asynchronous AJAX calls via JavaScript Fetch API, and SweetAlert2 interactive dialogs to provide a seamless Single-Page Application (SPA)-like experience.
- ⚡ Modal-Based Student Registration:
- Add new students directly from the dashboard via a clean modal popup.
- 🔄 Asynchronous Live Edit & Update:
- Dynamically fetches student edit forms into a modal via AJAX.
- Submits updates asynchronously with JSON validation feedback and auto-refresh upon success.
- 👁️ Student Profile Preview:
- Quick-view modal showcasing student details, initial avatar, contact info, and enrolled course.
- 🗑️ Safe & Interactive Deletion:
- SweetAlert2 prompt to confirm deletion before removing a student.
- Deletes the record asynchronously via HTTP
DELETEand dynamically removes the row from the table without full page reload. - Displays instant toast notification upon successful deletion.
- 🔍 Client-Side Instant Search:
- Real-time search filtering on the table as you type (matches name, email, age, or course).
- 🛡️ Server-Side Validation:
- Validates input fields (e.g. required name, unique email exception for existing records, age bounds).
- Backend:
- PHP 8.1+
- Laravel 10.x (MVC Architecture & Eloquent ORM)
- Frontend:
- Blade Templating Engine
- Bootstrap 5 (Responsive UI & Modals)
- SweetAlert2 (Alerts, confirmations & toasts)
- Vanilla JavaScript (Fetch API, DOM manipulation)
- Database:
- MySQL / MariaDB (Supports SQLite / PostgreSQL via Laravel database drivers)
- Package Management:
All routes are handled through the AdminController:
| Method | URI | Action | Description |
|---|---|---|---|
GET |
/ or /list |
AdminController@list |
Renders main dashboard listing all students |
POST |
/list |
AdminController@store |
Stores a newly registered student |
GET |
/view-form/{id} |
AdminController@viewForm |
Returns partial view with student profile card |
GET |
/update-form/{id} |
AdminController@editForm |
Returns edit form partial loaded dynamically into the modal |
POST |
/update |
AdminController@update |
Validates and updates student record (returns JSON response) |
DELETE |
/list/{id} |
AdminController@delete |
Deletes a student record (returns JSON response) |
| Column | Type | Constraints / Attributes | Description |
|---|---|---|---|
id |
BIGINT UNSIGNED |
PRIMARY KEY, AUTO_INCREMENT |
Unique identifier |
name |
VARCHAR(255) |
NOT NULL |
Full name of the student |
email |
VARCHAR(255) |
UNIQUE, NOT NULL |
Student email address |
age |
INTEGER |
NOT NULL |
Student age |
course |
VARCHAR(255) |
NOT NULL |
Enrolled course / department |
created_at |
TIMESTAMP |
NULLABLE |
Record creation timestamp |
updated_at |
TIMESTAMP |
NULLABLE |
Record last update timestamp |
Follow these step-by-step instructions to set up the project locally:
Ensure you have the following installed on your machine:
- PHP >= 8.1
- Composer (Latest version)
- MySQL / MariaDB (e.g. via XAMPP, WampServer, or native installation)
- Git
git clone https://github.com/Sandun007/SM.git
cd SMcomposer installCopy the .env.example file to create your .env configuration:
cp .env.example .env(On Windows PowerShell, use copy .env.example .env)
Open .env in your editor and configure your database settings:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=sm_database
DB_USERNAME=root
DB_PASSWORD=Note: Make sure to create the database in MySQL (e.g.
sm_database) before running migrations.
php artisan key:generatephp artisan migrateStart the Laravel local development server:
php artisan serveAccess the application in your web browser at:
http://127.0.0.1:8000
SM/
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── AdminController.php # Main controller handling CRUD operations
│ └── Models/
│ └── Student.php # Student Eloquent model ($fillable defined)
├── database/
│ └── migrations/
│ └── 2025_11_14_021340_create_students_table.php
├── public/
│ └── assets/ # Bootstrap CSS and JS bundles
├── resources/
│ └── views/
│ ├── component/
│ │ └── navbar.blade.php # Top navigation bar
│ ├── partials/
│ │ └── view-student.blade.php # Student detail profile modal
│ ├── list.blade.php # Main dashboard with table & modals
│ ├── register.blade.php # Registration form component
│ └── update.blade.php # Edit form loaded via AJAX
├── routes/
│ └── web.php # Web route definitions
├── .env.example
├── composer.json
└── README.md
Developed by Sandun007
- GitHub: @Sandun007
- Email: sandungithub007@gmail.com
This project is open-sourced software licensed under the MIT License.