Skip to content

Masters-Project-University-of-Leeds/medledger-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 MedLedger Backend - Server-side Implementation for MedLedger XRPL

🎓 Collaboration: This backend is developed in conjunction with the MedLedger XRPL project under the guidance of professors from the University of Leeds, United Kingdom.


📖 Table of Contents


🎉 Introduction

Welcome to the MedLedger Backend, the server-side component of the MedLedger XRPL project. This backend is designed to handle authentication, QR code generation, and UUID verification for the MedLedger XRPL front-end. It serves as the bridge between the frontend and the XRPL, ensuring secure and efficient operations.


🌟 Key Features

  • Secure Authentication: Utilizing QR codes and UUIDs for a two-factor authentication process.
  • XRPL Integration: Direct interactions with the XRP Ledger for blockchain-specific operations.
  • Scalability: Designed to handle a large number of requests efficiently.
  • Modular Design: Clear separation of concerns with modular routes and controllers.

🛠 Installation

Follow these steps to set up the MedLedger Backend on your local machine:

  1. Clone the Repository:

    git clone https://github.com/Masters-Project-University-of-Leeds/medledger-backend.git
  2. Navigate to the Project Directory:

    cd medledger-backend
  3. Install Dependencies: If you're using npm:

    npm install

    If you're using yarn:

    yarn install
  4. Set Up Environment Variables: Copy the .env.example file and rename it to .env. Fill in the required environment variables.

  5. Start the Server: If you're using npm:

    npm start

    If you're using yarn:

    yarn start

The server should now be running on the specified port (default is 3000). You can access it at http://localhost:3000.


🔧 Endpoints

1. Generate QR (POST /generateQR)

Description:
Handles the generation of QR codes for authentication.

Request Body:

{
  "userAddress": "string"
}

Success Response:

{
  "uuid": "string",
  "qr_png": "string (URL to the generated QR code)"
}

Error Response:

{
  "error": "Description of the error"
}

2. Sign In (POST /signIn)

Description:
Manages user sign-in operations. Validates user credentials and, upon successful validation, returns a JWT token.

Request Body:

{
  "userAddress": "string"
}

Success Response:

{
  "token": "string (JWT token)",
  "type": "string (User type: Admin/User)"
}

Error Response:

{
  "error": "Description of the error"
}

3. Verify UUID (GET /verifyUUID)

Description:
Verifies the UUID provided during the authentication process. Validates the user's unique identifier with the Xumm app.

Request Parameters:

{
  "uuid": "string"
}

Success Response:

{
  "payload_uuidv4": "string",
  "exists": "boolean",
  "is_xapp": "boolean",
  "user_token": "boolean",
  "multisign": "boolean",
  "submit": "boolean",
  "destination": "string",
  "resolved_at": "string",
  "txid": "string",
  "txblob": "string",
  "payload": {
    "application_uuidv4": "string",
    "response": {
      "account": "string",
      "txjson": {
        "TransactionType": "string",
        "Account": "string",
        ...
      }
    },
    "custom_meta": {
      "identifier": "string",
      "blob": "string",
      "instruction": "string"
    }
  }
}

Error Response:

{
  "error": "Description of the error"
}

📔 License

This project is licensed under the MIT License. The license provides all the details regarding permissions, conditions, and disclaimers.

For collaborations, contributions, queries, or suggestions, feel free to reach out via email.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published