Skip to content
TheVicky1Public

About

🩸 Real-time open-source community blood donor finder application built with React 19 & Vite 7. Connects emergency blood seekers with available local donors through zero-latency blood group filtering, city search, live availability status, and theme switching.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

34 Commits

Folders and files

Repository files navigation

Hema β€” Community Blood Donor Finder 🩸

Real-time open-source community platform connecting emergency blood seekers with available local blood donors.

React Version Vite Version ESLint Status License: MIT PRs Welcome


πŸ“Œ What is Hema?

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.


✨ Key Features

  • 🩸 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 localStorage persistence.
  • πŸ“± Fully Responsive Layout: Built with modern CSS Grid and Flexbox for mobile, tablet, and desktop viewports.

πŸ—οΈ Architecture & Data Flow

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
Loading

πŸ› οΈ Tech Stack

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

πŸ“‚ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • Node.js: v18.0.0 or higher
  • npm: v9.0.0 or higher

Quickstart

  1. Clone the repository:

    git clone https://github.com/TheVicky1/Hema.git
    cd Hema
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

    Open http://localhost:5173 in your browser.

  4. Build for production:

    npm run build
  5. Run static analysis:

    npm run lint

βš™οΈ Environment Configuration

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

πŸ“– Documentation Architecture

Deeper documentation for developers and maintainers is available in the docs/ directory:


🀝 Contributing

Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat: Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please review our Contributing Guidelines for further details.


πŸ”’ Security

For security vulnerability reporting, please refer to our Security Policy.


πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.


πŸ’– Acknowledgements

About

🩸 Real-time open-source community blood donor finder application built with React 19 & Vite 7. Connects emergency blood seekers with available local donors through zero-latency blood group filtering, city search, live availability status, and theme switching.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages