Skip to content

IkramBagban/medical-record-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical Records Backend - Setup Instructions

Prerequisites

Make sure the following tools are installed on your system:

  • Docker
  • Docker Compose

API Setup

1. Navigate to the API directory

cd api

2. Create environment file

cp .env.example .env

3. Build the Docker image

docker build -t medical-records-backend-dev . -f docker/Dockerfile.dev

4. Run the Docker container

docker run --env-file .env -d -p 3000:3000 medical-records-backend-dev

5. Run Database Migrations

Run this inside the running container:

docker exec -it <container_id> sh
pnpm run db:migrate

Replace <container_id> with the actual ID of your running container.


Docker Compose

docker-compose up --build

⚠️ OCR feature will not work if you use local database, as it requires a live database connection. To enable OCR, use a hosted DB like NeonDB. Create a database on Neon and update the .env file with the provided database URL.


OCR Worker - Serverless Setup

1. Navigate to the OCR worker

cd ocr-worker
cp .env.example .env

2. Login to Serverless

pnpm serverless login

3. Deploy the OCR service

pnpm run db:generate
pnpm run deploy

4. Configure S3 Bucket Notification (if not set automatically):

Go to: AWS Console > S3 > Your Bucket > Properties > Event Notifications > Create Notification

Fill in the following:

  • Event Name: ocr-event
  • Prefix: ocr-files/
  • Suffix: (leave empty)
  • Destination: Select SQS
  • Choose OcrQueue from the dropdown

Running Tests

1. Navigate to API

cd api

2. Add all required variables in .env

3. Run tests

pnpm run test

test might fail because of timeout

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages