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.
- Features
- Technology Stack
- Architecture
- Getting Started
- Development
- Deployment
- API Documentation
- Testing
- Contributing
- License
- 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
- 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
- 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
- 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
- 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
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions
- Code Quality: ESLint, Prettier
- Version Control: Git
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
- Node.js v18 or v20 (recommended)
- npm v9+
- MongoDB v7+ (local or hosted)
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/UNC-GDSC/Health-Records-Tracker-App.git cd Health-Records-Tracker-App -
Start all services:
docker-compose up -d
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Create environment file:
cp .env.example .env
-
Configure environment variables: Edit
.envfile: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
-
Start MongoDB:
# Using Docker docker run -d -p 27017:27017 --name mongodb mongo:7 # Or use local MongoDB installation mongod
-
Start development server:
npm run dev
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create environment file:
cp .env.example .env
-
Configure environment variables: Edit
.envfile:REACT_APP_BACKEND_URL=http://localhost:5000 REACT_APP_NAME=HealthRecordsTracker
-
Start development server:
npm start
-
Access the application: Open http://localhost:3000 in your browser
cd backend
npm test # Run tests once
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage reportcd frontend
npm test # Run tests in interactive mode
npm run test:coverage # Generate coverage report# 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# From root directory
npm run format # Format all code with PrettierThe backend includes comprehensive API documentation using Swagger/OpenAPI.
Access API Documentation:
- Start the backend server
- Navigate to http://localhost:5000/api-docs
- Interactive documentation with request/response examples
API Endpoints:
Patients:
GET /api/patients- List all patientsGET /api/patients/:id- Get patient by IDPOST /api/patients- Create new patientPUT /api/patients/:id- Update patientDELETE /api/patients/:id- Delete patient
Records:
GET /api/records- List all records (supports ?patientId filter)GET /api/records/:id- Get record by IDPOST /api/records- Create new recordPUT /api/records/:id- Update recordDELETE /api/records/:id- Delete record
Health:
GET /api/health- Health check endpoint
-
Build and start containers:
docker-compose up -d
-
View logs:
docker-compose logs -f
-
Stop containers:
docker-compose down
cd backend
NODE_ENV=production npm startcd frontend
npm run build
# Serve the build/ directory with your web serverRefer to .env.example files in both backend and frontend directories for all available configuration options.
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)
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.jsextension
- Backend: >80% code coverage
- Frontend: >70% code coverage
We welcome contributions! Please see our Contributing Guidelines for details on:
- Code of Conduct
- Development process
- Pull request workflow
- Coding standards
- Testing requirements
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
UNC-Chapel Hill Google Developer Student Club (GDSC) Team
- Material-UI for the excellent component library
- The Node.js and React communities
- All contributors who help improve this project
- 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