Skip to content

arijitchhatui/Samarpan

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Samarpan - Blood Donor Connection Platform

Samarpan Logo

Connect Donors, Save Lives – A real-time blood and platelet donor connection platform that brings donors and patients together.

Next.js TypeScript MongoDB Tailwind CSS

Live Demo β€’ Report Bug β€’ Request Feature


πŸ†• Latest Updates (January 2026)

πŸ”§ QR Scanner System - FIXED

  • βœ… Runtime Error Resolution: Fixed "HTML Element with id=admin-qr-reader not found" error
  • βœ… Robust DOM Handling: Implemented proper element waiting pattern with retry logic
  • βœ… Enhanced Camera Initialization: Added safety checks and improved cleanup with error handling
  • βœ… Element Validation: Added validation before scanner creation with retry mechanism
  • βœ… Production Ready: QR scanners now work reliably in both admin QR checker and event attendance scanner

πŸš€ Deployment System - ENHANCED

  • βœ… Vercel Compatibility: Resolved "Cannot install with 'frozen-lockfile'" deployment error
  • βœ… Dependency Cleanup: Removed problematic baseline-browser-mapping dependency
  • βœ… Lockfile Management: Updated .gitignore to prevent future lockfile conflicts
  • βœ… Build Optimization: Created fresh npm lockfile and proper .vercelignore configuration
  • βœ… Deployment Ready: Seamless deployment to Vercel with zero configuration issues

πŸ› οΈ Comprehensive Maintenance System - NEW

  • βœ… Beautiful Samarpan Loader: Animated blood drop with rotating rings, multiple size variants
  • βœ… Modern Maintenance Page: Light theme design with real-time clock and duration tracking
  • βœ… Complete Route Protection: Middleware blocks ALL routes during maintenance except admin and static assets
  • βœ… Smart Navbar Integration: Auto-hiding navigation with maintenance indicator
  • βœ… Priority-Based Styling: Different colors and messages for maintenance priority levels (low, medium, high, critical)
  • βœ… Real-Time Updates: 30-second auto-refresh with connection status monitoring
  • βœ… Mobile Responsive: Perfect experience across all devices
  • βœ… Professional Design: Glass morphism effects with light theme consistency

🎨 Visual Enhancements

  • βœ… Blood PNG Integration: Custom blood drop image in maintenance loader
  • βœ… Perfect Center Alignment: Maintenance indicator absolutely centered with loader
  • βœ… Light Theme Consistency: Maintenance page matches site's current light theme
  • βœ… Responsive Navbar: Smart hiding of navigation elements during maintenance
  • βœ… Professional Animations: Smooth transitions and GPU-accelerated effects

🎯 About Samarpan

Samarpan is a comprehensive blood donation management platform designed to connect donors with patients in need of blood and platelets. Built with modern web technologies, it enables real-time connections, efficient donor management, and streamlined administrative operations.

Key Features

πŸ‘₯ Donor & Patient Features

  • Real-Time Connections – Instantly connect blood donors with patients in need
  • User Authentication – Secure signup, login, and password management
  • Donation Tracking – Track your blood donation history and earn certificates
  • Request Management – Create and manage blood requests with priority levels
  • Event Participation – Join upcoming blood donation events in your area
  • Notifications – Real-time alerts for matching blood requests
  • User Dashboard – Comprehensive profile and activity management
  • Certificate Generation – Automatic certificate creation for donors

πŸ›‘οΈ Admin Features

  • Admin Panel – Centralized dashboard for system management
  • User Management – View and manage all registered users
  • Donation Management – Track and verify all donations
  • Request Management – Review and approve blood requests
  • Event Management – Create and manage blood donation events
  • QR Code Scanning – Reliable QR code scanning for event check-ins
  • Transportation Coordination – Manage transportation logistics
  • Notification System – Send bulk notifications to users
  • Image Management – View and manage donation images
  • Contact Submissions – Review and respond to user inquiries
  • Certificate Management – Generate and track donor certificates
  • Maintenance Mode – Professional maintenance system with real-time monitoring

πŸ”§ System Administration

  • Maintenance System – Complete maintenance mode with route protection
  • Real-Time Monitoring – Auto-refresh maintenance status every 30 seconds
  • Priority Management – Different maintenance levels (low, medium, high, critical)
  • IP Whitelisting – Allow specific IPs to bypass maintenance mode
  • Emergency Access – Secret key bypass for emergency access
  • Professional UI – Beautiful maintenance page with Samarpan branding

πŸ‘₯ NGO Staff Guide

Getting Started as NGO Staff

  1. Access the Admin Panel

    • Visit /admin/login in your browser
    • Use the default credentials:
      • Email: admin@samarpan.com
      • Password: admin@123
    • Change your password immediately after first login
  2. Understanding the Dashboard

    • User Management: View and manage all registered donors
    • Event Management: Create and manage blood donation events
    • Donation Tracking: Monitor donation activities and certificates
    • Notifications: Send bulk notifications to users
    • Maintenance Mode: Enable/disable maintenance with custom messages

Key Operations for NGO Staff

Managing Events

  • Create Events: Go to Admin Dashboard β†’ Events β†’ Create New Event
  • Set Event Details: Title, date, location, volunteer slots needed
  • Monitor Registrations: View donor registrations and QR codes
  • QR Code Scanning: Use reliable QR scanner for event check-ins
  • Track Donations: Update donation status and blood test results

Managing Donors

  • View Donor List: Admin Dashboard β†’ Users β†’ View all registered users
  • Event Donors: Events β†’ Select Event β†’ View Registered Donors
  • QR Verification: Scan donor QR codes for attendance verification
  • Update Blood Types: After blood testing, update donor blood types
  • Generate Certificates: Automatically generate donation certificates

Maintenance Management

  • Enable Maintenance: Admin Dashboard β†’ Maintenance Mode
  • Set Priority Level: Choose from low, medium, high, or critical
  • Custom Messages: Add specific maintenance messages for users
  • IP Whitelisting: Allow specific IPs to bypass maintenance
  • Emergency Access: Set secret keys for emergency bypass
  • Real-Time Monitoring: View maintenance duration and auto-refresh status

Blood Donation Process

  1. Event Creation: Create event with date, time slots, and location
  2. Donor Registration: Donors register through the public portal
  3. Check-in Process: Use QR codes to verify donor arrival (now working reliably)
  4. Blood Testing: Update blood types after lab results
  5. Certificate Generation: Generate certificates for completed donations

Important Settings

  • Environment Variables: Ensure all required environment variables are set
  • Email Configuration: Set up email service for notifications
  • Database Backup: Regular backups of MongoDB data
  • Admin Permissions: Assign appropriate permissions to staff members
  • Maintenance Settings: Configure maintenance mode parameters

Troubleshooting

  • Can't access admin panel: Check login credentials and permissions
  • Events not showing: Verify event dates and status
  • QR codes not working: βœ… FIXED - QR scanners now work reliably
  • Email notifications failing: Check email service configuration
  • Maintenance mode issues: βœ… NEW - Complete maintenance system available
  • Deployment failures: βœ… FIXED - Vercel deployment now works seamlessly

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 16 with App Router
  • UI Library: React 19
  • Language: TypeScript 5
  • Styling: Tailwind CSS 4 + Radix UI components
  • State Management: Redux Toolkit
  • Form Handling: React Hook Form + Zod validation
  • Charts: Recharts
  • Icons: Lucide React
  • PDF Generation: PDFKit & PDF-Lib
  • QR Code Scanning: html5-qrcode (enhanced with robust error handling)

Backend

  • Runtime: Node.js (Next.js Server)
  • Database: MongoDB 6.20
  • Authentication: JWT + bcryptjs
  • Email: Nodemailer
  • Cloud Storage: AWS S3 (via AWS SDK)
  • PDF Processing: PDFKit
  • Maintenance System: Custom middleware with route protection

Development

  • Package Manager: npm/pnpm
  • Build Tool: Next.js (Turbopack)
  • Linting: ESLint
  • Environment: Node.js 18+
  • Deployment: Vercel (optimized configuration)

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm/pnpm
  • MongoDB instance (local or Atlas)
  • AWS S3 credentials (optional, for file uploads)
  • Email service credentials (SendGrid or similar via Nodemailer)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/samarpan.git
    cd samarpan
  2. Install dependencies:

    npm install
    # or
    pnpm install
  3. Configure environment variables:

    cp .env.example .env.local

    Update .env.local with:

    # Database
    MONGODB_URL=mongodb+srv://username:password@cluster.mongodb.net/samarpan
    
    # JWT
    JWT_SECRET=your-secret-key-here
    
    # Email Service
    EMAIL_USER=your-email@gmail.com
    EMAIL_PASSWORD=your-app-password
    
    # AWS (optional)
    AWS_ACCESS_KEY_ID=your-access-key
    AWS_SECRET_ACCESS_KEY=your-secret-key
    AWS_S3_BUCKET=your-bucket-name
    AWS_REGION=us-east-1
    
    # Google OAuth (optional)
    NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id
    
    # Maintenance System (new)
    MAINTENANCE_INTERNAL_TOKEN=your-internal-token-for-maintenance-checks
  4. Set up the database and create super admin:

    npm run setup:admin

    This initializes the admin system with database indexes and creates the super admin account.

    πŸ“Œ For detailed admin setup instructions, see Admin Quick Start Guide

  5. Start the development server:

    npm run dev

    The application will be available at http://localhost:3000

Admin System

Default Super Admin Credentials

Login at /admin/login:

  • Email: admin@samarpan.com
  • Password: admin@123

Setup Commands

npm run setup:admin      # Recommended: Sets up everything with indexes
npm run create-admin     # Interactive: Create super admin or regular admin
npx tsx create-admin.ts  # Direct: Create/update super admin

Admin Features

βœ… Create and manage admin accounts with specific features/permissions
βœ… Two-tier system: Super Admin (full access) and Regular Admin (limited)
βœ… Granular permission control (16+ different permissions)
βœ… Real-time admin dashboard with activity tracking
βœ… NEW: Comprehensive maintenance mode management
βœ… FIXED: Reliable QR code scanning system

For complete documentation, see:


πŸ“ Project Structure

samarpan/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (public)/                 # Public routes
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Home page
β”‚   β”‚   β”œβ”€β”€ auth/                 # Auth routes (login, signup)
β”‚   β”‚   β”œβ”€β”€ dashboard/            # User dashboard
β”‚   β”‚   β”œβ”€β”€ donate-blood/         # Blood donation requests
β”‚   β”‚   β”œβ”€β”€ request-blood/        # Blood request creation
β”‚   β”‚   β”œβ”€β”€ events/               # Event listings
β”‚   β”‚   β”œβ”€β”€ notifications/        # Notification center
β”‚   β”‚   β”œβ”€β”€ maintenance/          # πŸ†• Maintenance page with blood.png
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ admin/                    # Admin routes
β”‚   β”‚   β”œβ”€β”€ login/                # Admin login
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Admin dashboard
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ admin/                # Admin operations
β”‚   β”‚   β”‚   β”œβ”€β”€ maintenance/      # πŸ†• Maintenance mode API
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ blood-request/        # Blood requests API
β”‚   β”‚   β”œβ”€β”€ donation-requests/    # Donations API
β”‚   β”‚   β”œβ”€β”€ users/                # User management API
β”‚   β”‚   β”œβ”€β”€ events/               # Events API
β”‚   β”‚   β”œβ”€β”€ notifications/        # Notifications API
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   └── globals.css               # Global styles
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                       # Radix UI components
β”‚   β”œβ”€β”€ admin-*.tsx               # Admin panel components
β”‚   β”œβ”€β”€ admin-qr-*.tsx            # πŸ”§ Fixed QR scanner components
β”‚   β”œβ”€β”€ blood-*.tsx               # Blood-related components
β”‚   β”œβ”€β”€ samarpan-loader.tsx       # πŸ†• Enhanced loader with blood.png
β”‚   β”œβ”€β”€ maintenance-mode-manager.tsx # πŸ†• Maintenance management
β”‚   β”œβ”€β”€ navbar.tsx                # πŸ”§ Enhanced navbar with maintenance mode
β”‚   β”œβ”€β”€ login-form.tsx            # Auth forms
β”‚   └── ...
β”œβ”€β”€ lib/                          # Utility functions
β”‚   β”œβ”€β”€ auth.ts                   # Authentication utilities
β”‚   β”œβ”€β”€ mongodb.ts                # Database connection
β”‚   β”œβ”€β”€ email.ts                  # Email service
β”‚   β”œβ”€β”€ store.ts                  # Redux store
β”‚   β”œβ”€β”€ slices/                   # Redux slices
β”‚   β”œβ”€β”€ maintenance-cache.ts      # πŸ†• Maintenance caching system
β”‚   └── utils.ts                  # Helper utilities
β”œβ”€β”€ hooks/                        # Custom React hooks
β”‚   β”œβ”€β”€ use-geolocation.ts        # Geolocation hook
β”‚   β”œβ”€β”€ use-mobile.ts             # Mobile detection
β”‚   └── use-toast.ts              # Toast notifications
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ maintenance/              # πŸ†• Maintenance assets
β”‚   β”‚   └── blood.png             # πŸ†• Blood drop image for loader
β”‚   └── ...
β”œβ”€β”€ scripts/                      # Utility scripts
β”‚   β”œβ”€β”€ create-admin.ts           # Admin creation script
β”‚   └── update-admin-password.ts  # Password update script
β”œβ”€β”€ styles/                       # CSS files
β”œβ”€β”€ package.json                  # Dependencies (cleaned up)
β”œβ”€β”€ tsconfig.json                 # TypeScript config
β”œβ”€β”€ next.config.mjs               # Next.js config
β”œβ”€β”€ tailwind.config.ts            # Tailwind CSS config
β”œβ”€β”€ middleware.ts                 # πŸ”§ Enhanced middleware with maintenance
β”œβ”€β”€ .vercelignore                 # πŸ†• Vercel deployment config
└── MAINTENANCE_LIGHT_THEME_UPDATE.md # πŸ†• Maintenance system docs

πŸ”§ Recent Technical Improvements

QR Scanner System Enhancements

  • Robust DOM Element Waiting: Implemented retry logic with maximum attempts
  • Enhanced Safety Checks: Added element validation before scanner creation
  • Improved Cleanup: Better error handling and resource cleanup
  • Camera Initialization: Enhanced camera access with proper error handling
  • Production Ready: Reliable QR scanning in both admin QR checker and event scanner

Maintenance System Features

  • Complete Route Protection: Middleware blocks all routes during maintenance
  • Real-Time Monitoring: 30-second auto-refresh with connection status
  • Priority-Based Styling: Different colors for maintenance levels
  • IP Whitelisting: Allow specific IPs to bypass maintenance
  • Emergency Access: Secret key bypass functionality
  • Professional UI: Beautiful maintenance page with Samarpan branding
  • Mobile Responsive: Perfect experience across all devices

Deployment Optimizations

  • Vercel Compatibility: Fixed lockfile conflicts and dependency issues
  • Build Optimization: Cleaned up problematic dependencies
  • Configuration Management: Proper .vercelignore and build settings
  • Zero-Config Deployment: Seamless deployment to Vercel

UI/UX Enhancements

  • Light Theme Consistency: Maintenance page matches site theme
  • Perfect Center Alignment: Maintenance indicator aligned with loader
  • Smart Navbar: Auto-hiding navigation during maintenance
  • Blood Drop Animation: Custom blood.png in maintenance loader
  • Glass Morphism: Modern design with subtle effects

πŸ“š API Documentation

Authentication Endpoints

POST /api/auth/signup – Register new user

{
  "email": "user@example.com",
  "password": "secure-password",
  "name": "John Doe",
  "phone": "+91XXXXXXXXXX",
  "bloodType": "O+"
}

POST /api/auth/login – User login

{
  "email": "user@example.com",
  "password": "password"
}

POST /api/auth/admin-login – Admin login

{
  "email": "admin@samarpan.com",
  "password": "admin-password"
}

Maintenance System Endpoints (NEW)

GET /api/admin/maintenance – Get maintenance status

{
  "enabled": false,
  "message": "Maintenance message",
  "priority": "medium",
  "enabledAt": "2026-01-02T18:00:00.000Z",
  "allowedIps": ["192.168.1.100"],
  "secretKey": "emergency-key"
}

POST /api/admin/maintenance – Update maintenance settings

{
  "enabled": true,
  "message": "We are performing scheduled maintenance...",
  "priority": "high",
  "allowedIps": ["192.168.1.100", "10.0.0.50"],
  "secretKey": "emergency-access-2026"
}

Blood Request Endpoints

GET /api/blood-request – Get all blood requests
POST /api/blood-request – Create new blood request
PUT /api/blood-request/[id] – Update blood request
DELETE /api/blood-request/[id] – Delete blood request

User Endpoints

GET /api/users – Get all users (admin only)
GET /api/users/[id] – Get user profile
PUT /api/users/[id] – Update user profile

Event Endpoints

GET /api/events – Get all events
POST /api/events – Create event (admin only)
PUT /api/events/[id] – Update event (admin only)
DELETE /api/events/[id] – Delete event (admin only)


πŸ” Authentication & Security

  • Password Hashing: bcryptjs with salt rounds = 10
  • JWT Tokens: Secure token-based authentication
  • Protected Routes: Enhanced middleware-based route protection
  • Maintenance Security: IP whitelisting and emergency access keys
  • Environment Variables: Sensitive data stored in .env.local
  • HTTPS Ready: Production-ready for HTTPS deployment
  • CORS: Properly configured cross-origin policies

πŸ§ͺ Development & Build

Available Scripts

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Run linting
npm run lint

# Create/Update admin account
npm run create-admin

# Initialize database
npm run db:init

# Full setup (install + create admin)
npm run setup

Environment-Specific Builds

The application uses environment-specific configurations:

  • Development: npm run dev – Hot reload enabled
  • Production: npm run build && npm start – Optimized build
  • Vercel: Automatic deployment with optimized configuration

πŸ“ Environment Variables

Create a .env.local file in the project root:

# MongoDB Connection
MONGODB_URL=mongodb+srv://user:pass@cluster.mongodb.net/samarpan

# JWT Configuration
JWT_SECRET=your-secret-key-min-32-characters

# Email Service
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
EMAIL_FROM=noreply@samarpan.com

# AWS S3 (Optional)
AWS_ACCESS_KEY_ID=XXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXX
AWS_S3_BUCKET=samarpan-uploads
AWS_REGION=us-east-1

# Google OAuth (Optional)
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com

# Admin Credentials (for initialization)
ADMIN_EMAIL=admin@samarpan.com
ADMIN_PASSWORD=strong-password

# Maintenance System (NEW)
MAINTENANCE_INTERNAL_TOKEN=your-internal-maintenance-token

# WhatsApp (Optional)
WHATSAPP_ENABLED=true
WHATSAPP_TOKEN=your-meta-whatsapp-token
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id
WHATSAPP_DEFAULT_COUNTRY_CODE=91

WhatsApp Setup

Enable WhatsApp notifications alongside in‑app notifications and email:

  • Set WHATSAPP_ENABLED to true to activate WhatsApp sending.
  • Provide WHATSAPP_TOKEN from your Meta WhatsApp Business Cloud API.
  • Set WHATSAPP_PHONE_NUMBER_ID to the sender phone number ID from Meta.
  • Optionally set WHATSAPP_DEFAULT_COUNTRY_CODE (e.g., 91) if your users store local numbers without a country code.

When enabled, flows such as blood requests, admin broadcasts, event registrations, QR verification, donation image reviews, certificate generation, transportation creation and status updates attempt best‑effort WhatsApp delivery if the user has a phone saved.


🎨 Customization

Styling

The project uses Tailwind CSS with a custom theme. Modify theme colors in tailwind.config.ts:

theme: {
  colors: {
    primary: '#your-color',
    secondary: '#your-color',
    // ... other colors
  }
}

UI Components

All UI components are in components/ui/ and based on Radix UI. Customize them as needed:

import { Button } from "@/components/ui/button"
import { Card } from "@/components/ui/card"
import { Input } from "@/components/ui/input"

Maintenance Page Customization

The maintenance page supports custom styling and messages:

// Custom maintenance messages by priority
const priorityConfigs = {
  low: { message: 'Routine maintenance in progress' },
  medium: { message: 'Scheduled maintenance underway' },
  high: { message: 'Important system updates' },
  critical: { message: 'Critical maintenance required' }
}

πŸš€ Deployment

Vercel (Recommended) - ENHANCED

  1. Push your repository to GitHub
  2. Connect to Vercel: https://vercel.com/new
  3. Set environment variables in Vercel dashboard:
    • CRITICAL FOR PASSWORD RESET: Set NEXT_PUBLIC_APP_URL to your production domain (e.g., https://yourdomain.com)
      • Without this, password reset links will not work correctly
      • If not set, the app will try to auto-detect using VERCEL_URL, but explicitly setting it is recommended
    • Include all other required variables: MONGODB_URL, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, SMTP_* settings
    • NEW: Add MAINTENANCE_INTERNAL_TOKEN for maintenance system
  4. Deploy! (Now works seamlessly with fixed dependency issues)

⚠️ Password Reset Configuration: Password reset emails contain a link to /reset-password. This URL must be accessible from the internet. The app constructs it using:

  • Priority 1: NEXT_PUBLIC_APP_URL environment variable
  • Priority 2: Vercel's automatic VERCEL_URL (if not set in Priority 1)
  • Priority 3: Request headers (x-forwarded-proto, x-forwarded-host)
  • Priority 4: Request origin

To ensure password reset works on production:

NEXT_PUBLIC_APP_URL=https://your-production-domain.com

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
CMD ["npm", "start"]

Traditional Server

npm install --production
npm run build
npm start

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your 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 Standards

  • Follow ESLint rules
  • Use TypeScript for type safety
  • Add comments for complex logic
  • Test new features thoroughly
  • Keep components focused and reusable
  • Test QR scanner functionality on real devices
  • Verify maintenance mode works across all routes

πŸ“„ License

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


πŸ™ Acknowledgments

  • Radix UI – For excellent accessible components
  • Next.js – For the amazing React framework
  • MongoDB – For robust database solutions
  • Tailwind CSS – For utility-first CSS framework
  • html5-qrcode – For reliable QR code scanning functionality
  • The Open Source Community – For invaluable libraries and tools

πŸ“ž Support

For support, email support@samarpan.com or open an issue in the repository.


πŸ—ΊοΈ Roadmap

  • QR Scanner System - Reliable QR code scanning βœ…
  • Maintenance System - Complete maintenance mode βœ…
  • Deployment Optimization - Vercel compatibility βœ…
  • Mobile app (React Native)
  • Advanced analytics dashboard
  • AI-powered donor matching
  • SMS notifications
  • WhatsApp integration
  • Multi-language support
  • Blood bank inventory management
  • Plasma donation support

πŸ” Troubleshooting Guide

Common Issues & Solutions

QR Scanner Issues βœ… FIXED

  • Problem: "HTML Element with id=admin-qr-reader not found"
  • Solution: βœ… RESOLVED - Implemented robust DOM element waiting with retry logic

Deployment Issues βœ… FIXED

  • Problem: "Cannot install with 'frozen-lockfile'" on Vercel
  • Solution: βœ… RESOLVED - Cleaned up dependencies and lockfile conflicts

Maintenance Mode

  • Enable: Admin Dashboard β†’ Maintenance Mode β†’ Toggle switch
  • Priority Levels: Choose from low, medium, high, critical for different styling
  • Emergency Access: Use secret key parameter: ?secret=your-key
  • IP Bypass: Add allowed IPs in maintenance settings

Camera Access

  • HTTPS Required: Camera access requires HTTPS on mobile devices
  • Permissions: Ensure camera permissions are granted in browser
  • Testing: Use npm run dev -- --host for local mobile testing

Made with ❀️ to save lives

Latest Update: January 2026 - Enhanced QR System, Maintenance Mode & Deployment

⬆ Back to Top

About

Samarpan is a comprehensive blood donation management platform designed to connect donors with patients in need of blood and platelets. Built with modern web technologies, it enables real-time connections, efficient donor management, and streamlined administrative operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.9%
  • Other 1.1%