Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sinanptm/hospital-management-system

A secure, real-time platform for video consultations, chat, notifications, appointment bookings, and file uploads with seamless payment integration.
https://github.com/sinanptm/hospital-management-system

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

Last synced: about 6 hours ago
JSON representation

A secure, real-time platform for video consultations, chat, notifications, appointment bookings, and file uploads with seamless payment integration.

Awesome Lists containing this project

README

        

# 🌿 AVM Ayurvedic
*Bridging ancient Ayurvedic wisdom with modern technology*

[![Website](https://img.shields.io/badge/🌐_Website-Visit_Our_Site-brightgreen?style=for-the-badge&logoColor=white)](https://avm-ayurvedic.online)
[![Frontend](https://img.shields.io/badge/▲_Frontend-Vercel-black?style=for-the-badge&logo=vercel)](https://avm-ayurvedic.online)
[![Backend](https://img.shields.io/badge/🚀_Backend-AWS-orange?style=for-the-badge&logo=amazon-aws)](https://api.avm-ayurvedic.online)

---

## 🚀 Key Features

📹 Video Consultations | 🤖 AI-Powered Wellness | 📅 Smart Booking | 💳 Secure Payments
:---: | :---: | :---: | :---:
📊 Admin Dashboard | 🔔 Real-time Notifications | 🔐 Robust Authentication | 🖼️ Secure File Uploads

---
## 💻 Tech Stack

🎨 Frontend

![Next JS](https://img.shields.io/badge/Next.js-black?style=flat&logo=next.js)
![TypeScript](https://img.shields.io/badge/TypeScript-%23007ACC.svg?style=flat&logo=typescript&logoColor=white)
![React](https://img.shields.io/badge/React-%2320232a.svg?style=flat&logo=react&logoColor=%2361DAFB)
![TailwindCSS](https://img.shields.io/badge/Tailwind-%2338B2AC.svg?style=flat&logo=tailwind-css&logoColor=white)
![Radix UI](https://img.shields.io/badge/Radix_UI-%231A1A1A.svg?style=flat&logo=radix-ui&logoColor=white)
![Socket.io-client](https://img.shields.io/badge/Socket.io--client-black?style=flat&logo=socket.io&logoColor=white)
![WebRTC](https://img.shields.io/badge/WebRTC-333333?style=flat&logo=webrtc&logoColor=white)
![Simple Peer](https://img.shields.io/badge/Simple_Peer-4A154B?style=flat&logo=webrtc&logoColor=white)
![OAuth](https://img.shields.io/badge/OAuth-3C78A9?style=flat&logo=oauth&logoColor=white)
![Google](https://img.shields.io/badge/Google-4285F4?style=flat&logo=google&logoColor=white)
![Axios](https://img.shields.io/badge/Axios-5A29E3?style=flat&logo=axios&logoColor=white)
![React Query](https://img.shields.io/badge/React_Query-FF4154?style=flat&logo=react-query&logoColor=white)
![Stripe](https://img.shields.io/badge/Stripe-008CDD?style=flat&logo=stripe&logoColor=white)
![Firebase](https://img.shields.io/badge/Firebase-FFCA28?style=flat&logo=firebase&logoColor=black)
![Framer Motion](https://img.shields.io/badge/Framer_Motion-0055FF?style=flat&logo=framer&logoColor=white)
![Zod](https://img.shields.io/badge/Zod-3E67B1?style=flat&logo=zod&logoColor=white)
![React Hook Form](https://img.shields.io/badge/React_Hook_Form-EC5990?style=flat&logo=reacthookform&logoColor=white)
![Recharts](https://img.shields.io/badge/Recharts-%2348A9E6.svg?style=flat&logo=recharts&logoColor=white)

⚙️ Backend

![Node.js](https://img.shields.io/badge/Node.js-6DA55F?style=flat&logo=node.js&logoColor=white)
![Express.js](https://img.shields.io/badge/Express.js-%23404d59.svg?style=flat&logo=express&logoColor=%2361DAFB)
![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=flat&logo=mongodb&logoColor=white)
![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=flat&logo=amazon-aws&logoColor=white)
![Stripe](https://img.shields.io/badge/Stripe-%236464FF.svg?style=flat&logo=stripe&logoColor=white)
![JWT](https://img.shields.io/badge/JWT-black?style=flat&logo=JSON%20web%20tokens)
![NGINX](https://img.shields.io/badge/NGINX-%23009639.svg?style=flat&logo=nginx&logoColor=white)
![Socket.io](https://img.shields.io/badge/Socket.io-black?style=flat&logo=socket.io&badgeColor=010101)
![Google AI](https://img.shields.io/badge/Google_AI-4285F4?style=flat&logo=google&logoColor=white)
![Joi](https://img.shields.io/badge/Joi-0080FF?style=flat&logo=joi&logoColor=white)
![Winston](https://img.shields.io/badge/Winston-231F20?style=flat&logo=winston&logoColor=white)

🛠 DevOps & Tools

![SEO](https://img.shields.io/badge/SEO-4CAF50?style=flat&logo=google&logoColor=white)
![Google Analytics](https://img.shields.io/badge/Google%20Analytics-E37400?style=flat&logo=google-analytics&logoColor=white)
![Vercel Analytics](https://img.shields.io/badge/Vercel%20Analytics-E37400?style=flat&logo=google-analytics&logoColor=white)
![Open Graph](https://img.shields.io/badge/Open%20Graph-008000?style=flat&logo=facebook&logoColor=white)
![Twitter Card](https://img.shields.io/badge/Twitter%20Card-1DA1F2?style=flat&logo=twitter&logoColor=white)
![Figma](https://img.shields.io/badge/figma-%23F24E1E.svg?style=flat&logo=figma&logoColor=white)
![Clean Architecture](https://img.shields.io/badge/Clean_Architecture-%230D6EFD.svg?style=flat&logo=architecture&logoColor=white)
![SOLID Principles](https://img.shields.io/badge/SOLID_Principles-%230D6EFD.svg?style=flat&logo=architecture&logoColor=white)
![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=flat&logo=nginx&logoColor=white)
![Git](https://img.shields.io/badge/Git-%23F05033.svg?style=flat&logo=git&logoColor=white)
![GitHub](https://img.shields.io/badge/GitHub-%23121011.svg?style=flat&logo=github&logoColor=white)
![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=flat&logo=githubactions&logoColor=white)
![Vercel](https://img.shields.io/badge/Vercel-%23000000.svg?style=flat&logo=vercel&logoColor=white)
![ESLint](https://img.shields.io/badge/ESLint-4B32C3?style=flat&logo=eslint&logoColor=white)
![Prettier](https://img.shields.io/badge/Prettier-F7B93E?style=flat&logo=prettier&logoColor=black)
![npm](https://img.shields.io/badge/npm-CB3837?style=flat&logo=npm&logoColor=white)
![Postman](https://img.shields.io/badge/Postman-FF6C37?style=flat&logo=postman&logoColor=white)

---
## 🏗️ Architecture Highlights

- 🧱 **Clean Architecture**: Modular, scalable, and maintainable
- 🔒 **Secure Transactions**: Stripe payment gateway integration
- 🚀 **Real-time Communication**: Powered by Socket.io
- 📊 **Comprehensive Logging**: Winston for robust error tracking
- 🧩 **Reusable Components**: Enhancing code reusability and consistency

---

**[Explore Services](https://avm-ayurvedic.online) | [Book Consultation](https://avm-ayurvedic.online/new-appointment) | [More About Our Services](https://avm-ayurvedic.online/services)**

Contributions are welcome! Please feel free to submit a Pull Request.

# AVM Ayurvedic Project Setup

## ⚡ Quick Start

```bash
# Clone and install
git clone https://github.com/sinanptm/avm-ayurvedic
cd avm-ayurvedic
npm install
cd server && npm install
cd ../client && npm install
cd ..

# Set up environment files and start
npm run dev
```

## ⚙️ Detailed Setup Guide

1️⃣ Installation

1. Clone the repository:
```bash
git clone https://github.com/sinanptm/avm-ayurvedic
cd avm-ayurvedic
```

2. Install dependencies:
```bash
# Root directory dependencies
npm install

# Server dependencies
cd server
npm install

# Client dependencies
cd ../client
npm install

# Return to root
cd ..
```

2️⃣ Environment Configuration

1. Server Environment (.env in /server):
```env
# Database
MONGODB_URL=mongodb://localhost:27017/AVM

# Server Configuration
PORT=8000
NODE_ENV=dev
CLIENT_URL=http://localhost:3000

# Email Service
[email protected]
NODEMAILER_PASSKEY=test-nodemailer-passkey

# Authentication
ACCESS_TOKEN_SECRET=test-access-token-secret
REFRESH_TOKEN_SECRET=test-refresh-token-secret

# AWS S3
AWS_REGION=eu-north-1
AWS_ACCESS_KEY_ID=test-aws-access-key-id
AWS_SECRET_ACCESS_KEY=test-aws-secret-access-key
S3_BUCKET_NAME=test-avm-ayurvedic-bucket

# Payment Processing
STRIPE_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXX

# AI Integration
GEMINI_API_KEY=test-gemini-api-key
```

2. Client Environment (.env in /client):
```env
# Environment
NEXT_PUBLIC_ENV=development

# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000/api
NEXT_PUBLIC_BASE_API_URL=http://localhost:8000

# Firebase Authentication
NEXT_PUBLIC_FIREBASE_API_KEY=test-firebase-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=test-firebase-auth-domain
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=test-firebase-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=test-firebase-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=test-firebase-measurement-id

# Payment Integration
NEXT_PUBLIC_STRIPE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXXXXXX

# Video Call Integration
NEXT_PUBLIC_METERED_TURN_USERNAME=test-metered-turn-username
NEXT_PUBLIC_METERED_TURN_CREDENTIAL=test-metered-turn-credential
```

3️⃣ Third-Party Services Setup

### 1. Stripe Integration
- **Tutorial**: [Watch Stripe Setup Guide](https://www.youtube.com/watch?v=ddzO85cqDeA)
- **Steps**:
1. Install Stripe CLI:
```bash
npm install -g stripe
```
2. Authenticate with Stripe:
```bash
stripe login
```
3. **Important**: Add Stripe API keys to your server's `.env` file:
```env
STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key
STRIPE_SECRET_KEY=sk_test_your_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
```

### 2. Metered TURN Server
- **Reference**: [Metered Website](https://metered.ca)
- **Steps**:
1. Sign up for a Metered account
2. Navigate to the TURN server section in your dashboard
3. **Key Step**: Generate TURN credentials
4. **Important**: Update the client's `.env` file with:
```env
NEXT_PUBLIC_METERED_TURN_USERNAME=your_turn_username
NEXT_PUBLIC_METERED_TURN_CREDENTIAL=your_turn_credential
```

### 3. Google Gemini AI
- **Tutorial**: [Watch Gemini AI Setup Guide](https://www.youtube.com/watch?v=o8iyrtQyrZM)
- **Steps**:
1. Access [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select an existing one
3. Navigate to APIs & Services dashboard
4. **Key Step**: Enable the Gemini API for your project
5. Create API credentials (API key)
6. **Important**: Add the API key to your server's `.env` file:
```env
GEMINI_API_KEY=your_gemini_api_key
```

### 4. AWS S3
- **Tutorial**: [Watch AWS S3 Configuration Guide](https://www.youtube.com/watch?v=eQAIojcArRY)
- **Steps**:
1. Sign in to the [AWS Management Console](https://aws.amazon.com/console/)
2. Navigate to S3 and create a new bucket
3. Configure bucket settings (e.g., region, access control)
4. **Key Step**: Generate AWS access keys from the IAM dashboard
5. **CORS**: [Check this issue](https://github.com/sinanptm/hospital-management-system/issues/6)
6. **Important**: Update your server's `.env` file with:
```env
AWS_REGION=your_selected_region
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
S3_BUCKET_NAME=your_bucket_name
```
eg: S3 Policy should be like this:

```json
{
"Version": "2012-10-17",
"Id": "Policy1725372798445",
"Statement": [
{
"Sid": "Stmt1725372795858",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::avm-ayurvedic/*"
}
]
}

### 5. Nodemailer Setup
- **Tutorial**: [Watch Nodemailer Configuration Guide](https://www.youtube.com/watch?v=QDIOBsMBEI0)
- **Steps**:
1. Enable 2-Step Verification for your Gmail account
2. **Key Step**: Generate an App Password in your Google Account settings
3. **Important**: Update your server's `.env` file with:
```env
SENDER_EMAIL=your_gmail_address
NODEMAILER_PASSKEY=your_generated_app_password
```

### 6. Firebase Configuration
- **Tutorial**: [Watch Firebase Setup Guide](https://www.youtube.com/watch?v=RDJvPZ9wHj0)
- **Steps**:
1. Go to the [Firebase Console](https://console.firebase.google.com/)
2. Create a new Firebase project
3. Add a web app to your project
4. **Key Step**: Copy the Firebase configuration object
5. **Important**: Update your client's `.env` file with:
```env
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
```

> **⚠️ 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.

4️⃣ Admin Dashboard Configuration

1. Database Setup:
```javascript
// Insert into 'doctors' collection
{
"_id": { "$oid": "66f43da6474baf6855725456" },
"email": "[email protected]",
"password": "$2a$10$g4YLaUSEWC/tJvq0jmbw6e1aS423WTqepWqH6V8PjRtrfXMxOjcca",
"image": "",
"isBlocked": false,
"name": "Admin",
"phone": "2312371239",
"role": "admin",
"qualifications": [],
"token": "",
"isVerified": false,
"createdAt": { "$date": "2024-09-25T16:43:18.340Z" },
"updatedAt": { "$date": "2024-10-09T02:36:37.556Z" }
}
```

2. Initial Login:
- Email: your configured admin email
- Password: `1Admin@pass` (can change this later)

5️⃣ Running the Application

Option A: Single Command (Recommended)
```bash
# From root directory
npm run dev
```

Option B: Individual Services
```bash
# Terminal 1 - Server
cd server
npm run dev

# Terminal 2 - Client
cd client
npm run dev

# Terminal 3 - Stripe (only if running servers separately)
stripe listen --forward-to localhost:8000/webhook
```

6️⃣ Access Points

- Client Application: `http://localhost:3000`
- Server API: `http://localhost:8000/api`
- Admin Dashboard: `http://localhost:3000/admin`
- Doctor Dashboard: `http://localhost:3000/doctor`

7️⃣ How to Change Admin Password

1. Create a new doctor/patient account through the application
2. Go to your MongoDB database
3. Find the newly created account's password hash
4. Copy this password hash
5. Locate the admin document in the `doctors` collection
6. Replace the admin's password field with the copied hash
7. You can now use the new account's password to login as admin

---

For additional help or issues, please open a GitHub issue or contact me through email or any links from my profile.


Made with ❤️ by sinanptm