Skip to content

Health Records Tracker App - suitable for any individual or businesses looking to manage their health logs, meds, doctor visits with ease!

License

Notifications You must be signed in to change notification settings

UNC-GDSC/Health-Records-Tracker-App

Health Records Tracker App

CI/CD Pipeline License: MIT

A professional, enterprise-grade full-stack application for tracking patient health records. Built with modern technologies and best practices, this platform enables healthcare providers to securely manage patient information and medical records.

Table of Contents

Features

Core Functionality

  • Patient Management: Complete CRUD operations for patient records
  • Health Records: Track allergies, vaccinations, diagnoses, medications, lab results, and procedures
  • Search & Filter: Efficiently find patients and records
  • Data Validation: Comprehensive input validation on both frontend and backend
  • Responsive Design: Mobile-friendly interface using Material-UI

Security & Performance

  • Rate Limiting: Protection against abuse and DoS attacks
  • CORS Configuration: Secure cross-origin resource sharing
  • Input Validation: Server-side validation using express-validator
  • Error Handling: Structured error responses and logging
  • Security Headers: Helmet.js for HTTP security headers
  • Request Logging: Winston-based logging system

Developer Experience

  • API Documentation: Interactive Swagger/OpenAPI documentation
  • Code Quality: ESLint and Prettier configuration
  • Testing: Jest and React Testing Library setup
  • CI/CD: GitHub Actions workflow for automated testing and builds
  • Docker Support: Complete containerization with Docker Compose
  • Hot Reload: Development servers with auto-reload

Technology Stack

Backend

  • Runtime: Node.js 20+
  • Framework: Express.js 4.x
  • Database: MongoDB 7.x with Mongoose ODM
  • Validation: express-validator
  • Security: Helmet, CORS, express-rate-limit
  • Logging: Winston
  • API Docs: Swagger UI, swagger-jsdoc
  • Testing: Jest, Supertest

Frontend

  • Framework: React 18+
  • UI Library: Material-UI (MUI) 6.x
  • HTTP Client: Axios
  • Router: React Router DOM 6.x
  • Testing: React Testing Library, Jest
  • Build Tool: Create React App

DevOps

  • Containerization: Docker & Docker Compose
  • CI/CD: GitHub Actions
  • Code Quality: ESLint, Prettier
  • Version Control: Git

Architecture

Project Structure

Health-Records-Tracker-App/
├── .github/
│   └── workflows/
│       └── ci.yml                 # CI/CD pipeline
├── backend/
│   ├── __tests__/                 # Backend tests
│   ├── config/
│   │   ├── db.js                  # Database configuration
│   │   └── swagger.js             # API documentation config
│   ├── controllers/               # Route controllers
│   │   ├── patientController.js
│   │   └── recordController.js
│   ├── middleware/                # Custom middleware
│   │   ├── errorHandler.js
│   │   └── validation.js
│   ├── models/                    # Mongoose models
│   │   ├── Patient.js
│   │   └── Record.js
│   ├── routes/                    # API routes
│   │   ├── patients.js
│   │   └── records.js
│   ├── utils/                     # Utility functions
│   │   └── logger.js
│   ├── validators/                # Input validators
│   │   ├── patientValidator.js
│   │   └── recordValidator.js
│   ├── .env.example               # Environment variables template
│   ├── Dockerfile                 # Backend container
│   ├── jest.config.js             # Jest configuration
│   ├── package.json
│   └── server.js                  # Application entry point
├── frontend/
│   ├── public/
│   │   └── index.html
│   ├── src/
│   │   ├── components/            # React components
│   │   │   ├── Header.js
│   │   │   ├── Footer.js
│   │   │   ├── PatientForm.js
│   │   │   ├── PatientList.js
│   │   │   ├── RecordForm.js
│   │   │   └── RecordList.js
│   │   ├── App.js                 # Main application component
│   │   ├── config.js              # Frontend configuration
│   │   └── index.js               # React entry point
│   ├── .env.example               # Environment variables template
│   ├── Dockerfile                 # Frontend container
│   ├── nginx.conf                 # Nginx configuration
│   └── package.json
├── .dockerignore
├── .eslintrc.json                 # ESLint configuration
├── .gitignore
├── .prettierrc.json               # Prettier configuration
├── .prettierignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── docker-compose.yml             # Multi-container orchestration
├── LICENSE
└── README.md

Getting Started

