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

Security & Performance

Developer Experience

Technology Stack

Backend

Frontend

DevOps

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

  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:
    • Frontend: http://localhost:3000
    • Backend API: http://localhost:5000
    • API Documentation: http://localhost:5000/api-docs

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:

Records:

Health:

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:

Testing

Test Structure

Backend:

Frontend:

Coverage Goals

Contributing

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

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

Support


Made with ❤️ by UNC-GDSC