Skip to content

Misrilal-Sah/PharmaDesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

     



         



         



💡 Streamline your pharmacy operations — from inventory and prescriptions to billing and analytics, all in one beautiful, secure dashboard.



✨ Feature Highlights

🏥 Clinical Workflow

  • Patient Management — Profiles, timelines, blood groups, allergies
  • Doctor Directory — Specializations, license tracking, affiliations
  • Prescriptions — Create, dispense, and track Rx with one click
  • Billing & Invoicing — POS-style sales, PDF invoices, email receipts

📦 Inventory Intelligence

  • Stock Batches — Track expiry dates, batch numbers, quantities
  • Low-Stock Alerts — Automated reorder level notifications
  • Expiry Warnings — Proactive alerts before medicines expire
  • Supplier Management — Full supplier database with contact info

📊 Analytics & Reports

  • Live Dashboard — Revenue charts, top medicines, KPI cards
  • Sales Analysis — Date-range reports with visual charts
  • Inventory Reports — Stock health, expiry analysis
  • Audit Logs — Complete user activity trail for compliance

🔐 Security First

  • JWT Authentication — Stateless, token-based auth
  • TOTP Two-Factor Auth — Google Authenticator + backup codes
  • Role-Based Access — Admin / Pharmacist / Doctor / Staff
  • Email Verification — OTP-verified account & email changes
  • Session Management — View & revoke active sessions per device

🖥️ Interface

Dark Mode Light Mode
Palette Teal on charcoal Clinical blue on white
Best for Night shifts Bright pharmacies

Key UX features

  • ⌨️ Command Palette (Ctrl+K) — jump anywhere instantly
  • 🌙 Dark / Light theme toggle — persistent per user
  • 🔍 Global search — patients, medicines, doctors in one box
  • 📄 Sortable, paginated tables — column sorting + per-page control on every table
  • 🔔 Real-time toast notifications
  • 🖼️ Cloudinary avatars — profile pictures stored in the cloud

🗂️ Project Structure

pharmadesk/
├── client/                    # React + Vite frontend
│   └── src/
│       ├── components/        # Reusable UI (Toast, Modal, Charts, Skeleton…)
│       ├── context/           # Auth, Theme, Sidebar, Shortcuts
│       ├── pages/             # Full-page route components
│       ├── services/          # Axios API layer
│       └── utils/             # generateInvoice, useSortPaginate…
└── server/                    # Node.js + Express backend
    ├── db/                    # MySQL schema & migration scripts
    ├── middleware/             # auth, auditLog, permissions
    ├── routes/                # REST API route handlers
    └── services/              # email, expiryAlerts

🚀 Getting Started

Prerequisites

Requirement Version
Node.js ≥ 18
MySQL ≥ 8.0
npm ≥ 9

1 · Clone & Install

git clone https://github.com/your-username/pharmadesk.git
cd pharmadesk

# Backend
cd server && npm install

# Frontend
cd ../client && npm install

2 · Configure Environment

cp server/.env.example server/.env
# Then edit server/.env with your values
# Database
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=pharmadesk

# Auth
JWT_SECRET=your_super_long_random_secret

# Email (for OTP verification & receipts)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASS=your_app_password

# Cloudinary (for profile pictures)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

3 · Initialize Database

# Create the database first
mysql -u root -p -e "CREATE DATABASE pharmadesk;"

# Run schema
mysql -u root -p pharmadesk < server/db/schema.sql

# Seed initial admin account
cd server && node create-admin.js

4 · Start the App

# Terminal 1 — Backend (port 5000)
cd server && npm run dev

# Terminal 2 — Frontend (port 5173)
cd client && npm run dev

Open http://localhost:5173 — admin credentials are printed by create-admin.js.


🔑 Roles & Permissions

Feature Admin Pharmacist Doctor Staff
User Management
Billing & Sales
Prescriptions
Inventory
Audit Logs
Reports

🔒 Security Architecture

Feature Implementation
Passwords bcrypt (cost 10)
Sessions JWT + DB session table
2FA TOTP (otplib) + 8 backup codes
Email OTPs 6-digit, 10-min expiry, single-use
Email change Password + OTP double verification
Audit trail Every CRUD action logged with user/IP/timestamp

🛠️ Tech Stack

Frontend

Backend


📜 Key API Endpoints

Method Endpoint Description
POST /api/auth/login Login + 2FA check
POST /api/auth/register Register with email verification
POST /api/auth/forgot-password Send password reset OTP
PUT /api/auth/change-password Change password (authenticated)
POST /api/auth/request-email-change Send OTP to new email
POST /api/2fa/setup Generate QR code for TOTP
POST /api/2fa/disable Disable 2FA (requires password)
POST /api/upload/avatar Upload profile picture to Cloudinary
GET /api/patients List patients (search, pagination)
GET /api/inventory/overview Stock overview + alerts
POST /api/billing Create sale / invoice
GET /api/reports/dashboard Dashboard KPIs

🤝 Contributing

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


   



   



       



     



About

A web-based Pharmacy Management System for managing patients, prescriptions, inventory, and billing in clinics and hospitals. Designed to streamline pharmacy workflows with secure data handling and real-time inventory control.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors