Skip to content

bpmiranda3099/inet-ready-ehr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INET-READY: Electronic Health Record (EHR)

License: MIT Platform Status ORCID Website Visitors

📝 Overview

This Electronic Health Record (EHR) system is built using Node.js, Express, PostgreSQL, and Firebase Authentication. It is deployed on Aptible to ensure it meets strict legal requirements for handling medical data. The system is designed to work with the INET-READY platform, making travel safer and more informed.


🚀 Features

  • User Authentication: Secure JWT-based authentication via Firebase.
  • Medical Data API: CRUD endpoints for storing, retrieving, and deleting user medical data.
  • PostgreSQL Integration: Robust, scalable data storage.
  • CORS Support: Configured for secure cross-origin requests from trusted frontends.
  • Dockerized: Easy containerized deployment.
  • Cloud Ready: Out-of-the-box support for Aptible and other cloud platforms.

🛠️ Tech Stack

Node.js Express PostgreSQL Firebase Docker Aptible


📦 Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • PostgreSQL database
  • Firebase project with a service account key
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/inet-ready-ehr.git
    cd inet-ready-ehr
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Copy .env and serviceAccountKey.json (do not commit secrets!)
    • Example .env:
      FIREBASE_ADMIN_SDK=serviceAccountKey.json
      DATABASE_URL=postgres://localhost:5432/mydb
      PORT=3000
  4. Prepare PostgreSQL database:

    • Create a medical_data table:
      CREATE TABLE medical_data (
        user_id VARCHAR(128) PRIMARY KEY,
        data JSONB NOT NULL,
        updated_at TIMESTAMP DEFAULT NOW()
      );

Running Locally

node server.js

🧪 API Endpoints

All endpoints require a valid Firebase ID token in the Authorization: Bearer <token> header.

GET /get-medical-data

  • Description: Fetches the authenticated user's medical data.
  • Response:
    [
      {
        "data": {
          /* user medical data */
        }
      }
    ]

POST /store-medical-data

  • Description: Creates or updates the user's medical data.
  • Body:
    {
      "medicalData": {
        /* your data */
      }
    }
  • Response:
    {
      "user_id": "...",
      "data": {
        /* ... */
      },
      "updated_at": "..."
    }

DELETE /delete-medical-data

  • Description: Deletes the authenticated user's medical data.
  • Response:
    {
      "message": "Entry deleted",
      "deleted": {
        /* ... */
      }
    }

🐳 Docker

Build and run the app in a container:

docker build -t inet-ready-ehr .
docker run -p 3000:3000 --env-file .env inet-ready-ehr

🚀 Deployment

This app is ready for deployment on Aptible via GitHub Actions. See .github/workflows/deploy.yml for CI/CD setup.


🤝 Contributing

Contributions are welcome! Please open issues or submit pull requests for improvements and bug fixes.


📄 License

This project is licensed under the MIT License.


📬 Contact


Your Heat Check for Safe and Informed Travel.

About

A secure, cloud-based system built with Node.js, Express, PostgreSQL, and Firebase Authentication, designed for seamless integration with the INET-READY platform to enhance safe and informed travel.​ Sources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors