Skip to content

About

🩸 Next.js 16 web application for DropOfLife (ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ). Features Google OAuth 2.0 direct sign-in, strict duplicate account prevention, 60fps vascular RBC canvas animations, blood compatibility matrix, real-time emergency requisitions across all 64 districts of Bangladesh, Stripe checkout, bilingual English/Bengali UI, and role-based portals

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🩸 DropOfLife Frontend (ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ)

Modern Clinical Blood Donation, Emergency Telemetry & Lifesaver Network Web Application

Next.js React TypeScript TailwindCSS Zustand Google OAuth Stripe Vercel License: MIT


πŸ“Œ GitHub Repository Details (About Section)

  • Repository Description:

    🩸 Cutting-edge, responsive Next.js 16 web application for DropOfLife (ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ). Features Google OAuth 2.0 direct sign-in, strict duplicate account prevention, 60fps vascular RBC canvas animations, interactive blood compatibility matrix, real-time emergency requisitions across all 64 districts of Bangladesh, Stripe checkout, bilingual English/Bengali localization, and role-based portals for donors, hospitals, and administrators.

  • Website / Live Demo: https://drop-of-life.vercel.app (or Vercel deployed URL)
  • API Backend: https://dropoflife-backend.onrender.com/api/v1
  • Topics / Tags: nextjs, react19, typescript, tailwindcss, blood-donation, healthcare-web-app, google-oauth, stripe-checkout, zustand, bilingual-ui, bangladesh-healthcare, emergency-dispatch, dark-mode, glassmorphism, vercel-deployment

πŸ“– Overview

DropOfLife (ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ) is a state-of-the-art emergency blood donation and dispatch web application engineered to bridge the critical gap between voluntary blood donors, patients in urgent need, and healthcare institutions across Bangladesh.

Built with Next.js 16 (App Router) and React 19, the client provides an ultra-responsive, high-contrast, dark obsidian glassmorphism user interface designed for mission-critical clarity under emergency conditions.


✨ Key Features & User Experience

1. πŸ” Seamless Authentication & Onboarding

  • Direct "Continue with Google" Sign-In: Once registered, any subsequent login with Google instantly authenticates the user into their session without ever re-prompting Step 2 modal dialogs.
  • 2-Step Mandatory Medical Profiling: First-time Google lifesavers complete a streamlined Step 2 modal to register their emergency contact phone, verified blood group, and geographical district.
  • Strict Duplicate Prevention: Prohibits creating more than one account using the same email address or phone number, with intelligent normalization across all Bangladeshi mobile operator prefixes (+880 / 01).
  • Silent Dual-Token Session Refresh: Axios response interceptors automatically refresh expired JWT Access Tokens using 30-day Refresh Tokens without interrupting user activity.
  • 1-Click Clinical Demo Logins: Pre-configured test access for Super Admin, Registered Donor, and Central Blood Bank Hospital portals.

2. 🩸 Interactive Clinical Tools & Telemetry

  • Interactive Blood Compatibility Matrix: Visual ABO and Rh factor compatibility engine showing universal donor ($O^-$) and universal recipient ($AB^+$) relations.
  • 60fps Micro-Vascular Canvas Animation: High-performance animated simulation of red blood cells flowing through vascular capillary networks.
  • Real-Time Emergency Dispatch Feed: Live requisition ticker featuring urgency badges (Standard, Urgent, Critical ICU), units required, and direct phone dialer links.
  • Medical Eligibility Pre-Screening Quiz: Interactive questionnaire evaluating donation readiness based on age, weight, donation history, and health criteria.

3. πŸ—ΊοΈ 64-District Geo-Aware Directory & Requisitions

  • Comprehensive filtering by all 8 Divisions and 64 Districts of Bangladesh.
  • Real-time availability indicator and 90-day post-donation recovery cool-down tracking.
  • Instant Direct Request Modal for one-on-one donor coordination.

4. πŸ₯ Role-Based Dashboards

  • Donor Portal (/dashboard/donor): Personal donation telemetry, badges, schedule appointments, and pledge management.
  • Hospital / Provider Portal (/dashboard/provider): Real-time blood bank inventory management by component (Whole Blood, PRBC, FFP, Platelets) and emergency dispatch logs.
  • Super Administrator Portal (/dashboard/admin): Platform telemetry, user verification/suspension controls, and clinical complaint management.

5. πŸ’³ Stripe Lifesaver Fund

  • Embedded secure payment sheet for transparent financial contributions supporting emergency oxygen, testing kits, and volunteer logistics.
  • Instant automated donation receipts.

6. 🌐 Native Bilingual Localization (বাংলা / English)

  • Strict dual-language support with instant navbar toggle between English and Bengali across all interface components, badges, and modals.

πŸ›οΈ Project Directory Structure

frontend/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ images/                     # Clinical hero imagery & assets
β”‚   └── site.webmanifest
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   β”‚   β”œβ”€β”€ login/              # High-contrast login portal with Google OAuth & 1-click demos
β”‚   β”‚   β”‚   β”œβ”€β”€ register/           # Multi-step registration with unique validation
β”‚   β”‚   β”‚   └── reset-password/     # Secure OTP verification & password update
β”‚   β”‚   β”œβ”€β”€ (public)/
β”‚   β”‚   β”‚   β”œβ”€β”€ camps/              # Blood donation camps and slot registration
β”‚   β”‚   β”‚   β”œβ”€β”€ donors/             # Geo-aware searchable donor directory
β”‚   β”‚   β”‚   β”œβ”€β”€ emergency-requests/ # Live emergency requisitions dispatch feed
β”‚   β”‚   β”‚   └── support/            # Lifesaver Fund Stripe donation checkout
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/              # Super admin system operations & moderation
β”‚   β”‚   β”‚   β”œβ”€β”€ donor/              # Voluntary donor telemetry & donation history
β”‚   β”‚   β”‚   └── provider/           # Hospital blood bank inventory & emergency alerts
β”‚   β”‚   β”œβ”€β”€ api/                    # Next.js API route handlers (Google OAuth & Stripe webhooks)
β”‚   β”‚   β”œβ”€β”€ globals.css             # Obsidian dark glassmorphism design tokens & utilities
β”‚   β”‚   β”œβ”€β”€ layout.tsx              # Root HTML layout, font optimization, navigation shell
β”‚   β”‚   └── page.tsx                # Clinical landing page, telemetry stats, compatibility matrix
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ auth/                   # GoogleLoginTwoStepModal, ResetPasswordModal
β”‚   β”‚   β”œβ”€β”€ blood/                  # Compatibility matrix, donor cards, eligibility quiz
β”‚   β”‚   β”œβ”€β”€ donors/                 # Direct request modal, donor filters, donor grid
β”‚   β”‚   β”œβ”€β”€ emergency/              # Emergency requisition cards & creation modal
β”‚   β”‚   β”œβ”€β”€ home/                   # Hero banner, 3D blood canvas, clinical workflow showcase
β”‚   β”‚   β”œβ”€β”€ payment/                # Stripe Elements card form & receipt modal
β”‚   β”‚   β”œβ”€β”€ shared/                 # Ambient backgrounds, Navbar, Footer, Liquid loaders
β”‚   β”‚   └── ui/                     # Accessible UI atoms (Button, Card, Input, Dialog)
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ api.ts                  # Axios client with automatic JWT token refresh interceptors
β”‚   β”‚   β”œβ”€β”€ constants.ts            # Divisions, districts, blood groups, hotline definitions
β”‚   β”‚   └── translations.ts         # Comprehensive English/Bengali localization dictionaries
β”‚   β”œβ”€β”€ middleware.ts               # Next.js edge route protection & RBAC dashboard guards
β”‚   β”œβ”€β”€ stores/                     # Zustand stores (authStore, languageStore, toastStore)
β”‚   └── types/                      # TypeScript domain models and interfaces
β”œβ”€β”€ package.json
└── tsconfig.json

βš™οΈ Environment Variables

Create a .env.local file in the frontend/ directory:

# DropOfLife Backend REST API Endpoint
NEXT_PUBLIC_API_URL=http://localhost:5050/api/v1
# In production on Vercel:
# NEXT_PUBLIC_API_URL=https://dropoflife-backend.onrender.com/api/v1

# Branding & Platform Metadata
NEXT_PUBLIC_APP_NAME="DropOfLife"
NEXT_PUBLIC_APP_TAGLINE="ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ β€” Every Drop Matters"
NEXT_PUBLIC_HOTLINE="+8801521711716"

# Google OAuth 2.0 Credentials
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Stripe Payments
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...

πŸ› οΈ Local Development Setup

1. Clone & Install Dependencies

git clone https://github.com/rakibul263/DropOfLife-Frontend.git
cd DropOfLife-Frontend
npm install

2. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser to view the application.

3. Production Build & Validation

npm run build
npm start

πŸš€ Deployment to Vercel

  1. Push your repository to GitHub (https://github.com/rakibul263/DropOfLife-Frontend).
  2. Log into Vercel and import the repository.
  3. Configure Environment Variables in the Vercel dashboard:
    • NEXT_PUBLIC_API_URL: https://dropoflife-backend.onrender.com/api/v1
    • NEXT_PUBLIC_BETTER_AUTH_URL: https://your-domain.vercel.app
    • GOOGLE_CLIENT_ID & GOOGLE_CLIENT_SECRET
    • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
  4. Click Deploy. Vercel will build and launch your application globally on its Edge network.

πŸ“ž 24/7 National Emergency Hotline

  • Mobile Hotline: +8801521711716
  • Central Dispatch: 02-9351969
  • Compliance: 100% DGHS (Directorate General of Health Services) & WHO Blood Transfusion Standards.

πŸ“„ License

This project is licensed under the MIT License.

About

🩸 Next.js 16 web application for DropOfLife (ΰ¦œΰ§€ΰ¦¬ΰ¦¨ΰ§‡ΰ¦° এক ΰ¦«ΰ§‹ΰ¦ΰ¦Ÿΰ¦Ύ). Features Google OAuth 2.0 direct sign-in, strict duplicate account prevention, 60fps vascular RBC canvas animations, blood compatibility matrix, real-time emergency requisitions across all 64 districts of Bangladesh, Stripe checkout, bilingual English/Bengali UI, and role-based portals

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages