Skip to content

Deploying Mere Medical

Introduction

Mere Medical is a self-hosted personal health record (PHR) application that allows you to aggregate and manage your medical records from multiple healthcare providers in one secure, private location. By connecting to healthcare systems through standard APIs (FHIR), Mere Medical gives you complete ownership and control over your health data.

Built with modern web technologies, Mere Medical provides a clean interface for viewing your medical history, lab results, medications, immunizations, and more. The application is designed with privacy as a core principle, keeping all your sensitive health data on your own infrastructure.

Key highlights of Mere Medical:

  • Data Aggregation: Connect to multiple healthcare providers and aggregate records
  • FHIR Compatible: Uses standard healthcare data exchange protocols
  • Comprehensive Records: View lab results, medications, conditions, immunizations, and more
  • Timeline View: See your medical history in chronological order
  • Document Storage: Upload and store medical documents
  • Privacy-First: All data stays on your server, not in the cloud
  • Secure by Design: Encrypted storage and secure authentication
  • Export Options: Export your data in standard formats
  • Self-Hosted: Complete control over your health information
  • Open Source: Transparent, community-driven development

This guide walks through deploying Mere Medical on Klutch.sh using Docker, configuring secure storage for your health records, and connecting to healthcare providers.

Why Deploy Mere Medical on Klutch.sh

Deploying Mere Medical on Klutch.sh provides several advantages for personal health record management:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Mere Medical without complex orchestration. Push to GitHub, and your health portal deploys automatically.

Persistent Storage: Attach persistent volumes for your health records database. Your medical history survives container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your sensitive health data.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on your data storage and processing needs.

Custom Domains: Assign a custom domain for secure, private access to your health records.

Always-On Availability: Your health records remain accessible 24/7 when you need them.

Prerequisites

Before deploying Mere Medical on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • Access to healthcare provider patient portals that support FHIR
  • (Optional) A custom domain for your health records portal

Important Security Considerations

Health data is extremely sensitive. Before deploying:

  • Use strong, unique passwords
  • Enable two-factor authentication when available
  • Regularly backup your data
  • Keep your deployment updated
  • Consider additional network security measures
  • Understand the privacy implications of self-hosting health data

Preparing Your Repository

To deploy Mere Medical on Klutch.sh, create a GitHub repository containing your Dockerfile and configuration.

Repository Structure

mere-medical-deploy/
├── Dockerfile
├── README.md
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM node:18-alpine
# Install dependencies
RUN apk add --no-cache python3 make g++
# Set working directory
WORKDIR /app
# Clone Mere Medical
RUN apk add --no-cache git \
&& git clone https://github.com/cfu288/mere-medical.git . \
&& rm -rf .git
# Install dependencies
RUN npm install
# Build the application
RUN npm run build
# Create data directory
RUN mkdir -p /data
# Set environment variables
ENV NODE_ENV=production
ENV DATABASE_PATH=/data/mere-medical.db
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Start the application
CMD ["npm", "start"]

Environment Variables Reference

VariableRequiredDefaultDescription
DATABASE_PATHNo./mere-medical.dbPath to SQLite database
SECRET_KEYYes-Encryption key for sensitive data
NODE_ENVNoproductionEnvironment mode

Deploying on Klutch.sh

    Generate a Secret Key

    Generate a secure encryption key for your health data:

    Terminal window
    openssl rand -hex 32

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial Mere Medical deployment configuration"
    git remote add origin https://github.com/yourusername/mere-medical-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “mere-medical” or “health-records”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Mere Medical Dockerfile.

    Configure HTTP Traffic

    Mere Medical serves its web interface over HTTP. In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 3000

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    SECRET_KEYYour generated secret key
    DATABASE_PATH/data/mere-medical.db
    NODE_ENVproduction

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /data10 GBHealth records database and documents

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Mere Medical container
    • Provision an HTTPS certificate

    Access Mere Medical

    Once deployment completes, access your Mere Medical instance at https://example-app.klutch.sh.

Initial Setup

Creating Your Account

  1. Navigate to your Mere Medical instance
  2. Create your personal account
  3. Set a strong password
  4. Enable any available security features

Connecting Healthcare Providers

Add your healthcare providers:

  1. Go to Settings > Connections
  2. Search for your healthcare provider
  3. Authorize Mere Medical to access your records
  4. Records will sync automatically

Supported Providers

Mere Medical supports healthcare systems that implement FHIR APIs, including:

  • Epic MyChart
  • Cerner
  • Many hospital systems
  • Some insurance providers

Managing Your Records

Viewing Medical History

Browse your health data:

  • Timeline: Chronological view of all records
  • Lab Results: Blood work and diagnostic tests
  • Medications: Current and past prescriptions
  • Conditions: Diagnosed health conditions
  • Immunizations: Vaccination records
  • Allergies: Known allergies and reactions

Document Management

Upload additional documents:

  1. Go to Documents
  2. Upload PDFs, images, or other files
  3. Add descriptions and tags
  4. Organize by category

Data Export

Export your health records:

  • Export to PDF for sharing with providers
  • Download in FHIR format for portability
  • Create backups of all data

Health Data Categories

Clinical Data

  • Encounters and visits
  • Vital signs
  • Clinical notes
  • Procedure records

Diagnostic Data

  • Laboratory results
  • Imaging reports
  • Pathology reports

Treatment Data

  • Medication lists
  • Care plans
  • Referrals

Privacy and Security

Data Protection

Your health data is protected by:

  • Encryption at rest
  • Secure HTTPS transmission
  • Authentication requirements
  • No third-party data sharing

Access Control

Manage who can access your records:

  • Single-user by default
  • Optional family sharing
  • Audit logs of access

Backup Recommendations

Protect your data:

  1. Regular database backups
  2. Store backups securely
  3. Test restoration procedures
  4. Consider encrypted offsite backups

Troubleshooting

Provider Connection Failed

  • Verify your patient portal credentials
  • Check if the provider supports FHIR access
  • Try reconnecting the account
  • Contact the provider’s support if needed

Missing Records

  • Sync may take time for large record sets
  • Some historical data may not be available via API
  • Check provider portal for record availability

Application Errors

  • Review container logs
  • Verify database permissions
  • Check available storage space
  • Ensure environment variables are set correctly

Additional Resources

Conclusion

Deploying Mere Medical on Klutch.sh gives you complete ownership of your personal health records. By aggregating data from multiple healthcare providers into one secure, self-hosted application, you can maintain a comprehensive view of your medical history without relying on third-party cloud services.

The combination of Mere Medical’s FHIR integration and Klutch.sh’s reliable infrastructure provides a robust foundation for personal health data management. With proper security practices and regular backups, you can confidently maintain your health records in a way that prioritizes your privacy and control.