A modern web application built with Next.js, TypeScript, and Firebase to connect blood donors with recipients.
-
User Authentication
- Donor registration and login
- Acceptor registration and login
- Secure password management
- Role-based access control
-
Donor Management
- Profile management
- Blood type tracking
- Donation history
- Availability status
-
Blood Request System
- Create blood requests
- Track request status
- Match with available donors
- Emergency request handling
-
Admin Dashboard
- User management
- Request monitoring
- Statistics and analytics
- System settings
- Frontend Framework: Next.js 15.1.0
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Authentication: Firebase Auth
- Database: Firebase Firestore
- Deployment: Firebase Hosting
blood-donation-app/
├── app/ # Next.js app directory
│ ├── admin/ # Admin dashboard pages
│ ├── register/ # Registration pages
│ ├── login/ # Login pages
│ ├── dashboard/ # User dashboard
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # Reusable components
│ ├── ui/ # UI components
│ ├── theme-provider.tsx # Theme management
│ └── forms/ # Form components
├── hooks/ # Custom React hooks
│ └── use-auth.tsx # Authentication hook
├── lib/ # Utility functions
│ └── firebase.ts # Firebase configuration
├── public/ # Static assets
│ ├── images/ # Image assets
│ ├── icons/ # Icon assets
│ ├── logos/ # Logo assets
│ └── favicon/ # Favicon assets
└── styles/ # Global styles
hooks/use-auth.tsx: Manages user authentication state and methodslib/firebase.ts: Firebase configuration and initializationapp/login/page.tsx: Login page with form validationapp/register/page.tsx: Registration page with role selection
app/admin/page.tsx: Main admin dashboardapp/admin/donors/page.tsx: Donor managementapp/admin/requests/page.tsx: Request managementapp/admin/appointments/page.tsx: Appointment scheduling
components/theme-provider.tsx: Handles theme switchingapp/layout.tsx: Root layout with theme providerstyles/globals.css: Global styles and theme variables
- Firebase Authentication for user management
- Firestore Security Rules for data access control
- Environment variables for sensitive data
- Role-based access control
-
Clone the repository
git clone [repository-url] cd blood-donation-app -
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile with your Firebase configuration:NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id -
Run the development server
npm run dev
-
User Registration
- User fills registration form
- Data validated and sent to Firebase Auth
- User profile created in Firestore
- Redirected to dashboard
-
Blood Request
- Acceptor creates request
- Request stored in Firestore
- Admin notified
- Matched with available donors
-
Donation Process
- Donor accepts request
- Appointment scheduled
- Status updated in real-time
- History recorded
The app uses a custom theme system with:
- Light/Dark mode support
- System preference detection
- Smooth transitions
- Persistent theme selection
Firestore security rules ensure:
- Users can only access their own data
- Admins have full access
- Donors can only update their availability
- Acceptors can only manage their requests
- Mobile-first approach
- Responsive layouts
- Touch-friendly interfaces
- Adaptive navigation
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- Firebase for backend services
- shadcn/ui for beautiful components
- All contributors and supporters