রক্তযোগ একটি প্ল্যাটফর্ম, যা জরুরি রক্তের প্রয়োজন হলে আপনাকে রক্তদাতা ও স্বেচ্ছাসেবকদের সাথে দ্রুত সংযোগ স্থাপনে সহায়তা করে।

RoktoJog API and Architecture

Public API
Architecture

Public API Documentation

Endpoint

GET https://api.roktojog.org/requests

Description

This API retrieves blood requests received within the last 72 hours. Developers can use this data to build applications, analytics tools, or integrate with other systems.

Parameters

The API currently does not accept any query parameters. It always returns the latest 72 hours of data.

Response Format

The API returns a JSON array of objects. Each object represents a blood request with the following fields:

  • id: Unique identifier of the blood request.
  • name: Name of the requester.
  • bloodGroup: Requested blood group (e.g., "A+").
  • phoneNumber: Contact number for the requester.
  • details: Additional details about the request.
  • district: District where the blood is required.
  • hospital: Hospital name where the blood is needed.
  • postid: Identifier for the related social media post.
  • timestamp: Date and time the request was created (ISO format).

Sample Response

{
    "id": 1,
    "name": "John Doe",
    "bloodGroup": "A+",
    "phoneNumber": "0123456789",
    "details": "Urgent blood needed for surgery",
    "district": "Dhaka",
    "hospital": "XYZ Hospital",
    "postid": "548940401240191",
    "timestamp": "2024-12-07T10:11:02Z"
}

Usage Example

To retrieve the data, make a GET request to the API endpoint. Here's an example using curl:

curl -X GET "https://api.roktojog.org/requests" -H "Accept: application/json"

System Architecture

The RoktoJog server is built to facilitate blood donation management with the following architecture:

1. Backend

  • Framework: Express.js for handling HTTP requests and defining routes.
  • Database: PostgreSQL, a robust relational database system.
  • Authentication: JSON Web Tokens (JWT) for secure user sessions.
  • Security: Rate limiting and OTP verification to prevent abuse.

2. Bots

  • Telegram Bot: Notifies users about blood requests and interacts with donors.
  • Discord Bot: Serves a similar purpose for Discord users.

3. Frontend

  • Responsive design for ease of use on mobile and desktop devices.
  • Focus on accessibility and multilingual support.

4. Features

  • Guild management for organizing donors and donation drives.
  • Blood request matching system.
  • Notification system for emergency alerts.

5. Documentation

All system documentation is maintained in the project repository:

  • structure.md: Explains the overall structure.
  • api.md: Detailed API documentation.