A comprehensive full-stack web application designed to streamline school administration and management. This platform allows users to register, authenticate, and manage school information efficiently, including detailed profiles and image uploads.
- User Authentication: Secure registration, login, and logout functionality with password hashing
- School Registration: Add new schools with comprehensive details including name, address, contact information, and image uploads
- School Directory: View all registered schools with their details and uploaded images
- Responsive Design: Mobile-friendly interface built with Bootstrap
- File Upload: Support for school image uploads using Multer
- RESTful API: Well-structured backend API for all operations
- Database Integration: MySQL database with proper schema design
- React - Component-based UI library
- React Router - Client-side routing
- Bootstrap - Responsive CSS framework
- Axios - HTTP client for API requests
- React Hook Form - Form handling and validation
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MySQL2 - MySQL database driver
- bcryptjs - Password hashing
- Multer - File upload middleware
- CORS - Cross-origin resource sharing
- Vite - Fast build tool and development server
- ESLint - Code linting
- npm - Package management
Before running this application, make sure you have the following installed:
- Node.js (version 16 or higher)
- MySQL (version 8.0 or higher)
- npm or yarn package manager
-
Clone the repository:
git clone <repository-url> cd school-management
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and configure your database connection:DB_HOST=localhost DB_USER=your_mysql_username DB_PASSWORD=your_mysql_password DB_NAME=schoolDB
-
Create the database: Log into your MySQL shell and run:
CREATE DATABASE IF NOT EXISTS schoolDB;
-
Run the database schema: Execute the SQL commands from
database.sqlin your MySQL client or run:mysql -u your_username -p schoolDB < database.sqlThis will create the necessary tables:
users- Stores user account informationschools- Stores school details and image references
-
Start the development server:
npm run dev
This will start the Vite development server on
http://localhost:5173 -
Start the backend server: In a separate terminal:
node server.js
The backend will run on
http://localhost:3001 -
Access the application: Open your browser and navigate to
http://localhost:5173
- Register/Login: Create an account or log in with existing credentials
- Dashboard: Access the main dashboard with quick actions
- Add School: Fill out the school registration form with required details and upload an image
- View Schools: Browse all registered schools with their information and images
POST /api/register- Register a new user- Body:
{ username, email, password }
- Body:
POST /api/login- User login- Body:
{ username, password }
- Body:
POST /api/logout- User logout
POST /api/addSchool- Add a new school (requires authentication)- Form data:
name, address, city, state, contact, email_id, image
- Form data:
GET /api/getSchools- Retrieve all schools (requires authentication)- Returns: Array of school objects with image URLs
GET /api/purchase-orders- Fetch sample data from JSONPlaceholder API
school-management/
├── public/
│ └── schoolImages/ # Uploaded school images
├── src/
│ ├── components/ # React components
│ │ ├── AddSchool.jsx # School registration form
│ │ ├── ShowSchools.jsx # Schools listing page
│ │ ├── Login.jsx # User login form
│ │ ├── Register.jsx # User registration form
│ │ ├── Home.jsx # Landing/dashboard page
│ │ ├── Navigation.jsx # Navigation bar
│ │ ├── About.jsx # About page
│ │ └── Footer.jsx # Footer component
│ ├── App.jsx # Main app component
│ ├── main.jsx # React entry point
│ └── index.css # Global styles
├── lib/
│ └── db.js # Database connection utilities
├── server.js # Express server
├── database.sql # Database schema
├── package.json # Project dependencies
├── vite.config.js # Vite configuration
└── README.md # Project documentation
- 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 - see the LICENSE file for details.
For support or questions, please open an issue in the repository or contact the development team.
Note: This application is for educational and demonstration purposes. Ensure proper security measures are implemented before deploying to production.