Skip to content

darrillaga/hospitalized-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hospital Care Coordinator

A mobile-first web application for families to coordinate care for hospitalized loved ones.

CI Status Test Coverage License

Overview

Hospital Care Coordinator helps families collaborate when caring for a hospitalized family member. It provides a simple, mobile-friendly interface to log notes, track medical rounds, manage medications, record vital signs, and coordinate with doctors—all in Spanish.

Built with care to be accessible for non-technical users, with voice input support.

Features

🆓 Free Tier

Core caregiving essentials for families:

  • Timeline Dashboard - Chronological view of all events
  • Notes - Text and voice input (Web Speech API)
  • Medical Rounds - Log past rounds and schedule future ones
  • Medications Tracker - Track medications and administration
  • Vital Signs Logging - Record blood pressure, temperature, oxygen, heart rate, pain level
  • Visitor Log - Track who visited and when
  • Patient Info - Room, floor, days hospitalized, emergency contacts
  • Questions for Doctors - Manual list of questions to ask
  • Single Patient - One patient per family
  • Up to 10 Members - Family collaboration
  • 90 Days Retention - Data stored for 3 months

💎 Premium Tier

Advanced AI and automation:

  • AI Auto-Extract Questions - AI identifies concerns from notes and suggests questions
  • AI Chat Assistant - Ask questions about patient data (grounded RAG, zero-hallucination)
  • AI Daily Recap - Auto-generated daily summary
  • Multi-Patient - Support multiple patients (for medical professionals)
  • Unlimited Members - No limit on family collaborators
  • Advanced Analytics - Charts and insights
  • PDF Export & Reports - Generate shareable reports
  • Unlimited Retention - Keep all data forever
  • Priority Support - Get help faster

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS + shadcn/ui
  • Database: PostgreSQL + Prisma ORM
  • Auth: NextAuth.js (Google OIDC)
  • i18n: next-intl (Spanish default)
  • AI: OpenAI GPT-4 + pgvector (RAG)
  • Voice: Web Speech API
  • Testing: Vitest + @vercel/agent-browser
  • CI/CD: GitHub Actions
  • Deployment: Vercel

Getting Started

Prerequisites

  • Node.js 20+ and npm
  • PostgreSQL database (or use Vercel Postgres)
  • Google OAuth credentials
  • (Optional) OpenAI API key for premium features

Installation

  1. Clone the repository

    git clone https://github.com/darrillaga/hospitalized-log.git
    cd hospitalized-log
  2. Install dependencies

    npm install
  3. Set up environment variables

    Copy .env.example to .env.local and fill in the values:

    cp .env.example .env.local

    Required variables:

    # Database
    DATABASE_URL="postgresql://user:password@localhost:5432/hospital_care"
    
    # NextAuth
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-secret-here"
    
    # Google OAuth
    GOOGLE_CLIENT_ID="your-client-id"
    GOOGLE_CLIENT_SECRET="your-client-secret"
    
    # Premium Features (optional)
    OPENAI_API_KEY="sk-..."
    
  4. Set up the database

    npx prisma migrate dev
    npx prisma db seed
  5. Run the development server

    npm run dev
  6. Open the app Navigate to http://localhost:3000

Adding Family Members

To whitelist family members:

  1. Add their Gmail addresses to the WhitelistEntry table
  2. Use Prisma Studio: npx prisma studio
  3. Or update the seed script in prisma/seed.ts

Development

Project Structure

/app                    # Next.js pages and API routes
  /[locale]            # i18n routing
    /(app)             # Protected app pages
    /login             # Auth pages
  /api                 # API endpoints
/components            # React components
/lib                   # Utilities and services
/prisma                # Database schema and migrations
/messages              # i18n translations (Spanish)
/tests                 # Test files
/docs                  # Documentation
/.claude/commands      # Claude Code skills

Available Scripts

npm run dev            # Start development server
npm run build          # Build for production
npm run start          # Start production server
npm run lint           # Run ESLint
npm run lint:fix       # Fix linting issues
npm run type-check     # Check TypeScript types
npm run format         # Format code with Prettier
npm run format:check   # Check code formatting
npm run test           # Run tests
npm run test:watch     # Run tests in watch mode
npm run test:coverage  # Generate coverage report
npm run test:e2e       # Run E2E tests

Claude Code Skills

Use Claude Code to assist development:

  • /preview - Start dev server and open browser
  • /validate - Run all checks before push (lint, tests, build)
  • /quality - Comprehensive code quality audit

Git Workflow

  1. Create a feature branch

    git checkout -b feat/your-feature
  2. Make atomic commits

    git add .
    git commit -m "feat: add voice input for notes"
  3. Validate before push

    npm run lint && npm run type-check && npm run test

    Or use Claude: /validate

  4. Push to GitHub

    git push origin feat/your-feature
  5. Create a Pull Request

    • CI will run automatically
    • Vercel will create a preview deployment
    • Request review from team

Commit Message Format

Use Conventional Commits:

  • feat: add new feature
  • fix: fix a bug
  • docs: update documentation
  • test: add tests
  • chore: update dependencies
  • refactor: refactor code

Testing

Unit Tests

npm run test

E2E Tests

npm run test:e2e

Coverage

npm run test:coverage
open coverage/index.html

Target: 80%+ coverage

Deployment

Deploy to Vercel

  1. Connect to Vercel

    npm i -g vercel
    vercel login
    vercel
  2. Add environment variables in Vercel dashboard

  3. Deploy

    git push origin main

    Vercel auto-deploys from the main branch.

Database Setup

Use Vercel Postgres or another PostgreSQL provider:

  1. Create database
  2. Add DATABASE_URL to Vercel environment variables
  3. Run migrations:
    vercel env pull .env.local
    npx prisma migrate deploy

Documentation

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run validation: /validate
  6. Submit a pull request

Code Quality Standards

  • TypeScript strict mode
  • 80%+ test coverage
  • ESLint + Prettier
  • Conventional commits
  • Comprehensive documentation

Security

If you discover a security vulnerability, please email security@example.com. Do not create a public issue.

License

This project is licensed under the Elastic License 2.0 - see the LICENSE file for details.

Summary:

  • ✅ Free to use, modify, and self-host
  • ✅ Open source code
  • ❌ Cannot offer as a competing SaaS product

Support

Roadmap

See docs/plan.md for the full implementation roadmap.

Current Status: Phases 1-15 Complete

  • Phase 1: Project initialization
  • Phase 2: Database & authentication
  • Phase 3: UI foundation
  • Phase 4: Timeline & Notes
  • Phase 5: Medical Rounds
  • Phase 6: Health Tracking (medications, vitals, visitors)
  • Phase 7: Questions for Doctors
  • Phase 8: Patient Info & Dashboard
  • Phase 9: AI Features (chat, recap, auto-extract)
  • Phase 12: Feature Flags & Tier Management
  • Phase 13: Testing & Coverage
  • Phase 14: CI/CD & Deployment
  • Phase 15: Documentation & Polish

Remaining

  • Phase 16: MCP Server for AI Patient Actions

Acknowledgments

Built with care for families navigating hospital stays together.

Special thanks to:

  • Next.js and Vercel teams
  • shadcn for the beautiful UI components
  • OpenAI for AI capabilities

Made with ❤️ for families

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages