这是indexloc提供的服务,不要输入任何密码
Skip to content

VoHaik/School-Medical-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 

Repository files navigation

School Health Management System

A comprehensive health management system for schools, featuring a React frontend, Node.js backend, and Java Spring Boot API.

Project Structure

  • frontend/: React frontend application
  • backend/: Java Spring Boot API
  • scripts/: Database and system administration scripts

User Accounts

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.

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)
  • Java JDK 11 or higher
  • Maven

Setup and Installation

1. Clone the repository

git clone https://github.com/yourusername/SWP391-Project.git
cd SWP391-Project

2. Set up the Java backend

mvn clean install

3. Set up the React frontend

cd frontend
npm install

4. Set up the Node.js backend

cd ../backend
npm install

Running the Application

Quick Start (Windows)

For Windows users, we've provided convenient batch scripts to start the application:

Option 1: Start everything with a single command

start-all.bat

This will start all components of the application (Java API, Node.js server, and React frontend) in separate windows.

Option 2: Start components individually

  1. To start the backend services (Java API and Node.js server):

    start-backend.bat
    
  2. To start the React frontend:

    start-frontend.bat
    
  3. Access the application:

Manual Setup

If you prefer to start the services manually, follow these steps:

1. Start the Java backend

mvn spring-boot:run

This will start the Java Spring Boot API on port 8080.

2. Build the React frontend

cd frontend
npm run build

This will create a production build of the React application in the frontend/build directory.

3. Start the Node.js backend

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.

4. Access the application

Open your browser and navigate to http://localhost:5000 to access the application.

Development Mode

Running the React frontend in development mode

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.

Running the Node.js backend in development mode

cd backend
npm run dev

This will start the Node.js server with nodemon, which will automatically restart the server when changes are detected.

Features

  • User authentication (login, registration)
  • Student profile management
  • Student blog
  • Health documentation
  • Responsive design

Technologies Used

  • 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

Troubleshooting

Common Issues

"localhost refused to connect" Error

If you encounter a "localhost refused to connect" error when trying to access the application:

  1. Wait for initialization: The services might still be starting up. Wait a minute and try again.

  2. 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
  3. Verify ports are available: Make sure no other applications are using ports 3000, 5000, or 8080.

  4. Set PORT environment variable: If the React app isn't starting on port 3000, explicitly set the PORT:

    set PORT=3000
    npm start
    
  5. Restart the application: Close all command windows and run the start scripts again.

  6. 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
    

Database Connection Issues

If you encounter database connection issues:

  1. Verify MySQL is running: Make sure your MySQL server is running on port 3306.

  2. Check database credentials: Verify that the username and password in application.properties match your MySQL credentials.

  3. Create the database: Make sure the school_health_db database exists:

    CREATE DATABASE school_health_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •