Real-time open-source community platform connecting emergency blood seekers with available local blood donors.
Hema is a lightweight, high-performance web application designed to bridge the gap between patients in critical need of blood transfusions and voluntary blood donors. Built using React 19 and Vite 7, Hema provides zero-latency blood group filtering, real-time city searching, availability status tracking, and emergency help dispatching.
- π©Έ Multi-Group Blood Filtering: Instant selection across all primary ABO/Rh blood groups (
A+,A-,B+,B-,AB+,AB-,O+,O-). - ποΈ Location-Based Search: Real-time city search filtering to locate nearest available donors.
- β‘ Live Availability Counter & Priority Sorting: Dynamic counts of active donors with available donors automatically prioritized in the grid.
- π Emergency Request Dispatcher: Single-click "Request Help" workflow with live state changes.
- π Persistent Theme Engine: Seamless dark and light mode toggle backed by
localStoragepersistence. - π± Fully Responsive Layout: Built with modern CSS Grid and Flexbox for mobile, tablet, and desktop viewports.
Hema maps REST API donor records into structured reactive state components with client-side sorting and filtering:
flowchart TD
subgraph REST ["External Data Layer"]
API["JSONPlaceholder REST API (/users)"]
end
subgraph AppState ["React 19 Application State (src/App.jsx)"]
Fetch["Async HTTP Fetch & Model Mapper"]
State["Donors Array State & Status Handlers"]
FilterLogic["Blood Group & City Filter Pipeline"]
ThemeEngine["Theme Switcher (localStorage Sync)"]
end
subgraph UI ["User Interface Components"]
Header["Header & Theme Toggle"]
FilterBar["FilterBar.jsx (Select & Input)"]
Counter["Live Availability Counter"]
Grid["DonorCard.jsx Grid Render"]
end
API -->|Fetch User Profiles| Fetch
Fetch -->|Map to Donor Model| State
ThemeEngine <-->|Sync 'dark'/'light'| Header
State --> FilterLogic
FilterBar -->|Pass Selection & Query| FilterLogic
FilterLogic --> Counter
FilterLogic --> Grid
Grid -->|Trigger 'Request Help'| State
| Domain | Technology | Description |
|---|---|---|
| Frontend Core | React 19.2 | UI rendering with standard React hooks (useState, useEffect) |
| Build Tooling | Vite 7.3 | Lightning-fast HMR dev server and optimized production bundler |
| Styling System | Vanilla CSS | Custom CSS variables for theme modes, Flexbox/Grid layouts |
| Data Provider | REST API | Fetches sample user location datasets via JSONPlaceholder |
| Quality Control | ESLint 9.39 | Flat config code linting and React Hooks enforcement |
Hema/
βββ .github/
β βββ ISSUE_TEMPLATE/
β β βββ bug_report.md # Standardized bug reporting form
β β βββ feature_request.md # Feature suggestion template
β βββ workflows/
β β βββ ci.yml # GitHub Actions automated build & lint pipeline
β βββ CODEOWNERS # Maintainer code ownership definitions
β βββ PULL_REQUEST_TEMPLATE.md # Contributor PR submission checklist
β βββ dependabot.yml # Automated dependency update configuration
βββ docs/
β βββ GETTING_STARTED.md # Comprehensive setup and run instructions
β βββ ARCHITECTURE.md # System design & component interaction
β βββ DEVELOPMENT.md # Scripts, build commands, and standards
β βββ CONTRIBUTING.md # Contributor guidelines and workflow
β βββ SECURITY.md # Security policy & vulnerability reporting
β βββ FAQ.md # Frequently asked project questions
βββ public/ # Static assets
βββ src/
β βββ components/
β β βββ DonorCard.jsx # Individual donor profile card component
β β βββ FilterBar.jsx # Search input & blood group dropdown component
β βββ App.css # Component layout styles & media queries
β βββ App.jsx # Main application container & state engine
β βββ index.css # Global CSS reset & theme variables
β βββ main.jsx # Application entry point
βββ .env.example # Environment variable configuration template
βββ .gitignore # Git tracking rules
βββ eslint.config.js # ESLint Flat Config rules
βββ index.html # Single Page Application HTML shell
βββ LICENSE # MIT License
βββ package.json # Dependencies and scripts manifest
βββ README.md # Project landing documentation
βββ vite.config.js # Vite bundler configuration
- Node.js:
v18.0.0or higher - npm:
v9.0.0or higher
-
Clone the repository:
git clone https://github.com/TheVicky1/Hema.git cd Hema -
Install dependencies:
npm install
-
Start the development server:
npm run dev
Open
http://localhost:5173in your browser. -
Build for production:
npm run build
-
Run static analysis:
npm run lint
Copy .env.example to create your local .env file:
cp .env.example .env| Variable | Default Value | Description |
|---|---|---|
VITE_API_BASE_URL |
https://jsonplaceholder.typicode.com |
Base REST API endpoint for donor records |
Deeper documentation for developers and maintainers is available in the docs/ directory:
- ποΈ Getting Started Guide β Step-by-step installation & setup.
- π Architecture Overview β Data model, state flow, and component breakdown.
- π» Development Guide β Available scripts, build pipeline, and styling.
- π€ Contributing Guidelines β How to submit issues, features, and pull requests.
- π Security Policy β Vulnerability reporting and credential guidelines.
- β FAQ β Answers to common implementation questions.
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please review our Contributing Guidelines for further details.
For security vulnerability reporting, please refer to our Security Policy.
Distributed under the MIT License. See LICENSE for more information.
- React Documentation
- Vite Documentation
- JSONPlaceholder for mock REST API support.