Skip to content

An advanced healthcare platform featuring AI-powered voice assistance and seamless appointment booking

Notifications You must be signed in to change notification settings

Callme-VR/Docterlogy

Repository files navigation

Docterlogy - AI-Powered Healthcare Appointment System

Docterlogy Hero

An advanced healthcare platform featuring AI-powered voice assistance and seamless appointment booking.

FeaturesTech StackArchitectureGetting StartedAPI DocumentationTestingDeploymentSecurityContributingLicense

Next.js TypeScript React Tailwind CSS Prisma Clerk License


Features

🔬 AI-Powered Healthcare Assistant

  • Voice-enabled AI doctor assistant powered by Vapi.ai
  • Natural language processing for medical inquiries
  • 24/7 availability for patient support

📅 Smart Appointment Booking

  • Multi-step appointment booking process
  • Doctor selection with detailed profiles
  • Real-time availability checking
  • Automated email confirmations via Resend

👨‍⚕️ Doctor Management

  • Admin panel for doctor management
  • Doctor profiles with specialties and availability
  • Appointment statistics and analytics

🔐 Secure Authentication

  • Clerk-based authentication system
  • Role-based access control (patient/admin)
  • Subscription plan management

🎨 Modern UI/UX

  • Responsive design with Tailwind CSS
  • Interactive components with Shadcn UI
  • Smooth animations and transitions

Tech Stack

Frontend

Backend & Database

Authentication & Authorization

  • Clerk - Authentication and user management
  • Role-based access control

Email & Notifications

AI Integration

  • Vapi.ai - Voice AI platform
  • Voice-enabled healthcare assistant

State Management & Data Fetching

  • TanStack Query - Server state management
  • Caching and background data synchronization

Development Tools

  • Biome - Code formatting and linting
  • Pnpm - Package manager

Architecture

System Architecture Diagram

graph TB
    subgraph "Client Layer"
        A[Web Browser] --> B[Next.js Frontend]
        B --> C[React Components]
        B --> D[Shadcn UI Components]
    end
    
    subgraph "Authentication Layer"
        E[Clerk Authentication]
        F[User Management]
        G[Role-based Access Control]
    end
    
    subgraph "Application Layer"
        H[Next.js API Routes]
        I[Server Actions]
        J[Middleware]
    end
    
    subgraph "Business Logic Layer"
        K[Appointment Management]
        L[Doctor Management]
        M[User Synchronization]
        N[Email Services]
    end
    
    subgraph "External Services"
        O[Vapi.ai Voice AI]
        P[Resend Email Service]
        Q[Unsplash Images]
    end
    
    subgraph "Data Layer"
        R[PostgreSQL Database]
        S[Prisma ORM]
    end
    
    B --> E
    E --> F
    F --> G
    B --> H
    H --> I
    I --> J
    I --> K
    I --> L
    I --> M
    I --> N
    K --> O
    N --> P
    B --> Q
    K --> S
    L --> S
    M --> S
    S --> R
    
    style A fill:#e1f5fe
    style R fill:#f3e5f5
    style O fill:#fff3e0
    style P fill:#fff3e0
Loading

Data Flow Architecture

sequenceDiagram
    participant U as User
    participant F as Frontend
    participant A as Auth (Clerk)
    participant API as API Routes
    participant DB as Database
    participant AI as Vapi.ai
    participant Email as Resend
    
    U->>F: Access Application
    F->>A: Authenticate User
    A->>F: Return User Info
    F->>API: Request Data
    API->>DB: Query/Update
    DB->>API: Return Data
    API->>F: Send Response
    F->>U: Display Results
    
    Note over U,Email: Appointment Booking Flow
    U->>F: Book Appointment
    F->>API: Create Appointment
    API->>DB: Save Appointment
    API->>Email: Send Confirmation
    Email->>U: Email Notification
    
    Note over U,AI: Voice Assistant Flow
    U->>F: Initiate Voice Chat
    F->>AI: Connect to Vapi.ai
    AI->>U: Voice Interaction
    AI->>F: Return Response
    F->>U: Display AI Response
Loading

Project Structure

docterlogy/
├── app/                    # Next.js app router pages
│   ├── admin/             # Admin dashboard
│   ├── api/               # API routes
│   ├── appointments/      # Appointment booking flow
│   ├── dashboard/         # Patient dashboard
│   ├── pro/               # Pro plan features
│   ├── voice/             # Voice AI features
│   └── ...
├── components/            # React components
│   ├── admin/             # Admin components
│   ├── appointments/      # Appointment components
│   ├── dashboard/         # Dashboard components
│   ├── emails/            # Email templates
│   ├── landing/           # Landing page components
│   ├── ui/                # UI components
│   └── ...
├── hooks/                 # Custom React hooks
├── lib/                   # Business logic and utilities
│   ├── actions/           # Server actions
│   └── ...
├── prisma/                # Prisma schema and migrations
└── public/                # Static assets

Database Schema

The application uses PostgreSQL with the following key entities:

  • User: Patient information with Clerk integration
  • Doctor: Healthcare provider profiles
  • Appointment: Booking details with status tracking

Authentication Flow

  1. Users sign up/in via Clerk
  2. User data synchronized with internal database
  3. Role-based access control determines available features
  4. Subscription plans unlock premium features (Voice AI)

Appointment Booking Flow

  1. Doctor Selection - Browse and select healthcare providers
  2. Time Slot Selection - Choose available dates and times
  3. Confirmation - Review and confirm appointment details
  4. Email Notification - Automatic confirmation sent via Resend

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Clerk account
  • Resend account
  • Vapi.ai account

Environment Variables

Create a .env file in the root directory:

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key

# Database
DATABASE_URL=your_postgresql_connection_string

# Vapi.ai Voice Assistant
NEXT_PUBLIC_VAPI_ASSISTANT_ID=your_vapi_assistant_id
NEXT_PUBLIC_VAPI_API_KEY=your_vapi_api_key

# Admin Access
ADMIN_EMAIL=your_admin_email

# Email Service
RESEND_API_KEY=your_resend_api_key

# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000

Installation

  1. Clone the repository:
git clone https://github.com/your-username/docterlogy.git
cd docterlogy
  1. Install dependencies:
pnpm install
  1. Set up the database:
pnpm prisma generate
pnpm prisma migrate dev
  1. Start the development server:
pnpm dev
  1. Open http://localhost:3000 in your browser.

Available Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm start - Start production server
  • pnpm lint - Check code with Biome
  • pnpm format - Format code with Biome

Deployment

Vercel (Recommended)

  1. Push code to GitHub
  2. Connect repository to Vercel
  3. Set environment variables in Vercel dashboard
  4. Deploy!

Docker Deployment

# Build the image
docker build -t docterlogy .

# Run the container
docker run -p 3000:3000 docterlogy

Environment Considerations

  • Ensure DATABASE_URL points to production database
  • Update NEXT_PUBLIC_APP_URL to your domain
  • Configure webhook URLs in Clerk dashboard

Contributing

We welcome contributions to Docterlogy! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Code Style

  • Follow the existing code style
  • Use Biome for formatting (pnpm format)
  • Write descriptive commit messages
  • Include tests for new functionality

Reporting Issues

  • Use the GitHub issue tracker
  • Provide detailed reproduction steps
  • Include screenshots when applicable

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, email support@docterlogy.com or join our Discord community.


Built with ❤️ for better healthcare accessibility

About

An advanced healthcare platform featuring AI-powered voice assistance and seamless appointment booking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published