{"id":18936423,"url":"https://github.com/sinanptm/hospital-management-system","last_synced_at":"2025-04-15T18:31:33.902Z","repository":{"id":253222880,"uuid":"842839919","full_name":"sinanptm/hospital-management-system","owner":"sinanptm","description":"A secure, real-time platform for video consultations, AI insights, chat, notifications, appointment bookings, and file uploads with seamless payment integration and build using clean architecture and solid princliples","archived":false,"fork":false,"pushed_at":"2025-01-28T13:39:30.000Z","size":48438,"stargazers_count":24,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T00:41:12.238Z","etag":null,"topics":["ai","appointment-booking","aws-s3","clean-architecture","expressjs","gemini-api","hospital-management-system","jwt","mongodb","nextjs","nodejs","nodemailer","oath2","solid-principles","stripe","tailwindcss","typescript","webhook","winston"],"latest_commit_sha":null,"homepage":"https://avm-ayurvedic.online","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/sinanptm.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}},"created_at":"2024-08-15T07:50:19.000Z","updated_at":"2025-03-23T16:45:45.000Z","dependencies_parsed_at":"2024-08-15T10:20:02.561Z","dependency_job_id":"d3e9e6a1-d986-4c9a-90d9-8c3395235435","html_url":"https://github.com/sinanptm/hospital-management-system","commit_stats":null,"previous_names":["sinanptm/avm-care","sinanptm/avm-ayurvedic","sinanptm/hospital-management-system"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fhospital-management-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fhospital-management-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fhospital-management-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fhospital-management-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinanptm","download_url":"https://codeload.github.com/sinanptm/hospital-management-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129102,"owners_count":21217284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ai","appointment-booking","aws-s3","clean-architecture","expressjs","gemini-api","hospital-management-system","jwt","mongodb","nextjs","nodejs","nodemailer","oath2","solid-principles","stripe","tailwindcss","typescript","webhook","winston"],"created_at":"2024-11-08T12:07:26.609Z","updated_at":"2025-04-15T18:31:28.892Z","avatar_url":"https://github.com/sinanptm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🌿 AVM Ayurvedic\n*Bridging ancient Ayurvedic wisdom with modern technology*\n\n\n[![Website](https://img.shields.io/badge/🌐_Website-Visit_Our_Site-brightgreen?style=for-the-badge\u0026logoColor=white)](https://avm-ayurvedic.online)\n[![Frontend](https://img.shields.io/badge/▲_Frontend-Vercel-black?style=for-the-badge\u0026logo=vercel)](https://avm-ayurvedic.online)\n[![Backend](https://img.shields.io/badge/🚀_Backend-AWS-orange?style=for-the-badge\u0026logo=amazon-aws)](https://api.avm-ayurvedic.online)\n\n\u003c/div\u003e\n\n---\n\n## 🚀 Key Features\n\n📹 Video Consultations | 🤖 AI-Powered Wellness | 📅 Smart Booking | 💳 Secure Payments\n:---: | :---: | :---: | :---:\n📊 Admin Dashboard | 🔔 Real-time Notifications | 🔐 Robust Authentication | 🖼️ Secure File Uploads\n\n---\n## 💻 Tech Stack\n\n\u003cdetails\u003e\n\u003csummary\u003e🎨 Frontend\u003c/summary\u003e\n\n![Next JS](https://img.shields.io/badge/Next.js-black?style=flat\u0026logo=next.js)\n![TypeScript](https://img.shields.io/badge/TypeScript-%23007ACC.svg?style=flat\u0026logo=typescript\u0026logoColor=white)\n![React](https://img.shields.io/badge/React-%2320232a.svg?style=flat\u0026logo=react\u0026logoColor=%2361DAFB)\n![TailwindCSS](https://img.shields.io/badge/Tailwind-%2338B2AC.svg?style=flat\u0026logo=tailwind-css\u0026logoColor=white)\n![Radix UI](https://img.shields.io/badge/Radix_UI-%231A1A1A.svg?style=flat\u0026logo=radix-ui\u0026logoColor=white)\n![Socket.io-client](https://img.shields.io/badge/Socket.io--client-black?style=flat\u0026logo=socket.io\u0026logoColor=white)\n![WebRTC](https://img.shields.io/badge/WebRTC-333333?style=flat\u0026logo=webrtc\u0026logoColor=white)\n![Simple Peer](https://img.shields.io/badge/Simple_Peer-4A154B?style=flat\u0026logo=webrtc\u0026logoColor=white)\n![OAuth](https://img.shields.io/badge/OAuth-3C78A9?style=flat\u0026logo=oauth\u0026logoColor=white)  \n![Google](https://img.shields.io/badge/Google-4285F4?style=flat\u0026logo=google\u0026logoColor=white)\n![Axios](https://img.shields.io/badge/Axios-5A29E3?style=flat\u0026logo=axios\u0026logoColor=white)\n![React Query](https://img.shields.io/badge/React_Query-FF4154?style=flat\u0026logo=react-query\u0026logoColor=white)\n![Stripe](https://img.shields.io/badge/Stripe-008CDD?style=flat\u0026logo=stripe\u0026logoColor=white)\n![Firebase](https://img.shields.io/badge/Firebase-FFCA28?style=flat\u0026logo=firebase\u0026logoColor=black)\n![Framer Motion](https://img.shields.io/badge/Framer_Motion-0055FF?style=flat\u0026logo=framer\u0026logoColor=white)\n![Zod](https://img.shields.io/badge/Zod-3E67B1?style=flat\u0026logo=zod\u0026logoColor=white)\n![React Hook Form](https://img.shields.io/badge/React_Hook_Form-EC5990?style=flat\u0026logo=reacthookform\u0026logoColor=white)\n![Recharts](https://img.shields.io/badge/Recharts-%2348A9E6.svg?style=flat\u0026logo=recharts\u0026logoColor=white)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e⚙️ Backend\u003c/summary\u003e\n\n![Node.js](https://img.shields.io/badge/Node.js-6DA55F?style=flat\u0026logo=node.js\u0026logoColor=white)\n![Express.js](https://img.shields.io/badge/Express.js-%23404d59.svg?style=flat\u0026logo=express\u0026logoColor=%2361DAFB)\n![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=flat\u0026logo=mongodb\u0026logoColor=white)\n![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=flat\u0026logo=amazon-aws\u0026logoColor=white)\n![Stripe](https://img.shields.io/badge/Stripe-%236464FF.svg?style=flat\u0026logo=stripe\u0026logoColor=white)\n![JWT](https://img.shields.io/badge/JWT-black?style=flat\u0026logo=JSON%20web%20tokens)\n![NGINX](https://img.shields.io/badge/NGINX-%23009639.svg?style=flat\u0026logo=nginx\u0026logoColor=white)\n![Socket.io](https://img.shields.io/badge/Socket.io-black?style=flat\u0026logo=socket.io\u0026badgeColor=010101)\n![Google AI](https://img.shields.io/badge/Google_AI-4285F4?style=flat\u0026logo=google\u0026logoColor=white)\n![Joi](https://img.shields.io/badge/Joi-0080FF?style=flat\u0026logo=joi\u0026logoColor=white)\n![Winston](https://img.shields.io/badge/Winston-231F20?style=flat\u0026logo=winston\u0026logoColor=white)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🛠 DevOps \u0026 Tools\u003c/summary\u003e\n\n![SEO](https://img.shields.io/badge/SEO-4CAF50?style=flat\u0026logo=google\u0026logoColor=white)\n![Google Analytics](https://img.shields.io/badge/Google%20Analytics-E37400?style=flat\u0026logo=google-analytics\u0026logoColor=white)\n![Vercel Analytics](https://img.shields.io/badge/Vercel%20Analytics-E37400?style=flat\u0026logo=google-analytics\u0026logoColor=white)\n![Open Graph](https://img.shields.io/badge/Open%20Graph-008000?style=flat\u0026logo=facebook\u0026logoColor=white)\n![Twitter Card](https://img.shields.io/badge/Twitter%20Card-1DA1F2?style=flat\u0026logo=twitter\u0026logoColor=white)\n![Figma](https://img.shields.io/badge/figma-%23F24E1E.svg?style=flat\u0026logo=figma\u0026logoColor=white)\n![Clean Architecture](https://img.shields.io/badge/Clean_Architecture-%230D6EFD.svg?style=flat\u0026logo=architecture\u0026logoColor=white)\n![SOLID Principles](https://img.shields.io/badge/SOLID_Principles-%230D6EFD.svg?style=flat\u0026logo=architecture\u0026logoColor=white)\n![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=flat\u0026logo=nginx\u0026logoColor=white)\n![Git](https://img.shields.io/badge/Git-%23F05033.svg?style=flat\u0026logo=git\u0026logoColor=white)\n![GitHub](https://img.shields.io/badge/GitHub-%23121011.svg?style=flat\u0026logo=github\u0026logoColor=white)\n![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=flat\u0026logo=githubactions\u0026logoColor=white)\n![Vercel](https://img.shields.io/badge/Vercel-%23000000.svg?style=flat\u0026logo=vercel\u0026logoColor=white)\n![ESLint](https://img.shields.io/badge/ESLint-4B32C3?style=flat\u0026logo=eslint\u0026logoColor=white)\n![Prettier](https://img.shields.io/badge/Prettier-F7B93E?style=flat\u0026logo=prettier\u0026logoColor=black)\n![npm](https://img.shields.io/badge/npm-CB3837?style=flat\u0026logo=npm\u0026logoColor=white)\n![Postman](https://img.shields.io/badge/Postman-FF6C37?style=flat\u0026logo=postman\u0026logoColor=white)\n\n\u003c/details\u003e\n\n---\n## 🏗️ Architecture Highlights\n\n- 🧱 **Clean Architecture**: Modular, scalable, and maintainable\n- 🔒 **Secure Transactions**: Stripe payment gateway integration\n- 🚀 **Real-time Communication**: Powered by Socket.io\n- 📊 **Comprehensive Logging**: Winston for robust error tracking\n- 🧩 **Reusable Components**: Enhancing code reusability and consistency\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**[Explore Services](https://avm-ayurvedic.online) | [Book Consultation](https://avm-ayurvedic.online/new-appointment) | [More About Our Services](https://avm-ayurvedic.online/services)**\n\n\u003c/div\u003e\n\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n\n# AVM Ayurvedic Project Setup\n\n## ⚡ Quick Start\n\n```bash\n# Clone and install\ngit clone https://github.com/sinanptm/avm-ayurvedic\ncd avm-ayurvedic\nnpm install\ncd server \u0026\u0026 npm install\ncd ../client \u0026\u0026 npm install\ncd ..\n\n# Set up environment files and start\nnpm run dev\n```\n\n\n## ⚙️ Detailed Setup Guide\n\n\u003cdetails\u003e\n\u003csummary\u003e1️⃣ Installation\u003c/summary\u003e\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/sinanptm/avm-ayurvedic\n   cd avm-ayurvedic\n   ```\n\n2. Install dependencies:\n   ```bash\n   # Root directory dependencies\n   npm install\n\n   # Server dependencies\n   cd server\n   npm install\n\n   # Client dependencies\n   cd ../client\n   npm install\n\n   # Return to root\n   cd ..\n   ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e2️⃣ Environment Configuration\u003c/summary\u003e\n\n1. Server Environment (.env in /server):\n```env\n# Database\nMONGODB_URL=mongodb://localhost:27017/AVM\n\n# Server Configuration\nPORT=8000\nNODE_ENV=dev\nCLIENT_URL=http://localhost:3000\n\n# Email Service\nSENDER_EMAIL=test@example.com\nNODEMAILER_PASSKEY=test-nodemailer-passkey\n\n# Authentication\nACCESS_TOKEN_SECRET=test-access-token-secret\nREFRESH_TOKEN_SECRET=test-refresh-token-secret\n\n# AWS S3\nAWS_REGION=eu-north-1\nAWS_ACCESS_KEY_ID=test-aws-access-key-id\nAWS_SECRET_ACCESS_KEY=test-aws-secret-access-key\nS3_BUCKET_NAME=test-avm-ayurvedic-bucket\n\n# Payment Processing\nSTRIPE_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXXXXXX\nSTRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\nSTRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXX\n\n# AI Integration\nGEMINI_API_KEY=test-gemini-api-key\n```\n\n2. Client Environment (.env in /client):\n```env\n# Environment\nNEXT_PUBLIC_ENV=development\n\n# API Configuration\nNEXT_PUBLIC_API_URL=http://localhost:8000/api\nNEXT_PUBLIC_BASE_API_URL=http://localhost:8000\n\n# Firebase Authentication\nNEXT_PUBLIC_FIREBASE_API_KEY=test-firebase-api-key\nNEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=test-firebase-auth-domain\nNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=test-firebase-messaging-sender-id\nNEXT_PUBLIC_FIREBASE_APP_ID=test-firebase-app-id\nNEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=test-firebase-measurement-id\n\n# Payment Integration\nNEXT_PUBLIC_STRIPE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXXXXXX\n\n# Video Call Integration\nNEXT_PUBLIC_METERED_TURN_USERNAME=test-metered-turn-username\nNEXT_PUBLIC_METERED_TURN_CREDENTIAL=test-metered-turn-credential\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e3️⃣ Third-Party Services Setup\u003c/summary\u003e\n\n### 1. Stripe Integration\n- **Tutorial**: [Watch Stripe Setup Guide](https://www.youtube.com/watch?v=ddzO85cqDeA) \n- **Steps**:\n  1. Install Stripe CLI:\n     ```bash\n     npm install -g stripe\n     ```\n  2. Authenticate with Stripe:\n     ```bash\n     stripe login\n     ```\n  3. **Important**: Add Stripe API keys to your server's `.env` file:\n     ```env\n     STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key\n     STRIPE_SECRET_KEY=sk_test_your_secret_key\n     STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret\n     ```\n\n### 2. Metered TURN Server\n- **Reference**: [Metered Website](https://metered.ca)\n- **Steps**:\n  1. Sign up for a Metered account\n  2. Navigate to the TURN server section in your dashboard\n  3. **Key Step**: Generate TURN credentials\n  4. **Important**: Update the client's `.env` file with:\n     ```env\n     NEXT_PUBLIC_METERED_TURN_USERNAME=your_turn_username\n     NEXT_PUBLIC_METERED_TURN_CREDENTIAL=your_turn_credential\n     ```\n\n### 3. Google Gemini AI\n- **Tutorial**: [Watch Gemini AI Setup Guide](https://www.youtube.com/watch?v=o8iyrtQyrZM)\n- **Steps**:\n  1. Access [Google Cloud Console](https://console.cloud.google.com/)\n  2. Create a new project or select an existing one\n  3. Navigate to APIs \u0026 Services dashboard\n  4. **Key Step**: Enable the Gemini API for your project\n  5. Create API credentials (API key)\n  6. **Important**: Add the API key to your server's `.env` file:\n     ```env\n     GEMINI_API_KEY=your_gemini_api_key\n     ```\n\n### 4. AWS S3\n- **Tutorial**: [Watch AWS S3 Configuration Guide](https://www.youtube.com/watch?v=eQAIojcArRY)\n- **Steps**:\n  1. Sign in to the [AWS Management Console](https://aws.amazon.com/console/)\n  2. Navigate to S3 and create a new bucket\n  3. Configure bucket settings (e.g., region, access control)\n  4. **Key Step**: Generate AWS access keys from the IAM dashboard\n  5. **CORS**: [Check this issue](https://github.com/sinanptm/hospital-management-system/issues/6)\n  6. **Important**: Update your server's `.env` file with:\n     ```env\n     AWS_REGION=your_selected_region\n     AWS_ACCESS_KEY_ID=your_access_key_id\n     AWS_SECRET_ACCESS_KEY=your_secret_access_key\n     S3_BUCKET_NAME=your_bucket_name\n     ```\n   eg: S3 Policy should be like this:\n\n  ```json\n  {\n    \"Version\": \"2012-10-17\",\n    \"Id\": \"Policy1725372798445\",\n    \"Statement\": [\n        {\n            \"Sid\": \"Stmt1725372795858\",\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": [\n                \"s3:GetObject\",\n                \"s3:DeleteObject\"\n            ],\n            \"Resource\": \"arn:aws:s3:::avm-ayurvedic/*\"\n        }\n    ]\n}\n\n\n\n### 5. Nodemailer Setup\n- **Tutorial**: [Watch Nodemailer Configuration Guide](https://www.youtube.com/watch?v=QDIOBsMBEI0)\n- **Steps**:\n  1. Enable 2-Step Verification for your Gmail account\n  2. **Key Step**: Generate an App Password in your Google Account settings\n  3. **Important**: Update your server's `.env` file with:\n     ```env\n     SENDER_EMAIL=your_gmail_address\n     NODEMAILER_PASSKEY=your_generated_app_password\n     ```\n\n### 6. Firebase Configuration\n- **Tutorial**: [Watch Firebase Setup Guide](https://www.youtube.com/watch?v=RDJvPZ9wHj0)\n- **Steps**:\n  1. Go to the [Firebase Console](https://console.firebase.google.com/)\n  2. Create a new Firebase project\n  3. Add a web app to your project\n  4. **Key Step**: Copy the Firebase configuration object\n  5. **Important**: Update your client's `.env` file with:\n     ```env\n     NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key\n     NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain\n     NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id\n     NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket\n     NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id\n     NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id\n     ```\n\n\u003e **⚠️ Security Note**: Always keep your API keys and credentials secure. Never commit them to version control. Use environment variables as shown in the examples above.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e4️⃣ Admin Dashboard Configuration\u003c/summary\u003e\n\n1. Database Setup:\n```javascript\n// Insert into 'doctors' collection\n{\n  \"_id\": { \"$oid\": \"66f43da6474baf6855725456\" },\n  \"email\": \"your-admin-email@example.com\",\n  \"password\": \"$2a$10$g4YLaUSEWC/tJvq0jmbw6e1aS423WTqepWqH6V8PjRtrfXMxOjcca\",\n  \"image\": \"\",\n  \"isBlocked\": false,\n  \"name\": \"Admin\",\n  \"phone\": \"2312371239\",\n  \"role\": \"admin\",\n  \"qualifications\": [],\n  \"token\": \"\",\n  \"isVerified\": false,\n  \"createdAt\": { \"$date\": \"2024-09-25T16:43:18.340Z\" },\n  \"updatedAt\": { \"$date\": \"2024-10-09T02:36:37.556Z\" }\n}\n```\n\n2. Initial Login:\n- Email: your configured admin email\n- Password: `1Admin@pass` (can change this later)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e5️⃣ Running the Application\u003c/summary\u003e\n\nOption A: Single Command (Recommended)\n```bash\n# From root directory\nnpm run dev\n```\n\nOption B: Individual Services\n```bash\n# Terminal 1 - Server\ncd server\nnpm run dev\n\n# Terminal 2 - Client\ncd client\nnpm run dev\n\n# Terminal 3 - Stripe (only if running servers separately)\nstripe listen --forward-to localhost:8000/webhook\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e6️⃣ Access Points\u003c/summary\u003e\n\n- Client Application: `http://localhost:3000`\n- Server API: `http://localhost:8000/api`\n- Admin Dashboard: `http://localhost:3000/admin`\n- Doctor Dashboard: `http://localhost:3000/doctor`\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e7️⃣ How to Change Admin Password\u003c/summary\u003e\n\n1. Create a new doctor/patient account through the application\n2. Go to your MongoDB database\n3. Find the newly created account's password hash\n4. Copy this password hash\n5. Locate the admin document in the `doctors` collection\n6. Replace the admin's password field with the copied hash\n7. You can now use the new account's password to login as admin\n\u003c/details\u003e\n\n---\n\nFor additional help or issues, please open a GitHub issue or contact me through email or any links from my profile.\n\n\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by sinanptm\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanptm%2Fhospital-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinanptm%2Fhospital-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanptm%2Fhospital-management-system/lists"}