If you find this project useful, please consider giving it a star on GitHub! Your support helps us grow and improve.
📹 Video Consultations | 🤖 AI-Powered Wellness | 📅 Smart Booking | 💳 Secure Payments |
---|---|---|---|
📊 Admin Dashboard | 🔔 Real-time Notifications | 🔐 Robust Authentication | 🖼️ Secure File Uploads |
- 🧱 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
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone and install
git clone https://github.com/sinanptm/avm-ayurvedic
cd avm-ayurvedic
pnpm install
# Set up environment files and start
pnpm dev
1️⃣ Installation
-
Clone the repository:
git clone https://github.com/sinanptm/avm-ayurvedic cd avm-ayurvedic
-
Install dependencies:
pnpm install
2️⃣ Environment Configuration
- Server Environment (.env in /server):
# Database
MONGODB_URL=mongodb://localhost:27017/AVM
# Server Configuration
PORT=8000
NODE_ENV=dev
CLIENT_URL=http://localhost:3000
# Email Service
SENDER_EMAIL=test@example.com
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
- Client Environment (.env in /client):
# 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
- Tutorial: Watch Stripe Setup Guide
- Steps:
- Install Stripe CLI:
npm install -g stripe
- Authenticate with Stripe:
stripe login
- Important: Add Stripe API keys to your server's
.env
file:STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key STRIPE_SECRET_KEY=sk_test_your_secret_key STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
- Install Stripe CLI:
- Reference: Metered Website
- Steps:
- Sign up for a Metered account
- Navigate to the TURN server section in your dashboard
- Key Step: Generate TURN credentials
- Important: Update the client's
.env
file with:NEXT_PUBLIC_METERED_TURN_USERNAME=your_turn_username NEXT_PUBLIC_METERED_TURN_CREDENTIAL=your_turn_credential
- Tutorial: Watch Gemini AI Setup Guide
- Steps:
- Access Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services dashboard
- Key Step: Enable the Gemini API for your project
- Create API credentials (API key)
- Important: Add the API key to your server's
.env
file:GEMINI_API_KEY=your_gemini_api_key
-
Tutorial: Watch AWS S3 Configuration Guide
-
Steps:
- Sign in to the AWS Management Console
- Navigate to S3 and create a new bucket
- Configure bucket settings (e.g., region, access control)
- Key Step: Generate AWS access keys from the IAM dashboard
- CORS: Check this issue
- Important: Update your server's
.env
file with: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:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::avm-ayurvedic-2/*" } ]
}
- Tutorial: Watch Nodemailer Configuration Guide
- Steps:
- Enable 2-Step Verification for your Gmail account
- Key Step: Generate an App Password in your Google Account settings
- Important: Update your server's
.env
file with:SENDER_EMAIL=your_gmail_address NODEMAILER_PASSKEY=your_generated_app_password
- Tutorial: Watch Firebase Setup Guide
- Steps:
- Go to the Firebase Console
- Create a new Firebase project
- Add a web app to your project
- Key Step: Copy the Firebase configuration object
- Important: Update your client's
.env
file with: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
- Database Setup:
// Insert into 'doctors' collection
{
"_id": { "$oid": "66f43da6474baf6855725456" },
"email": "your-admin-email@example.com",
"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" }
}
- Initial Login:
- Email: your configured admin email
- Password:
1Admin@pass
(can change this later)
5️⃣ Running the Application
Option A: Single Command (Recommended)
# From root directory
npm run dev
Option B: Individual Services
# 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
- Create a new doctor/patient account through the application
- Go to your MongoDB database
- Find the newly created account's password hash
- Copy this password hash
- Locate the admin document in the
doctors
collection - Replace the admin's password field with the copied hash
- 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