A modern, responsive web application for blood donation management, featuring real-time updates, interactive maps, and comprehensive donor/staff portals.
Live Demo β’ API Backend β’ Report Bug β’ Request Feature
- About The Project
- Key Features
- Tech Stack
- System Architecture
- Getting Started
- Project Structure
- User Interfaces
- Deployment
- Contributing
- License
BDSS Frontend is a modern, enterprise-grade web application built with Next.js 15 and React 19, providing comprehensive interfaces for blood donation management. The platform serves three distinct user roles (Donors, Staff, and Administrators) with tailored experiences for each, featuring real-time notifications, interactive maps, and intuitive workflows.
- Development Period: 4 months (5/2025 - 8/2025)
- Team Size: 1 Developer (Solo Project)
- Framework: Next.js 15 with App Router
- Architecture: Component-based Architecture with Server/Client Components
- Lines of Code: ~10,000+ (Frontend only)
Traditional blood donation web interfaces suffer from:
- Poor user experience and outdated designs
- Lack of real-time updates for donors and staff
- Limited mobile responsiveness
- Complex navigation and workflows
- No interactive features like maps or live tracking
- Inconsistent state management across pages
BDSS Frontend provides a modern, user-friendly platform that:
- Delivers seamless user experience across all devices
- Implements real-time updates via SignalR WebSockets
- Features interactive maps for location discovery
- Offers intuitive role-based dashboards and workflows
- Utilizes modern state management with Redux and React Query
- Provides accessible, WCAG-compliant UI components
- Responsive design - Mobile-first approach, optimized for all screen sizes
- Modern UI/UX - Clean, intuitive interfaces with Ant Design components
- Dark/Light mode - Customizable theme preferences (planned)
- Accessibility - WCAG 2.1 compliant components
- Loading states - Skeleton screens and smooth transitions
- Error handling - User-friendly error messages and retry mechanisms
- JWT-based authentication - Secure token-based login system
- Role-based routing - Protected routes based on user roles
- Persistent sessions - Auto-refresh tokens for seamless experience
- Password recovery - Email-based password reset flow
- Account registration - Multi-step registration with validation
- Personal dashboard - Overview of donation history and stats
- Appointment booking - Browse and book donation events with calendar view
- Donation history - Complete timeline of past donations with badges
- Eligibility tracker - Visual countdown to next eligible donation date
- Profile management - Update personal and medical information
- Nearby locations - Interactive map to find closest donation centers
- Real-time notifications - Instant alerts for appointment status changes
- Achievement system - Badges and milestones for donation goals
- Staff dashboard - Real-time metrics and pending tasks overview
- Event management - Create, edit, and manage donation events
- Donation workflow - Step-by-step process for conducting donations
- Donor check-in and verification
- Medical screening and questionnaire
- Blood sample collection
- Post-donation care and monitoring
- Appointment management - Approve/reject appointment requests
- Inventory management - Track blood stock levels and components
- Donor profiles - View complete donor histories and medical records
- Blood requests - Process urgent blood requests from hospitals
- Capacity management - Set and monitor daily donation limits
- Admin dashboard - Comprehensive system analytics and KPIs
- User management - CRUD operations for all user accounts
- Staff management - Create and manage staff accounts with permissions
- Location management - Add/edit donation centers with map integration
- Content management - Blog post creation with rich text editor
- Document library - Upload and manage policy documents
- System settings - Configure application-wide settings
- Reports & analytics - Generate custom reports and export data
- Leaflet integration - Open-source mapping with OpenStreetMap
- Location markers - Visual display of all donation centers
- Proximity search - Find nearest locations based on user's position
- Directions - Get directions to selected donation center
- Custom map styles - Themed map appearance
- SignalR integration - WebSocket-based real-time messaging
- Notification center - Centralized inbox for all notifications
- Push notifications - Instant alerts for critical updates
- Notification badges - Unread count indicators
- Notification filters - Sort by type and read status
- Chart.js integration - Interactive charts and graphs
- Dashboard widgets - Real-time statistics cards
- Trend analysis - Historical data visualization
- Export functionality - Download charts as images
- React Hook Form - Performant form handling
- Multi-step forms - Wizard-style registration and workflows
- Client-side validation - Instant feedback on form inputs
- Rich text editor - React Quill for blog content creation
- Next.js optimizations - Automatic code splitting and lazy loading
- Image optimization - Next.js Image component for optimal loading
- React Query caching - Smart data caching and background refetching
- Skeleton loaders - Improved perceived performance
- Debounced search - Optimized search input handling
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.3.4 | React framework with App Router |
| React | 19 | UI library for building components |
| TypeScript | 5.0+ | Type-safe JavaScript |
| Node.js | 18+ | JavaScript runtime |
| Technology | Purpose |
|---|---|
| Ant Design | 5.26.1 - Enterprise UI component library |
| Tailwind CSS | 3.x - Utility-first CSS framework |
| CSS Modules | Component-scoped styling |
| Ant Design Icons | Icon library |
| Sass/SCSS | CSS preprocessor (optional) |
| Technology | Purpose |
|---|---|
| Redux Toolkit | Global state management |
| React Query (TanStack Query) | Server state management and caching |
| React Context | Component-level state sharing |
| React Hooks | Local component state |
| Technology | Purpose |
|---|---|
| Axios | HTTP client for API requests |
| SignalR (@microsoft/signalr) | Real-time WebSocket communication |
| Axios Interceptors | Request/response transformation |
| Technology | Purpose |
|---|---|
| Leaflet | Interactive mapping library |
| React-Leaflet | React wrapper for Leaflet |
| Mapbox GL (optional) | Advanced map styling |
| OpenStreetMap | Map tile provider |
| Geolocation API | Browser geolocation |
| Technology | Purpose |
|---|---|
| Chart.js | Chart and graph library |
| React-Chartjs-2 | React wrapper for Chart.js |
| Technology | Purpose |
|---|---|
| React Hook Form | Form state management |
| Zod | Schema validation |
| React Quill | Rich text WYSIWYG editor |
| Technology | Purpose |
|---|---|
| Day.js | Date manipulation and formatting |
| Ant Design DatePicker | Date/time input components |
| Technology | Purpose |
|---|---|
| Lodash | JavaScript utility library |
| clsx / classnames | Conditional CSS class management |
| react-hot-toast | Toast notifications (optional) |
| Tool | Purpose |
|---|---|
| ESLint | Code linting |
| Prettier | Code formatting |
| Husky | Git hooks |
| TypeScript ESLint | TypeScript-specific linting |
| Platform | Purpose |
|---|---|
| Vercel | Production hosting and CI/CD |
| npm / yarn | Package management |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser / Client β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Application β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β App Router (app/) β β
β β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββββ β β
β β β (auth)/ β β admin/ β β staff/ β member/ β β β
β β β β’ login β β β’ dashboard β β β’ events β β’ profile β β β
β β β β’ register β β β’ users β β β’ workflow β β’ history β β β
β β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Component Layer β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Layout β β Feature β β UI β β Forms β β
β β Components β β Components β β Components β β Components β β
β β β’ Header β β β’ Dashboard β β β’ Cards β β β’ Login β β
β β β’ Sidebar β β β’ EventList β β β’ Tables β β β’ Register β β
β β β’ Footer β β β’ MapView β β β’ Modals β β β’ Profile β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β State Management Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Redux Store β β
β β β’ authSlice (user, token, role) β β
β β β’ notificationSlice (messages, unread count) β β
β β β’ uiSlice (theme, sidebar state) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β React Query (TanStack Query) β β
β β β’ Server state caching β β
β β β’ Background refetching β β
β β β’ Optimistic updates β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Service Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β API Services (services/api/) β β
β β β’ authService - Login, register, token refresh β β
β β β’ donationService - Events, appointments, donations β β
β β β’ userService - Profile, users management β β
β β β’ inventoryService - Blood inventory CRUD β β
β β β’ locationService - Locations, capacity β β
β β β’ notificationService - Notifications, read status β β
β β β’ blogService - Blog posts, content β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Axios HTTP Client β β
β β β’ Request interceptors (add JWT token) β β
β β β’ Response interceptors (handle errors, refresh token) β β
β β β’ Base URL configuration β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SignalR Hub Connection β β
β β β’ Real-time notification hub β β
β β β’ Automatic reconnection β β
β β β’ Event handlers for push messages β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β External Services β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ β
β β BDSS Backend API β β OpenStreetMap β β Cloudinary β β
β β (REST + SignalR) β β (Map Tiles) β β (Images) β β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Application Root β
β β’ Redux Provider β
β β’ React Query Provider β
β β’ SignalR Provider β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layout Components β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β AdminLayout β β StaffLayout β β MemberLayout β β
β β β’ Header β β β’ Header β β β’ Header β β
β β β’ Sidebar β β β’ Sidebar β β β’ Navbar β β
β β β’ Content β β β’ Content β β β’ Content β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Page Components β
β β’ Dashboard pages β
β β’ List pages (tables, cards) β
β β’ Detail pages β
β β’ Form pages (create, edit) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Feature Components β
β β’ EventCard, EventList, EventDetails β
β β’ AppointmentCard, AppointmentList β
β β’ MapView, LocationMarker β
β β’ NotificationBell, NotificationList β
β β’ DonationHistory, DonationTimeline β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UI Components β
β β’ Button, Input, Select (Ant Design) β
β β’ Card, Table, Modal β
β β’ Form, DatePicker, Upload β
β β’ Chart, Badge, Tag β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Required
- Node.js 18+ or later
- npm or yarn package manager
- Git
# Recommended
- VS Code with ESLint and Prettier extensions
- React Developer Tools browser extension
- Redux DevTools browser extension-
Clone the repository
git clone https://github.com/yourusername/BDSS.git cd BDSS/BloodDonationSupportSystem-FE -
Install dependencies
npm install # or yarn install -
Configure Environment Variables
Create a
.env.localfile in the root directory:# Backend API URL NEXT_PUBLIC_API_URL=https://localhost:5222/api # SignalR Hub URL NEXT_PUBLIC_SIGNALR_URL=https://localhost:5222 # Map Configuration NEXT_PUBLIC_MAP_API_KEY=your_mapbox_api_key_here NEXT_PUBLIC_MAP_STYLE=mapbox://styles/mapbox/streets-v11 # App Configuration NEXT_PUBLIC_APP_NAME=BDSS NEXT_PUBLIC_APP_VERSION=1.0.0 # Feature Flags NEXT_PUBLIC_ENABLE_NOTIFICATIONS=true NEXT_PUBLIC_ENABLE_DARK_MODE=false
-
Run Development Server
npm run dev # or yarn dev -
Open Browser
Navigate to:
http://localhost:3000
# Create optimized production build
npm run build
# Start production server
npm run start
# Export static site (if applicable)
npm run exportnpm run dev # Start development server
npm run build # Create production build
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors
npm run format # Format code with Prettier
npm run type-check # Run TypeScript type checkingsrc/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication Routes (Layout Group)
β β βββ login/
β β β βββ page.tsx # Login page
β β βββ register/
β β β βββ page.tsx # Registration page
β β βββ forgot-password/
β β β βββ page.tsx # Password recovery
β β βββ layout.tsx # Auth layout (centered, no sidebar)
β β
β βββ admin/ # Admin Portal Routes
β β βββ dashboard/
β β β βββ page.tsx # Admin dashboard
β β βββ users/
β β β βββ page.tsx # User list
β β β βββ [id]/
β β β β βββ page.tsx # User details
β β β βββ create/
β β β βββ page.tsx # Create user
β β βββ staffs/
β β β βββ page.tsx # Staff management
β β βββ locations/
β β β βββ page.tsx # Location list
β β β βββ [id]/
β β β βββ page.tsx # Location details
β β βββ blog/
β β β βββ page.tsx # Blog post list
β β β βββ create/
β β β β βββ page.tsx # Create post
β β β βββ [id]/
β β β βββ page.tsx # Post details
β β β βββ edit/
β β β βββ page.tsx # Edit post
β β βββ documents/
β β β βββ page.tsx # Document library
β β βββ layout.tsx # Admin layout (with sidebar)
β β
β βββ staff/ # Staff Portal Routes
β β βββ dashboard/
β β β βββ page.tsx # Staff dashboard
β β βββ donation-events/
β β β βββ page.tsx # Event list
β β β βββ create/
β β β β βββ page.tsx # Create event
β β β βββ [id]/
β β β βββ page.tsx # Event details
β β β βββ edit/
β β β βββ page.tsx # Edit event
β β βββ donation-workflow/
β β β βββ [id]/
β β β βββ page.tsx # Workflow steps for event
β β βββ inventory/
β β β βββ page.tsx # Inventory list
β β β βββ statistics/
β β β βββ page.tsx # Inventory stats
β β βββ donors/
β β β βββ page.tsx # Donor list
β β β βββ [id]/
β β β βββ page.tsx # Donor profile
β β βββ appointments/
β β β βββ page.tsx # Appointment requests
β β βββ blood-request/
β β β βββ page.tsx # Blood requests
β β βββ capacity/
β β β βββ page.tsx # Capacity management
β β βββ layout.tsx # Staff layout
β β
β βββ member/ # Member/Donor Portal Routes
β β βββ dashboard/
β β β βββ page.tsx # Member dashboard
β β βββ appointments/
β β β βββ page.tsx # My appointments
β β β βββ book/
β β β βββ page.tsx # Book appointment
β β βββ donation-history/
β β β βββ page.tsx # Donation history
β β βββ profile/
β β β βββ page.tsx # Profile settings
β β βββ nearby-search/
β β β βββ page.tsx # Find locations (map)
β β βββ layout.tsx # Member layout
β β
β βββ page.tsx # Homepage (public)
β βββ layout.tsx # Root layout
β βββ loading.tsx # Global loading state
β βββ error.tsx # Global error boundary
β βββ not-found.tsx # 404 page
β
βββ components/ # Reusable Components
β βββ Layout/
β β βββ Header.tsx # Main header
β β βββ Footer.tsx # Footer
β β βββ Sidebar.tsx # Navigation sidebar
β β βββ AdminLayout.tsx # Admin layout wrapper
β β βββ StaffLayout.tsx # Staff layout wrapper
β β βββ MemberLayout.tsx # Member layout wrapper
β β
β βββ Auth/
β β βββ LoginForm.tsx # Login form component
β β βββ RegisterForm.tsx # Registration form
β β βββ ProtectedRoute.tsx # Route guard component
β β
β βββ Donation/
β β βββ EventCard.tsx # Event card display
β β βββ EventList.tsx # Event list view
β β βββ EventDetails.tsx # Event details
β β βββ AppointmentCard.tsx # Appointment card
β β βββ DonationHistory.tsx # History timeline
β β βββ WorkflowSteps.tsx # Workflow stepper
β β
β βββ Inventory/
β β βββ InventoryTable.tsx # Inventory table
β β βββ StockChart.tsx # Stock level chart
β β βββ BloodTypeCard.tsx # Blood type card
β β
β βββ Map/
β β βββ MapView.tsx # Map container
β β βββ LocationMarker.tsx # Location marker
β β βββ DirectionsPanel.tsx # Directions sidebar
β β
β βββ Notification/
β β βββ NotificationBell.tsx # Notification icon
β β βββ NotificationList.tsx # Notification dropdown
β β βββ NotificationItem.tsx # Single notification
β β
β βββ Dashboard/
β β βββ StatCard.tsx # Dashboard stat card
β β βββ RecentActivity.tsx # Activity feed
β β βββ QuickActions.tsx # Action buttons
β β
β βββ Common/
β βββ Button.tsx # Custom button
β βββ Card.tsx # Custom card
β βββ Table.tsx # Custom table
β βββ Modal.tsx # Custom modal
β
βββ services/ # API Services
β βββ api/
β βββ apiConfig.ts # Axios configuration
β βββ authService.ts # Auth endpoints
β βββ donationService.ts # Donation endpoints
β βββ userService.ts # User endpoints
β βββ inventoryService.ts # Inventory endpoints
β βββ locationService.ts # Location endpoints
β βββ notificationService.ts # Notification endpoints
β βββ blogService.ts # Blog endpoints
β βββ signalrService.ts # SignalR connection
β
βββ store/ # Redux Store
β βββ slices/
β β βββ authSlice.ts # Auth state slice
β β βββ notificationSlice.ts # Notification state
β β βββ uiSlice.ts # UI state (theme, sidebar)
β βββ hooks.ts # Typed Redux hooks
β βββ store.ts # Store configuration
β
βββ hooks/ # Custom React Hooks
β βββ useAuth.ts # Authentication hook
β βββ useDonation.ts # Donation operations hook
β βββ useNotifications.ts # Real-time notifications
β βββ useMap.ts # Map utilities hook
β βββ useDebounce.ts # Debounce hook
β
βββ types/ # TypeScript Types
β βββ auth.ts # Auth-related types
β βββ donation.ts # Donation types
β βββ user.ts # User types
β βββ inventory.ts # Inventory types
β βββ notification.ts # Notification types
β βββ api.ts # API response types
β
βββ utils/ # Utility Functions
β βββ formatters.ts # Date, number formatters
β βββ validators.ts # Form validators
β βββ constants.ts # App constants
β βββ helpers.ts # Helper functions
β βββ storage.ts # LocalStorage helpers
β
βββ styles/ # Global Styles
β βββ globals.css # Global CSS
β βββ variables.css # CSS variables
β βββ antd-overrides.css # Ant Design overrides
β
βββ public/ # Static Assets
β βββ images/
β β βββ logo.png
β β βββ hero-bg.jpg
β β βββ icons/
β βββ fonts/
β βββ favicon.ico
β
βββ middleware.ts # Next.js Middleware (Auth, routing)
- Dashboard: Personal statistics, upcoming appointments, donation eligibility status
- Book Appointment: Browse events, select date/time, confirm booking
- Donation History: Timeline view of past donations with certificates
- Find Locations: Interactive map with nearby donation centers
- Profile: Update personal info, medical history, notification preferences
- Dashboard: Daily metrics, pending approvals, recent activities
- Events: Create/manage donation events, set capacity, view registrations
- Workflow: Step-by-step donation process (check-in β screening β collection β completion)
- Inventory: Real-time blood stock levels, add/remove units, expiry alerts
- Appointments: Approve/reject requests, view donor details
- Donors: Search donors, view profiles, check eligibility
- Dashboard: System-wide analytics, charts, KPIs
- User Management: Create/edit/delete users, assign roles
- Staff Management: Manage staff accounts and permissions
- Locations: Add/edit donation centers with coordinates
- Blog: Create educational content with rich text editor
- Documents: Upload policies and guidelines
- Reports: Generate and export system reports
-
Install Vercel CLI
npm install -g vercel
-
Login to Vercel
vercel login
-
Deploy
# Development deployment vercel # Production deployment vercel --prod
-
Configure Environment Variables in Vercel Dashboard
- Go to Project Settings β Environment Variables
- Add all variables from
.env.local
-
Build the application
npm run build
-
Test production build locally
npm run start
-
Deploy
.nextfolder to your hosting provider
NEXT_PUBLIC_API_URL=https://your-api-domain.com/api
NEXT_PUBLIC_SIGNALR_URL=https://your-api-domain.com
NEXT_PUBLIC_MAP_API_KEY=production_mapbox_keyVercel automatically deploys on every push to the main branch:
- Pull Requests: Preview deployments
- Main Branch: Production deployments
While this is currently a solo project for portfolio purposes, suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Airbnb JavaScript Style Guide
- Use TypeScript for type safety
- Write clean, self-documenting code
- Add comments for complex logic
- Create reusable components
- Use proper naming conventions
This project is developed for educational and portfolio purposes.
- Development Time: 4 months (5/2025 - 8/2025)
- Lines of Code: ~10,000+
- React Components: 50+ components
- Pages/Routes: 30+ pages
- API Integrations: 40+ endpoints
- Third-party Libraries: 20+ packages
Built with β€οΈ and β by Son