Loading repository dataβ¦
Loading repository dataβ¦
Jeyarakavan / repository
π₯ AI-Powered Hospital Receptionist Booking System | React βοΈ | Tailwind CSS π¨ | Node.js & Express π | MongoDB π | AI Voice Recognition & NLP π€ποΈ | Smart Scheduling ποΈ | Emergency Response π | SMS/Email Automation π§ | Deployed on Vercel π
A comprehensive, production-ready Hospital Management System with AI-powered features, multi-role user management, and appointment scheduling. Built with Django REST Framework backend and React.js frontend.
AI Project For Hospital/
βββ backend/ # Django Backend
β βββ api/ # Main API app
β β βββ models.py # PostgreSQL models
β β βββ serializers.py # DRF serializers
β β βββ views.py # API views
β β βββ urls.py # URL routing
β β βββ services.py # Business logic
β β βββ permissions.py # Custom permissions
β β βββ mongodb_service.py # MongoDB operations
β βββ hospital_system/ # Django project settings
β β βββ settings.py # Django configuration
β β βββ urls.py # Root URL config
β β βββ wsgi.py # WSGI config
β βββ manage.py # Django management script
β βββ requirements.txt # Python dependencies
β βββ .env # Environment variables
β
βββ src/ # React Frontend
β βββ components/ # Reusable components
β β βββ Layout.jsx # Main layout with sidebar
β βββ pages/ # Page components
β β βββ Login.jsx # Login page
β β βββ Signup.jsx # Registration page
β β βββ Dashboard.jsx # Dashboard
β β βββ Appointments.jsx # Appointment management
β β βββ UserManagement.jsx # User management (Admin)
β β βββ DoctorManagement.jsx # Doctor list
β β βββ CallLogs.jsx # Call logs view
β β βββ Settings.jsx # Site settings - logo, banner (Admin)
β β βββ News.jsx # Hospital news (all view; Admin add/delete)
β β βββ Profile.jsx # User profile
β βββ services/ # API services
β β βββ api.js # Axios API client
β βββ context/ # React Context
β β βββ AuthContext.jsx # Authentication context
β βββ routes/ # Route components
β β βββ ProtectedRoute.jsx # Protected route wrapper
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
β
βββ package.json # Frontend dependencies
βββ vite.config.js # Vite configuration
βββ .env # Frontend environment variables
βββ README.md # This file
git clone <repository-url>
cd "AI Project For Hospital"
cd backend
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
pip install -r requirements.txt
The .env file is already created in backend/ directory. Update it with your credentials:
# Update MongoDB password
MONGODB_URI=mongodb+srv://UserName:PASSWORD@rakavan.v2vzewk.mongodb.net/
# Update PostgreSQL credentials if different
DB_PASSWORD=your_postgres_password
python manage.py makemigrations
python manage.py migrate
Option 1: Using Management Command (Recommended)
python manage.py create_admin
This will create a default admin user with:
adminadmin@hospital.comadmin123You can customize these values:
python manage.py create_admin --username myadmin --email myadmin@hospital.com --password mypassword
Option 2: Using Django's createsuperuser
python manage.py createsuperuser
Follow the prompts to create an admin account.
β οΈ Important: Change the default password after first login!
# From project root
npm install
The .env file is already created in the root directory with:
VITE_API_BASE_URL=http://localhost:8000/api
Install PostgreSQL (if not installed)
Create Database
Option A: Using PowerShell Script (Easiest)
cd backend
.\setup_database.ps1
Option B: Using SQL File
cd backend
psql -U postgres -f create_database.sql
(Enter password when prompted: 1234 based on your .env file)
Option C: Manual SQL Command
-- Connect to PostgreSQL
psql -U postgres
-- (Enter password: 1234)
-- Create database
CREATE DATABASE hospital_db;
\q
Option D: One-line Command
$env:PGPASSWORD='1234'; psql -U postgres -h localhost -c "CREATE DATABASE hospital_db;"
Note: Replace 1234 with your actual PostgreSQL password if different.
Update .env file in backend/ directory:
DB_NAME=hospital_db
DB_USER=postgres
DB_PASSWORD=your_postgres_password
DB_HOST=localhost
DB_PORT=5432
Option A: MongoDB Atlas (Cloud) - Recommended
backend/.env:MONGODB_URI=mongodb+srv://Username:YOUR_PASSWORD@rakavan.v2vzewk.mongodb.net/
MONGODB_DB_NAME=hospital_ai_logs
Replace YOUR_PASSWORD with your actual MongoDB password.
Option B: MongoDB Compass (Local)
mongodb://localhost:27017)hospital_ai_logsbackend/.env:MONGODB_URI=mongodb://localhost:27017/
MONGODB_DB_NAME=hospital_ai_logs
.env FileLocated at: backend/.env
# Django Settings
SECRET_KEY=your-secret-key-here-change-in-production
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# PostgreSQL Database
DB_NAME=hospital_db
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
# MongoDB Connection
MONGODB_URI=mongodb+srv://Username:<db_password>@rakavan.v2vzewk.mongodb.net/
MONGODB_DB_NAME=hospital_ai_logs
# JWT Settings
JWT_SECRET_KEY=your-jwt-secret-key-here
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24
# Twilio SMS Settings (Optional - for SMS notifications)
TWILIO_ACCOUNT_SID=your-twilio-account-sid
TWILIO_AUTH_TOKEN=your-twilio-auth-token
TWILIO_PHONE_NUMBER=+1234567890
# Email Settings - SendGrid (Optional - for email notifications)
SENDGRID_API_KEY=your-sendgrid-api-key
EMAIL_FROM=noreply@hospital.com
EMAIL_FROM_NAME=Hospital System
# File Upload Settings
MEDIA_ROOT=media
MAX_UPLOAD_SIZE=5242880
.env FileLocated at: .env (project root)
VITE_API_BASE_URL=http://localhost:8000/api
cd backend
python manage.py runserver
Backend will run on: http://localhost:8000
# From project root
npm run dev
Frontend will run on: http://localhost:5173 (or similar port)
If you used the create_admin management command, use these credentials:
adminadmin123admin@hospital.comβ οΈ Security Note: These are default credentials. Please change the password immediately after first login!
If you can't login:
python manage.py migratepython manage.py create_adminPOST /api/auth/register/
Content-Type: multipart/form-data
Body:
- username: string
-