Prerequisites

  • Node.js v18 or v20 (recommended)
  • npm v9+
  • MongoDB v7+ (local or hosted)
  • Docker (optional, for containerized deployment)

Quick Start with Docker (Recommended)

  1. Clone the repository:

    git clone https://github.com/UNC-GDSC/Health-Records-Tracker-App.git
    cd Health-Records-Tracker-App
  2. Start all services:

    docker-compose up -d
  3. Access the application:

Local Development Setup

Backend Setup

  1. Navigate to backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create environment file:

    cp .env.example .env
  4. Configure environment variables: Edit .env file:

    PORT=5000
    NODE_ENV=development
    MONGO_URI=mongodb://localhost:27017/health_records_db
    APP_NAME=HealthRecordsTracker
    ALLOWED_ORIGINS=http://localhost:3000
    RATE_LIMIT_WINDOW_MS=900000
    RATE_LIMIT_MAX_REQUESTS=100
    LOG_LEVEL=info
  5. Start MongoDB:

    # Using Docker
    docker run -d -p 27017:27017 --name mongodb mongo:7
    
    # Or use local MongoDB installation
    mongod
  6. Start development server:

    npm run dev

Frontend Setup

  1. Navigate to frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Create environment file:

    cp .env.example .env
  4. Configure environment variables: Edit .env file:

    REACT_APP_BACKEND_URL=http://localhost:5000
    REACT_APP_NAME=HealthRecordsTracker
  5. Start development server:

    npm start
  6. Access the application: Open http://localhost:3000 in your browser

Development

Running Tests

Backend Tests

cd backend
npm test                  # Run tests once
npm run test:watch        # Run tests in watch mode
npm run test:coverage     # Generate coverage report

Frontend Tests

cd frontend
npm test                  # Run tests in interactive mode
npm run test:coverage     # Generate coverage report

Code Quality

Linting

# Backend
cd backend
npm run lint              # Check for issues
npm run lint:fix          # Fix auto-fixable issues

# Frontend
cd frontend
npm run lint
npm run lint:fix

Formatting

# From root directory
npm run format            # Format all code with Prettier

API Development

The backend includes comprehensive API documentation using Swagger/OpenAPI.

Access API Documentation:

API Endpoints:

Patients:

  • GET /api/patients - List all patients
  • GET /api/patients/:id - Get patient by ID
  • POST /api/patients - Create new patient
  • PUT /api/patients/:id - Update patient
  • DELETE /api/patients/:id - Delete patient

Records:

  • GET /api/records - List all records (supports ?patientId filter)
  • GET /api/records/:id - Get record by ID
  • POST /api/records - Create new record
  • PUT /api/records/:id - Update record
  • DELETE /api/records/:id - Delete record

Health:

  • GET /api/health - Health check endpoint

Deployment

Docker Deployment (Production)

  1. Build and start containers:

    docker-compose up -d
  2. View logs:

    docker-compose logs -f
  3. Stop containers:

    docker-compose down

Manual Deployment

Backend Production Build

cd backend
NODE_ENV=production npm start

Frontend Production Build

cd frontend
npm run build
# Serve the build/ directory with your web server

Environment Variables

Refer to .env.example files in both backend and frontend directories for all available configuration options.

API Documentation

Interactive API documentation is available at /api-docs when running the backend server.

Features:

  • Complete endpoint documentation
  • Request/response schemas
  • Try-it-out functionality
  • Data model definitions
  • Authentication details (when implemented)

Testing

Test Structure

Backend:

  • Unit tests for controllers, models, and utilities
  • Integration tests for API endpoints
  • Located in backend/__tests__/

Frontend:

  • Component unit tests
  • Integration tests for user flows
  • Located alongside components with .test.js extension

Coverage Goals

  • Backend: >80% code coverage
  • Frontend: >70% code coverage

Contributing

We welcome contributions! Please see our Contributing Guidelines for details on:

  • Code of Conduct
  • Development process
  • Pull request workflow
  • Coding standards
  • Testing requirements

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Authors

UNC-Chapel Hill Google Developer Student Club (GDSC) Team

Acknowledgments

  • Material-UI for the excellent component library
  • The Node.js and React communities
  • All contributors who help improve this project

Support

  • Documentation: Check this README and inline code comments
  • Issues: Report bugs or request features via GitHub Issues
  • Discussions: Join conversations in GitHub Discussions

Made with ❤️ by UNC-GDSC

About

Health Records Tracker App - suitable for any individual or businesses looking to manage their health logs, meds, doctor visits with ease!

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •