A comprehensive medical equipment distribution platform designed for healthcare professionals, distributors, and administrators. Med CRM provides a modern, scalable solution for managing surgical instruments, medical equipment procurement, and distributor networks.
Med CRM is a full-stack web application that serves as a digital marketplace and management system for surgical instruments and medical equipment. The platform connects healthcare institutions with verified distributors while providing robust administrative tools for inventory management, order processing, and business analytics.
- Healthcare Providers: Browse and procure high-quality surgical instruments and medical equipment
- Distributors: Manage inventory, process orders, and grow their business through the platform
- Administrators: Oversee the entire ecosystem with comprehensive management tools
- Comprehensive Catalog: 14+ medical equipment categories including surgical instruments, monitoring equipment, diagnostic tools
- Advanced Search & Filtering: Multi-criteria product discovery
- Detailed Product Information: Specifications, features, pricing, and availability
- Inventory Tracking: Real-time stock levels and automated reorder alerts
- PDF Generation: Professional order invoices and product catalogs
- Multi-Role Authentication: Separate portals for admins, distributors, and customers
- JWT-based Security: Secure token-based authentication with refresh token rotation
- Role-Based Access Control: Granular permissions for different user types
- Distributor Application System: Streamlined onboarding process for new distributors
- Admin Dashboard: Comprehensive analytics and reporting
- Order Management: Complete order lifecycle tracking and management
- Distributor Analytics: Performance metrics and sales insights
- Financial Reporting: Revenue tracking and financial summaries
- Modern UI/UX: Professional medical industry design
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Real-time Notifications: Toast-based feedback system for user actions
- Progressive Web App: Fast loading and offline capabilities
βββ π¨ Components/
β βββ Admin (Dashboard, Inventory, Orders)
β βββ Auth (Login, Registration)
β βββ Distributor (Portal, Order Management)
β βββ Products (Catalog, Details)
β βββ UI (Reusable Components)
βββ π± Pages/
β βββ Home & About
β βββ Product Catalog
β βββ Authentication
β βββ Dashboards
βββ π§ Services/
β βββ API Integration
β βββ State Management (Redux)
β βββ Authentication
βββ π― Utils/
βββ Toast Notifications
βββ PDF Generation
βββ Utility Functions
βββ π‘οΈ Authentication/
β βββ JWT Token Management
β βββ Role-Based Access Control
β βββ Session Management
βββ π Controllers/
β βββ Admin Management
β βββ Product Operations
β βββ Order Processing
β βββ Distributor Management
βββ ποΈ Database/
β βββ Prisma ORM
β βββ PostgreSQL
β βββ Data Models
βββ π§ Middleware/
βββ Authentication
βββ Authorization
βββ Validation
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.4.6 | React framework with App Router |
| TypeScript | 5.x | Type-safe development |
| Tailwind CSS | 4.x | Utility-first CSS framework |
| Redux Toolkit | 2.8.2 | State management |
| Lucide React | 0.537.0 | Modern icon library |
| jsPDF | 3.0.2 | PDF generation |
| Axios | 1.11.0 | HTTP client |
| Technology | Version | Purpose |
|---|---|---|
| Express.js | 5.1.0 | Web application framework |
| TypeScript | 5.x | Type-safe server development |
| Prisma | 6.13.0 | Database ORM |
| PostgreSQL | Latest | Primary database |
| JWT | 9.0.2 | Authentication tokens |
| bcrypt | 6.0.0 | Password hashing |
- ESLint - Code linting and formatting
- PostCSS - CSS processing
- Prettier - Code formatting
- Git - Version control
- Node.js 18+
- npm or yarn
- PostgreSQL database
- Git
- Clone the repository
git clone https://github.com/imramkrishna/Med CRM.git
cd Med CRM- Backend Setup
cd backend
npm install
# Copy environment variables
cp .env.example .env
# Configure your database URL in .env
DATABASE_URL="postgresql://username:password@localhost:5432/harmonydb"
JWT_SECRET="your-secret-key"
JWT_REFRESH_SECRET="your-refresh-secret"
# Setup database
npx prisma generate
npx prisma db push
# Start backend server
npm run dev- Frontend Setup
cd ../frontend
npm install
# Copy environment variables
cp .env.example .env.local
# Configure API URL
NEXT_PUBLIC_BACKEND_URL="http://localhost:3001"
# Start frontend development server
npm run dev- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
// Add a new product (Admin only)
const productData = {
sku: "HST-001",
name: "Surgical Forceps",
description: "High-quality stainless steel forceps",
category: "Surgical Instruments",
listPrice: 89.99,
stockQuantity: 100
};
const response = await api.post('/admin/addProduct', productData);// Place an order (Distributor)
const orderData = {
items: [
{ productId: 1, quantity: 5, unitPrice: 89.99 },
{ productId: 2, quantity: 2, unitPrice: 149.99 }
],
notes: "Urgent delivery required"
};
const order = await api.post('/distributor/placeOrder', orderData);// Admin login
const loginData = {
email: "admin@harmonytech.com",
password: "securePassword"
};
const response = await api.post('/auth/admin/login', loginData);# Database
DATABASE_URL="postgresql://username:password@localhost:5432/harmonydb"
# JWT Secrets
JWT_SECRET="your-jwt-secret-key"
JWT_REFRESH_SECRET="your-refresh-secret-key"
# Server Configuration
PORT=3001
NODE_ENV="development"
# CORS Settings
FRONTEND_URL="http://localhost:3000"# API Configuration
NEXT_PUBLIC_BACKEND_URL="http://localhost:3001"
# Optional: Analytics
NEXT_PUBLIC_GA_ID="your-google-analytics-id"The application uses PostgreSQL with Prisma ORM. Key models include:
- admin - Administrative users
- distributor - Distributor accounts
- Product - Medical equipment catalog
- Order - Order management
- OrderItem - Individual order line items
- pendingRegistration - Distributor applications
Authenticate admin users.
Request Body:
{
"email": "admin@example.com",
"password": "password123"
}Response:
{
"user": {
"id": 1,
"email": "admin@example.com",
"role": "admin"
},
"accessToken": "jwt-token"
}Authenticate distributor users.
Request Body:
{
"email": "distributor@example.com",
"password": "password123"
}Retrieve all products (Admin only).
Response:
{
"products": [
{
"id": 1,
"sku": "HST-001",
"name": "Surgical Forceps",
"category": "Surgical Instruments",
"listPrice": 89.99,
"stockQuantity": 100,
"isActive": true
}
]
}Add a new product (Admin only).
Request Body:
{
"sku": "HST-002",
"name": "Digital Blood Pressure Monitor",
"description": "Professional grade BP monitor",
"category": "Monitoring Equipment",
"brand": "MedTech",
"listPrice": 149.99,
"costPrice": 89.99,
"stockQuantity": 50,
"dimensions": {
"length": 15,
"width": 10,
"height": 8,
"unit": "cm"
}
}Update an existing product (Admin only).
Delete a product (Admin only).
Retrieve all orders (Admin only).
Place a new order (Distributor only).
Request Body:
{
"items": [
{
"productId": 1,
"quantity": 5,
"unitPrice": 89.99
}
],
"notes": "Rush order for surgery",
"requestedDeliveryDate": "2024-01-15"
}# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2e- Unit Tests: Individual component and function testing
- Integration Tests: API endpoint testing
- E2E Tests: Complete user workflow testing
# Backend
cd backend
npm run build
npm start
# Frontend
cd frontend
npm run build
npm start# Build containers
docker-compose build
# Start services
docker-compose up -d
# View logs
docker-compose logs -f# Install Vercel CLI
npm i -g vercel
# Deploy to Vercel
cd frontend
vercel --prod# Deploy backend to Railway
railway login
railway deployWe welcome contributions from the medical technology community!
- Fork the repository
git clone https://github.com/yourusername/Med CRM.git- Create a feature branch
git checkout -b feature/new-medical-feature- Make changes and commit
git add .
git commit -m "Add new medical equipment category"- Push and create PR
git push origin feature/new-medical-feature- TypeScript: All code must be type-safe
- ESLint: Follow established linting rules
- Comments: Document complex medical algorithms
- Testing: Include tests for new features
- Security: Follow HIPAA compliance guidelines where applicable
- π₯ Medical Equipment Categories: Add new product types
- π Search Enhancement: Improve product discovery
- π Analytics: Enhanced reporting features
- π Internationalization: Multi-language support
- π± Mobile App: React Native companion app
- π Security: Enhanced security features
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Med CRM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- Lead Developer: Ram Krishna
- Project Maintainer: Ram Krishna
- Email: contact@harmonytech.com
- GitHub: [Med CRM Repository](https://github.com/imramkrishna/Med CRM)
- Issues: [Report Issues](https://github.com/imramkrishna/Med CRM/issues)
For technical support or questions:
- Check the FAQ section
- Search existing [GitHub Issues](https://github.com/imramkrishna/Med CRM/issues)
- Create a new issue with detailed information
- For urgent matters, contact: support@harmonytech.com
- β Initial release with core functionality
- β Product catalog and management
- β User authentication and authorization
- β Order management system
- β Admin and distributor dashboards
- β Responsive design
- β PDF generation for orders
- β Toast notification system
- π Real-time notifications
- π Advanced analytics dashboard
- π Mobile application
- π Multi-language support
- π Enhanced security features
Q: How do I become a distributor? A: Visit the "Become a Distributor" page and fill out the application form. Admin approval is required.
Q: How do I reset my password? A: Use the "Forgot Password" link on the login page to receive reset instructions.
Q: Can I integrate this with existing ERP systems? A: Yes, the API is designed to be integration-friendly. Contact us for custom integration support.
Q: Is this HIPAA compliant? A: The platform includes security best practices. For HIPAA compliance, additional configuration may be required.
Built with β€οΈ for the medical community
[](https://github.com/imramkrishna/Med CRM/stargazers) [](https://github.com/imramkrishna/Med CRM/network/members)