[# Smart Healthcare System (Angular + Spring Boot + Python AI)
Full-stack healthcare management platform with:
- Angular 12 Frontend (patient / doctor / admin interfaces)
- Spring Boot (REST API, JWT auth, MySQL persistence)
- Python Flask AI Service (disease prediction)
- MySQL 8 Database
| Component | Tech | Default Port | Purpose |
|---|---|---|---|
| Frontend | Angular 12 | 4200 | UI for users, doctors, admin |
| Backend API | Spring Boot (Java 17) | 8081 | Auth, users, doctors, appointments, prescriptions |
| AI Service | Python Flask | 10000 | Symptom/disease prediction endpoint(s) |
| Database | MySQL 8 | 3306 | Persistent storage |
Install / verify:
- Java 17 (
java -version) - Maven 3.6+ (
mvn -v) - Node.js 16.x or 18.x LTS recommended (Angular 12 is not tested on Node 22)
(If you must use Node 22: setNODE_OPTIONS=--openssl-legacy-providerwhen running.) - Python 3.11+ (
python --version) - MySQL 8 (
mysql --version)
Python packages (will install later): flask pandas scikit-learn numpy
Smart-Health-Care-System-main/
SmartHealthcareSystem-Backend/ <- Spring Boot backend
SmartHealthCareSystem-main/ <- Angular frontend
Doctor/ <- Python AI service
To get a local copy up and running, run this command:
git clone https://github.com/Rakesh161rausahn/Angular-Spring-boot-Smart-Healthcare-System.gitLogin to MySQL and create the schema if not present:
CREATE DATABASE IF NOT EXISTS healthcaresystem;Edit SmartHealthcareSystem-Backend/src/main/resources/application.properties if you need to change credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/healthcaresystem
spring.datasource.username=root
spring.datasource.password=YOUR_PASSWORD
spring.jpa.hibernate.ddl-auto=create-drop # Dev only
Change create-drop to update or none for persistent data outside development.
Development (auto reload via devtools):
cd "Smart-Health-Care-System-main/SmartHealthcareSystem-Backend"
mvn spring-boot:runBuild executable JAR:
cd "Smart-Health-Care-System-main/SmartHealthcareSystem-Backend"
mvn clean package -DskipTests
java -jar target/HealthcareManagement-Backend-0.0.1-SNAPSHOT.jarBackend starts on: http://localhost:8081
Install dependencies (first time):
cd "Smart-Health-Care-System-main/SmartHealthCareSystem-Frontend"
$env:NODE_OPTIONS="--openssl-legacy-provider" # Only if using Node >=17
npm install --legacy-peer-depsStart dev server:
$env:NODE_OPTIONS="--openssl-legacy-provider"
npm startAccess UI: http://localhost:4200
$env:NODE_OPTIONS="--openssl-legacy-provider"
npm run build -- --configuration=productionOutput: dist/HealthCareManagement/
Serve with a simple static server (example using npx serve):
npx serve -s dist/HealthCareManagement -l 4300Visit: http://localhost:4300
Install packages (one time):
cd "Doctor"
python -m pip install --upgrade pip
pip install flask pandas scikit-learn numpyStart service:
python app.pyAI service: http://localhost:10000
Base API URL (development): http://localhost:8081
Services use an ApiConfigService (absolute URL) OR dev proxy (if re-enabled).
Key endpoints (unauthenticated):
POST /registeruser– create patientPOST /registerdoctor– create doctorPOST /loginuser– user login (returns JWT token)POST /logindoctor– doctor login (returns JWT token)
On success, frontend stores:
sessionStorage.TOKEN = Bearer <jwt>sessionStorage.USERandsessionStorage.ROLE
If duplicate user/doctor email -> backend returns 409 Conflict with plain message.
Open three PowerShell windows (or run sequentially):
- Backend:
cd "Smart-Health-Care-System-main/SmartHealthcareSystem-Backend" mvn spring-boot:run
- Frontend:
cd "Smart-Health-Care-System-main/SmartHealthCareSystem-Frontend" $env:NODE_OPTIONS="--openssl-legacy-provider" npm start
- AI Service:
cd "Doctor" python app.py
Visit http://localhost:4200 and register / login.
| Property | File | Purpose |
|---|---|---|
spring.jpa.hibernate.ddl-auto |
application.properties | Schema generation strategy |
server.port |
application.properties | Change backend port (default 8081) |
environment*.ts apiURL |
Angular environments | Frontend base API URL |
ApiConfigService |
Angular service | Central URL builder |
If you change backend port, update environment.ts & environment.prod.ts.
| Problem | Cause | Fix |
|---|---|---|
| Registration “failed” + network error to 8080 | Old hardcoded port | Ensure all services use 8081 (search for 8080) / updated env |
| Button disabled on Register | Form invalid (confirm password not bound) | Ensure confirm password uses [(ngModel)] (already fixed) |
| "User already exists" even after restart | Using update schema & row exists |
Delete row in table or switch to create-drop temporarily |
| CORS errors | Direct cross-origin calls | Run via same origin (Angular dev) or add proxy / configure CORS in backend |
| Angular build budget errors | Strict default budgets | Budgets increased in angular.json |
| Node engine warnings | Using Node 22 with Angular 12 | Use Node 16/18 LTS or keep --openssl-legacy-provider |
| SciPy / NumPy version warning | Incompatible wheel with latest NumPy | Pin versions if needed: pip install numpy==2.0.2 scipy==1.11.4 |
create-droprecreates schema each restart – do not use in production.- Admin login logic is hardcoded (email/password) – replace with secure backend verification.
- JWT tokens stored in
sessionStorage– consider HttpOnly cookies for production.
- Add HTTP interceptor to auto-attach JWT and handle 401 globally.
- Implement password hashing (BCrypt) in backend.
- Replace jQuery tab handling with pure Angular.
- Add unit tests for services and controllers.
- Dockerize all services (compose file for multi-container run).
- Add rate limiting & validation for public endpoints.
To wipe DB (dev):
TRUNCATE TABLE user;
TRUNCATE TABLE doctor;Or temporarily set spring.jpa.hibernate.ddl-auto=create-drop and restart.
Internal academic / demonstration project. Add license file if distributing.
If something fails:
- Check backend console for stack trace.
- Open browser DevTools Network tab (verify calls hit http://localhost:8081/…)
- Confirm MySQL is running and credentials correct.
- Validate Angular environment API URL.
- Run
mvn clean packageto ensure backend compiles.
Feel free to extend and optimize. Happy coding! ](https://github.com/Rakesh161rausahn/Angular-Spring-boot-Smart-Healthcare-System.git)