{"id":28359166,"url":"https://github.com/sazidulalam47/apollo-health-care-server","last_synced_at":"2026-05-08T17:34:50.317Z","repository":{"id":294027303,"uuid":"984646723","full_name":"SazidulAlam47/apollo-health-care-server","owner":"SazidulAlam47","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-06T16:23:55.000Z","size":85835,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T18:23:15.656Z","etag":null,"topics":["bcrypt","express","node-cron","nodejs","nodemailer","prisma-orm","sslcommerz-payment-gateway"],"latest_commit_sha":null,"homepage":"http://167.71.210.71:8000/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SazidulAlam47.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T09:16:27.000Z","updated_at":"2025-08-06T16:23:59.000Z","dependencies_parsed_at":"2025-08-06T18:21:50.765Z","dependency_job_id":null,"html_url":"https://github.com/SazidulAlam47/apollo-health-care-server","commit_stats":null,"previous_names":["sazidulalam47/apollo-health-care-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SazidulAlam47/apollo-health-care-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SazidulAlam47%2Fapollo-health-care-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SazidulAlam47%2Fapollo-health-care-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SazidulAlam47%2Fapollo-health-care-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SazidulAlam47%2Fapollo-health-care-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SazidulAlam47","download_url":"https://codeload.github.com/SazidulAlam47/apollo-health-care-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SazidulAlam47%2Fapollo-health-care-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32790535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcrypt","express","node-cron","nodejs","nodemailer","prisma-orm","sslcommerz-payment-gateway"],"created_at":"2025-05-28T09:09:31.809Z","updated_at":"2026-05-08T17:34:50.310Z","avatar_url":"https://github.com/SazidulAlam47.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apollo Health Care - Backend\n\nA robust and comprehensive healthcare management system backend designed to streamline communication and appointment processes between patients, doctors, and administrators.\n\n## 🏥 Overview\n\nApollo Health Care is a full-featured healthcare management platform that enables seamless interaction between different user roles while maintaining security, scalability, and reliability. The system incorporates modern technologies and follows best practices for healthcare data management.\n\n## 🚀 Technologies Used\n\n- **Node.js \u0026 Express.js** - Server-side application development\n- **TypeScript** - Type-safe JavaScript development\n- **Prisma ORM** - Database management and query builder\n- **PostgreSQL** - Primary database system\n- **WebRTC (Agora.io)** - Real-time video communication between doctors and patients\n- **JWT** - Authentication and authorization\n- **Bcrypt** - Password hashing and security\n- **Nodemailer** - Email notifications\n- **Cloudinary** - File upload and management\n- **SSLCommerz** - Payment gateway integration\n- **Node-cron** - Scheduled tasks and reminders\n- **Zod** - Runtime type validation\n\n## 📋 Features\n\n### 🔐 Authentication \u0026 Authorization\n\n- JWT-based authentication\n- Role-based access control (Super Admin, Admin, Doctor, Patient)\n- Password recovery and security features\n- Account status management\n\n### 👤 User Management\n\n- **Super Admin**: System-wide management\n- **Admin**: Doctor account management, appointment oversight\n- **Doctor**: Profile management, appointment handling, prescription generation\n- **Patient**: Registration, appointment booking, medical record management\n\n### 📅 Appointment System\n\n- Dynamic scheduling with time slot management\n- Real-time appointment booking\n- Status tracking (Scheduled, In Progress, Completed, Canceled)\n- Video consultation integration via WebRTC (Agora.io)\n- Automated reminder system\n- Payment integration with booking confirmation\n\n### 💊 Medical Records\n\n- Patient health data management\n- Medical report uploads and storage\n- Prescription generation and email delivery\n- Medical history tracking\n\n### 💳 Payment Integration\n\n- Secure payment processing via SSLCommerz\n- Automated invoice generation\n- Payment status tracking\n- Booking cancellation for unpaid appointments (30-minute window)\n\n### ⭐ Review System\n\n- Patient reviews and ratings for doctors\n- Comment system\n- Average rating calculation\n\n### 📧 Notification System\n\n- Email confirmations for appointments\n- Prescription delivery via email\n- Payment invoices\n- Automated reminders\n\n## 🏗️ Project Structure\n\n```\napollo-health-care-server/\n├── prisma/\n│   ├── schema.prisma          # Database schema\n│   └── migrations/            # Database migrations\n├── src/\n│   ├── app/\n│   │   ├── config/           # Configuration files\n│   │   ├── constants/        # Application constants\n│   │   ├── DB/              # Database utilities and seeders\n│   │   ├── errors/          # Custom error classes\n│   │   ├── interfaces/      # TypeScript interfaces\n│   │   ├── middlewares/     # Express middlewares\n│   │   ├── modules/         # Feature modules\n│   │   │   ├── admin/       # Admin management\n│   │   │   ├── appointment/ # Appointment system\n│   │   │   ├── auth/        # Authentication\n│   │   │   ├── doctor/      # Doctor management\n│   │   │   ├── patient/     # Patient management\n│   │   │   ├── payment/     # Payment processing\n│   │   │   ├── prescription/# Prescription management\n│   │   │   ├── review/      # Review system\n│   │   │   └── ...          # Other modules\n│   │   ├── routes/          # API routes\n│   │   └── utils/           # Utility functions\n│   ├── app.ts               # Express app configuration\n│   └── server.ts            # Server entry point\n├── uploads/                 # File upload directory\n└── generated/              # Prisma generated files\n```\n\n## 🛠️ Installation\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- PostgreSQL database\n- npm or yarn package manager\n\n### Setup Steps\n\n1. **Clone the repository**\n\n    ```bash\n    git clone https://github.com/SazidulAlam47/apollo-health-care-server.git\n    cd apollo-health-care-server\n    ```\n\n2. **Install dependencies**\n\n    ```bash\n    npm install\n    ```\n\n3. **Environment Configuration**\n   Create a `.env` file in the root directory:\n\n    ```env\n    NODE_ENV=development\n    PORT=5000\n    DATABASE_URL=\"postgresql://username:password@localhost:5432/ph_healthcare\"\n\n    # JWT Configuration\n    ACCESS_TOKEN_SECRET=your_access_token_secret\n    ACCESS_TOKEN_EXPIRES_IN=1h\n    REFRESH_TOKEN_SECRET=your_refresh_token_secret\n    REFRESH_TOKEN_EXPIRES_IN=7d\n    RESET_PASS_TOKEN=your_reset_password_secret\n    RESET_PASS_TOKEN_EXPIRES_IN=15m\n\n    # Frontend URL\n    CLIENT_URL=http://localhost:3000\n\n    # Email Configuration\n    NODE_MAILER_EMAIL=your_email@gmail.com\n    NODE_MAILER_PASSWORD=your_app_password\n\n    # Cloudinary Configuration\n    CLOUDINARY_NAME=your_cloudinary_name\n    CLOUDINARY_KEY=your_cloudinary_key\n    CLOUDINARY_SECRET=your_cloudinary_secret\n\n    # Payment Gateway (SSLCommerz)\n    STORE_ID=your_store_id\n    STORE_PASS=your_store_password\n\n    # Bcrypt\n    BCRYPT_SALT_ROUNDS=12\n    ```\n\n4. **Database Setup**\n\n    ```bash\n    # Generate Prisma client\n    npx prisma generate\n\n    # Run database migrations\n    npx prisma migrate dev\n    ```\n\n5. **Start the application**\n\n    ```bash\n    # Development mode\n    npm run dev\n\n    # Production mode\n    npm run build\n    npm start\n    ```\n\n## 📡 API Endpoints\n\n### Authentication\n\n- `POST /api/v1/auth/login` - User login\n- `POST /api/v1/auth/refresh-token` - Refresh access token\n- `POST /api/v1/auth/change-password` - Change password\n- `POST /api/v1/auth/forgot-password` - Forgot password\n- `POST /api/v1/auth/reset-password` - Reset password\n\n### User Management\n\n- `GET /api/v1/user/me` - Get current user profile\n- `PATCH /api/v1/user/update-profile` - Update user profile\n- `PATCH /api/v1/user/update-status` - Update user status\n\n### Doctor Management\n\n- `GET /api/v1/doctor` - Get all doctors\n- `GET /api/v1/doctor/:id` - Get doctor by ID\n- `POST /api/v1/doctor` - Create doctor (Admin only)\n- `PATCH /api/v1/doctor/:id` - Update doctor\n- `DELETE /api/v1/doctor/:id` - Delete doctor\n\n### Patient Management\n\n- `GET /api/v1/patient` - Get all patients\n- `GET /api/v1/patient/:id` - Get patient by ID\n- `POST /api/v1/patient` - Create patient\n- `PATCH /api/v1/patient/:id` - Update patient\n\n### Appointment Management\n\n- `GET /api/v1/appointment` - Get appointments\n- `POST /api/v1/appointment` - Create appointment\n- `PATCH /api/v1/appointment/:id` - Update appointment status\n- `GET /api/v1/appointment/my-appointments` - Get user's appointments\n\n### Payment\n\n- `POST /api/v1/payment/init` - Initialize payment\n- `POST /api/v1/payment/ipn` - Payment IPN handler\n\n### Schedules\n\n- `GET /api/v1/schedule` - Get available schedules\n- `POST /api/v1/schedule` - Create schedule\n- `GET /api/v1/doctor-schedule` - Get doctor schedules\n- `POST /api/v1/doctor-schedule` - Create doctor schedule\n\n## 🗃️ Database Schema\n\nThe application uses PostgreSQL with Prisma ORM. Key models include:\n\n- **User** - Base user authentication\n- **Admin** - Administrator profiles\n- **Doctor** - Doctor profiles with specialties\n- **Patient** - Patient profiles with health data\n- **Appointment** - Appointment management\n- **Schedule** - Time slot management\n- **Payment** - Payment tracking\n- **Prescription** - Medical prescriptions\n- **Review** - Doctor reviews and ratings\n- **Specialties** - Medical specialties\n\n## 🔧 Scripts\n\n```bash\nnpm run dev          # Start development server\nnpm run build        # Build for production\nnpm start           # Start production server\nnpm run lint        # Run ESLint\nnpm run format      # Format code with Prettier\n```\n\n## 🚦 Development Guidelines\n\n### Code Style\n\n- TypeScript for type safety\n- ESLint for code linting\n- Prettier for code formatting\n- Modular architecture with feature-based organization\n\n### Error Handling\n\n- Global error handler middleware\n- Custom error classes for different scenarios\n- Proper HTTP status codes\n- Structured error responses\n\n### Security\n\n- JWT token validation\n- Password hashing with bcrypt\n- CORS configuration\n- Input validation with Zod\n- SQL injection prevention with Prisma\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazidulalam47%2Fapollo-health-care-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsazidulalam47%2Fapollo-health-care-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazidulalam47%2Fapollo-health-care-server/lists"}