A comprehensive health management system for schools, featuring a React frontend, Node.js backend, and Java Spring Boot API.
frontend/
: React frontend applicationbackend/
: Java Spring Boot APIscripts/
: Database and system administration scripts
The system includes predefined user accounts for different roles:
Role | Username | Password | Access Rights |
---|---|---|---|
Admin | admin.user | Password123 | Full system access, user management |
Nurse | nurse.johnson | Password123 | Medical records, health checkups, medications |
Manager | manager.davis | Password123 | Reports, statistics, system configuration |
Parent | parent.smith | Password123 | Child health records, consent forms |
These accounts are automatically created when the backend application starts. For more details on user account management, see User Account Management Guide.
- Node.js (v14 or higher)
- npm (v6 or higher)
- Java JDK 11 or higher
- Maven
git clone https://github.com/yourusername/SWP391-Project.git
cd SWP391-Project
mvn clean install
cd frontend
npm install
cd ../backend
npm install
For Windows users, we've provided convenient batch scripts to start the application:
start-all.bat
This will start all components of the application (Java API, Node.js server, and React frontend) in separate windows.
-
To start the backend services (Java API and Node.js server):
start-backend.bat
-
To start the React frontend:
start-frontend.bat
-
Access the application:
- Frontend (development mode): http://localhost:3000
- Backend API: http://localhost:8080
- Node.js server: http://localhost:5000
If you prefer to start the services manually, follow these steps:
mvn spring-boot:run
This will start the Java Spring Boot API on port 8080.
cd frontend
npm run build
This will create a production build of the React application in the frontend/build
directory.
cd ../backend
npm start
This will start the Node.js server on port 5000, which will serve the React frontend and proxy API requests to the Java backend.
Open your browser and navigate to http://localhost:5000
to access the application.
cd frontend
npm start
This will start the React development server on port 3000. The React development server will proxy API requests to the Java backend.
cd backend
npm run dev
This will start the Node.js server with nodemon, which will automatically restart the server when changes are detected.
- User authentication (login, registration)
- Student profile management
- Student blog
- Health documentation
- Responsive design
-
Frontend:
- React
- React Router
- Axios
- Tailwind CSS
- Font Awesome
-
Backend:
- Node.js
- Express
- http-proxy-middleware
-
API:
- Java Spring Boot
- Spring Security
- JPA/Hibernate
- MySQL
If you encounter a "localhost refused to connect" error when trying to access the application:
-
Wait for initialization: The services might still be starting up. Wait a minute and try again.
-
Check command windows: Look at the command windows for any error messages. If you see errors:
- For frontend issues: Check if there are any dependency or compilation errors
- For backend issues: Check if the ports are already in use or if there are database connection issues
-
Verify ports are available: Make sure no other applications are using ports 3000, 5000, or 8080.
-
Set PORT environment variable: If the React app isn't starting on port 3000, explicitly set the PORT:
set PORT=3000 npm start
-
Restart the application: Close all command windows and run the start scripts again.
-
Clear node_modules: If you're experiencing dependency issues:
cd frontend rd /s /q node_modules npm install
cd backend rd /s /q node_modules npm install
If you encounter database connection issues:
-
Verify MySQL is running: Make sure your MySQL server is running on port 3306.
-
Check database credentials: Verify that the username and password in
application.properties
match your MySQL credentials. -
Create the database: Make sure the
school_health_db
database exists:CREATE DATABASE school_health_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
This project is licensed under the MIT License - see the LICENSE file for details.