A modern and comprehensive hospital management system. This project is a full-stack web application developed to manage hospital operations efficiently.
This hospital management system is designed to efficiently manage hospital staff, patients, equipment, appointments, surgeries, and other related tasks. Built with modern web technologies, it features a user-friendly interface and a powerful backend API that simplifies hospital management.
- Patient Management: Patient registration, information updates, and tracking system
- Staff Management: Doctor, nurse, and other staff management
- Appointment System: Automated appointment scheduling and management
- Surgery Management: Surgery planning and team management
- Room and Equipment Tracking: Hospital rooms and medical equipment management
- Medication Management: Drug inventory tracking and prescription management
- Laboratory Tests: Test results and reporting
- Insurance Management: Patient insurance information tracking
- Complaint Management: Patient complaints and feedback system
- Analytics and Reporting: Detailed analysis and reporting tools
- Modern and responsive design
- Dark/Light theme support
- Turkish and English language support
- User-friendly dashboard
- Real-time notifications
- Next.js 15 - React framework
- TypeScript - Type safety
- HeroUI v2 - Modern UI components
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animations
- React Hook Form - Form management
- Axios - HTTP client
- next-themes - Theme management
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication
- bcrypt - Password hashing
- Swagger - API documentation
- CORS - Cross-origin resource sharing
To run this project, you need the following software installed:
git clone https://github.com/xrenata/hospital.git
cd hospitalcd server
npm installMake sure MongoDB is running on your system. The application will automatically create the database if it doesn't exist.
Create a .env file in the server directory:
# Database Variables
MONGODB_URI=mongodb://localhost:27017/hospital_management
# Express Variables
HOST=localhost
PORT=3000
JWT_SECRET=your-secret-key
cd ../client
pnpm installCreate a .env.local file in the client directory:
NEXT_PUBLIC_API_URL=http://localhost:3000/api
cd server
npm run devThe backend server will run at http://localhost:3000.
cd client
pnpm devThe frontend application will run at http://localhost:3001.
The project uses MongoDB with Mongoose schemas for data modeling. Key collections include:
- Patients: Patient information and medical history
- Staff: Hospital staff and personnel data
- Departments: Hospital departments and their details
- Appointments: Patient appointment scheduling
- Surgeries: Surgery planning and management
- Medications: Drug inventory and prescriptions
- Rooms: Hospital room management
- Equipment: Medical equipment tracking
| HTTP Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Create a new user |
| POST | /api/auth/login |
User login |
| HTTP Method | Endpoint | Description |
|---|---|---|
| GET | /api/hospitals |
Get all hospitals |
| GET | /api/hospitals/{hospital_id} |
Get specific hospital |
| POST | /api/hospitals |
Create new hospital |
| PUT | /api/hospitals/{hospital_id} |
Update hospital information |
| DELETE | /api/hospitals/{hospital_id} |
Delete hospital |
| HTTP Method | Endpoint | Description |
|---|---|---|
| GET | /api/patients |
Get all patients |
| GET | /api/patients/{patient_id} |
Get specific patient |
| POST | /api/patients |
Register new patient |
| PUT | /api/patients/{patient_id} |
Update patient information |
| DELETE | /api/patients/{patient_id} |
Delete patient |
| HTTP Method | Endpoint | Description |
|---|---|---|
| GET | /api/appointments |
Get all appointments |
| GET | /api/appointments/{appointment_id} |
Get specific appointment |
| POST | /api/appointments |
Create new appointment |
| PUT | /api/appointments/{appointment_id} |
Update appointment information |
| DELETE | /api/appointments/{appointment_id} |
Delete appointment |
| HTTP Method | Endpoint | Description |
|---|---|---|
| GET | /api/surgeries |
Get all surgeries |
| GET | /api/surgeries/{surgery_id} |
Get specific surgery |
| POST | /api/surgeries |
Create new surgery |
| PUT | /api/surgeries/{surgery_id} |
Update surgery information |
| DELETE | /api/surgeries/{surgery_id} |
Delete surgery |
| HTTP Method | Endpoint | Description |
|---|---|---|
| GET | /api/staff |
Get all staff members |
| GET | /api/staff/{staff_id} |
Get specific staff member |
| POST | /api/staff |
Add new staff member |
| PUT | /api/staff/{staff_id} |
Update staff information |
| DELETE | /api/staff/{staff_id} |
Delete staff member |
- Rooms:
/api/rooms - Medications:
/api/medications - Insurance:
/api/insurance - Visits:
/api/visits - Prescriptions:
/api/prescriptions - Shifts:
/api/shifts - Feedback:
/api/feedback - Complaints:
/api/complaints - Equipment:
/api/equipment - Tests:
/api/tests - Treatments:
/api/treatments - Departments:
/api/departments - Analytics:
/api/analytics - Reports:
/api/reports
Swagger Documentation: You can access the complete API documentation at Swagger on your local environment.
hospital/
βββ client/ # Frontend (Next.js)
β βββ app/ # Next.js app directory
β β βββ dashboard/ # Dashboard pages
β β βββ login/ # Login page
β β βββ layout.tsx # Main layout
β βββ components/ # React components
β βββ config/ # Configuration files
β βββ contexts/ # React contexts
β βββ lib/ # Helper functions
β βββ locales/ # Language files
β βββ styles/ # CSS files
β βββ types/ # TypeScript types
βββ server/ # Backend (Node.js)
β βββ src/
β β βββ Controllers/ # Business logic controllers
β β βββ Routes/ # API endpoint routes
β β βββ Modules/ # Helper modules
β β βββ Database/ # MongoDB models and connection
β βββ scripts/ # Database scripts
β βββ app.js # Main application file
βββ README.MD # This file
| Variable Name | Description | Example Value |
|---|---|---|
MONGODB_URI |
MongoDB connection string | mongodb://localhost:27017/hospital_management |
HOST |
Express server host address | localhost |
PORT |
Express server port | 3000 |
JWT_SECRET |
JWT signature key | your-secret-key |
| Variable Name | Description | Example Value |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API URL | http://localhost:3000/api |
To automatically populate the database with sample data:
cd server
npm run seedThe application will automatically create the MongoDB database and collections when it first connects.
- Fork this repository
- Create a new branch:
git checkout -b feature/new-feature - Make your changes and commit them:
git commit -m 'Add new feature' - Push your branch:
git push origin feature/new-feature - Open a Pull Request
This project is licensed under the MIT License.
If you encounter any issues or have suggestions, feel free to reach out to the developers:
This project was developed using the following open-source projects: