A modern React application for managing student records securely.
Includes a login page, and allows users to add, edit, delete, and select students.
Demonstrates React Hooks, component composition, form handling, dynamic table updates, localStorage persistence, and responsive UI design using Tailwind CSS and Material-UI.
- Responsive login page with username and password fields.
- Inline validation for empty or invalid credentials.
- Focus handling for empty inputs.
- Navigate to the main student table after successful login.
- Reusable components:
InputField,ErrorMessage,SignInButton.
- Add new students with roll number, name, semester, and department.
- Edit student details directly in table cells.
- Delete single or multiple selected students.
- Checkbox selection for all or individual rows.
- Persistent data saved in localStorage.
- Reusable components:
InputRow,ActionButtons,StudentGrid.
- Fully responsive design with Tailwind CSS.
- Clean, user-friendly layout for table and forms.
- Material-UI DataGrid for enhanced table experience.
| Category | Technology | Purpose |
|---|---|---|
| Frontend Framework | React.js (Hooks) | Component-based UI and state handling |
| Styling | Tailwind CSS | Responsive modern design |
| UI Components | Material-UI (MUI) | DataGrid and form elements |
| Routing | React Router | Navigation between login and student pages |
| Icons | React Icons | Action buttons and visual elements |
| Storage | localStorage API | Persistent student data |
| Logic | JavaScript (ES6+) | Form handling, table updates, validation |
*Responsive login form with username, password, and sign-in button.*
*Editable table with checkboxes for selection and action buttons.*
*Add new student rows and delete selected rows dynamically.*
git clone https://github.com/SaraSalah1/react-student-datagrid.gitcd react-student-datagrid# Using npm
npm install
# Using yarn
yarn install# Using npm
npm start
# Using yarn
yarn starthttp://localhost:3000
- Enter username:
sara. - Enter password:
1234. - Click Sign In to navigate to the student management page.
- Inline error messages appear for invalid inputs.
- Fill in Full Name, Semester, and Department, then click Add Student.
- Select one or multiple students using checkboxes, then click Delete Selected.
- Edit table cells directly for quick updates.
- All changes are automatically saved in localStorage.
const handleChange = (e) => {
setInputs({ ...inputs, [e.target.name]: e.target.value });
setError("");
};const handleSignIn = () => {
if (!inputs.user) return userRef.current.focus();
if (!inputs.password) return passwordRef.current.focus();
let msg = "";
if (inputs.user !== savedUsername) msg += "Invalid username. ";
if (inputs.password !== savedPassword) msg += "Invalid password.";
if (msg) {
setError(msg);
return;
}
navigate("/home");
};const saveNewRow = () => {
if (!newRow.name) return nameRef.current.focus();
if (!newRow.semester) return semesterRef.current.focus();
if (!newRow.department) return departmentRef.current.focus();
let newRoll;
do {
newRoll = Math.floor(Math.random() * 10000);
} while (rows.some((r) => r.roll === newRoll));
setRows([{ roll: newRoll, ...newRow }, ...rows]);
setNewRow({ name: "", semester: "", department: "" });
setIsAddingRow(false);
};const deleteSelected = () => {
setRows(rows.filter((r) => !selectionModel.includes(r.roll)));
setSelectionModel([]);
};- Fork the repository.
- Create a feature branch:
git checkout -b feature/YourFeature- Commit your changes:
git commit -m "Add some feature"- Push branch:
git push origin feature/YourFeature- Open a Pull Request.
๐ฉโ๐ป Author: Sara Salah
๐ฆ Project Repository: react-student-datagrid
This project is licensed under the MIT License