Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Elion Healthcare Vendor Intelligence Platform

A platform for healthcare IT leaders to track and analyze vendor relationships, products, and unstructured research data about the health tech landscape.

Tech Stack

  • Frontend: Next.js 16 with App Router, React 19, TypeScript
  • UI Components: shadcn/ui with Tailwind CSS
  • Database: PostgreSQL with MikroORM
  • AI: OpenAI API
  • Code Quality: Biome for linting and formatting

Prerequisites

Getting Started

1. Install Dependencies

npm install

2. Start PostgreSQL with Docker

Start the PostgreSQL database container:

docker compose up -d

This will start a PostgreSQL 18 container with the following configuration:

  • Host: localhost
  • Port: 5432
  • Database: elion_interview
  • User: elion
  • Password: elion_dev_password

Verify the database is running:

docker compose ps

3. Set Up Environment Variables

Create a .env.local file in the root directory:

cp .env.example .env.local

Then add your OpenAI API key to .env.local:

DATABASE_URL=postgresql://elion:elion_dev_password@localhost:5432/elion_interview
OPENAI_API_KEY=<provided_openai_key>

4. Run Database Migrations and Seed Data

Run migrations to create the database schema:

npm run db:migrate:up

Seed the database with sample data:

npm run db:seed

This will populate your database with:

  • 4 sample users (health system executives)
  • 8 healthcare vendors (Epic, Cerner, Health Catalyst, etc.)
  • 24 products across all vendors
  • 5 health systems

5. Start the Development Server

npm run dev

Open http://localhost:3000 to see the application.

Project Structure

.
├── app/                      # Next.js App Router pages
│   ├── api/                  # API routes
│   │   └── health-systems/   # Example API endpoint
│   └── page.tsx              # Home page
├── components/               # React components
│   └── ui/                   # shadcn/ui components
├── db/
│   ├── entities/             # MikroORM entity definitions
│   │   ├── User.ts           # Health system users
│   │   ├── HealthSystem.ts   # Healthcare organizations
│   │   ├── Vendor.ts         # Healthcare vendors (Epic, Cerner, etc.)
│   │   └── Product.ts        # Vendor products (EpicCare, MyChart, etc.)
│   ├── migrations/           # Database migrations
│   ├── config.ts             # MikroORM configuration
│   ├── orm.ts                # ORM helper functions
│   └── seed.ts               # Database seeding script
├── unstructured_data/        # Sample unstructured research data
│   ├── vendor_notes/         # Call notes, transcripts, assessments
│   └── product_notes/        # Product feedback, implementation notes
├── lib/
│   └── openai.ts             # OpenAI client setup
├── docker-compose.yml        # PostgreSQL container config
└── README.md                 # This file

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run Biome linter
  • npm run format - Format code with Biome
  • npm run db:reset - Drop schema, run migrations, and seed database (fresh start)
  • npm run db:migrate:create - Create a new migration
  • npm run db:migrate:up - Run pending migrations
  • npm run db:migrate:down - Rollback last migration
  • npm run db:seed - Seed database with sample data

Data Model

Entities

  • User: Health system executives and IT leaders
  • HealthSystem: Healthcare organizations (hospitals, medical centers)
  • Vendor: Healthcare technology vendors (Epic, Cerner, Health Catalyst, etc.)
  • Product: Specific products offered by vendors (EpicCare, MyChart, etc.)

Relationships

  • Vendor → Product: One-to-Many (vendors offer multiple products)

Unstructured Data

The unstructured_data/ directory contains realistic sample data that simulates real-world vendor research:

Vendor Notes (unstructured_data/vendor_notes/):

  • Call notes from vendor meetings
  • Meeting transcripts with detailed discussions
  • Security assessments and compliance reviews
  • Contract renewal negotiations

Product Notes (unstructured_data/product_notes/):

  • User feedback compilations
  • Implementation progress notes
  • Product upgrade planning documents

Application Structure

The home page displays:

  • Healthcare Vendors: Click any vendor to see their products
  • Health Systems Directory: Click to see details

Working with MikroORM

MikroORM Docs

Creating a New Entity

  1. Create entity file in db/entities/:
import { Entity, PrimaryKey, Property } from '@mikro-orm/core';

@Entity()
export class MyEntity {
  @PrimaryKey({ type: 'number' })
  id!: number;

  @Property({ type: 'string' })
  name!: string;

  @Property({ type: 'Date' })
  createdAt: Date = new Date();
}
  1. Add to db/config.ts entities array

  2. Create and run migration:

npm run db:migrate:create
npm run db:migrate:up

Using the ORM in API Routes

import { withORM } from '@/db/orm';
import { MyEntity } from '@/db/entities/MyEntity';

export async function GET() {
  const results = await withORM(async (em) => {
    return em.find(MyEntity, {});
  });
  return NextResponse.json({ data: results });
}

Troubleshooting

Database connection issues

If you encounter database connection errors:

  1. Verify the PostgreSQL container is running:

    docker compose ps
  2. Check the container logs:

    docker compose logs postgres
  3. Verify your .env.local file has the correct DATABASE_URL:

    DATABASE_URL=postgresql://elion:elion_dev_password@localhost:5432/elion_interview

Port 5432 already in use

If docker compose up fails with bind: address already in use on port 5432, you already have Postgres running on the host. Either stop it (brew services stop postgresql on macOS) or remap the container port — edit docker-compose.yml:

ports:
  - "5433:5432"

…and update DATABASE_URL in .env.local to use 5433.

Container starts but Postgres won't initialize

If docker compose logs postgres shows initdb: error: directory "/var/lib/postgresql/data" exists but is not empty or similar, the data volume has stale or unexpected contents. Reset it:

docker compose down -v
docker compose up -d

Note: -v removes the volume and all local Postgres data — you'll need to re-run migrations and seed.

Reset the database

If you need to start fresh:

npm run db:reset

Stop the database

When you're done working:

docker compose down

To stop and remove all data:

docker compose down -v

TypeScript errors

npm run build

This will show all type errors at once.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages