Skip to content

dinraj910/Health-Tracker-App

Repository files navigation

πŸ₯ MediTrack

Your Personal Health & Medication Management Platform

License Node.js React MongoDB Tailwind CSS

A modern, full-stack health management platform to track medicines, store medical records, and monitor your wellness journey.

Features β€’ Tech Stack β€’ Quick Start β€’ Project Structure β€’ Contributing


✨ Features

πŸ’Š Medicine Management

  • Smart medication reminders
  • Dosage tracking & scheduling
  • Medicine inventory management
  • Refill alerts

πŸ“ Medical Records

  • Secure document storage
  • Prescription uploads
  • Lab report management
  • Cloud-synced records

πŸ“Š Health Analytics

  • Visual health insights
  • Medication adherence tracking
  • Historical data analysis
  • Customizable reports

πŸ”’ Security & Privacy

  • End-to-end encryption
  • JWT authentication
  • HIPAA-conscious design
  • Data never shared

πŸ›  Tech Stack

Frontend

React Vite TailwindCSS React Router Framer

Backend

Node.js Express MongoDB JWT Cloudinary


πŸš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/dinraj910/Health-Tracker-App.git
cd Health-Tracker-App

# Install frontend dependencies
cd frontend && npm install

# Install backend dependencies
cd ../backend && npm install

# Setup environment variables
cp ../.env.example .env
# Edit .env with your configuration

Running the Application

# Terminal 1 - Start Backend
cd backend
npm run dev

# Terminal 2 - Start Frontend
cd frontend
npm run dev
Service URL
Frontend http://localhost:5173
Backend http://localhost:5000

πŸ“ Project Structure

Frontend Architecture
frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”œβ”€β”€ MedicineCard.jsx
β”‚   β”‚   β”œβ”€β”€ RecordCard.jsx
β”‚   β”‚   └── Chart.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/               # Route pages
β”‚   β”‚   β”œβ”€β”€ Auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   └── Register.jsx
β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”œβ”€β”€ Medicines.jsx
β”‚   β”‚   β”œβ”€β”€ AddMedicine.jsx
β”‚   β”‚   β”œβ”€β”€ Records.jsx
β”‚   β”‚   β”œβ”€β”€ UploadRecord.jsx
β”‚   β”‚   β”œβ”€β”€ History.jsx
β”‚   β”‚   └── Profile.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ layouts/             # Layout wrappers
β”‚   β”‚   └── AuthLayout.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/              # Route configuration
β”‚   β”‚   └── AppRoutes.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ context/             # React Context providers
β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   └── UIContext.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ services/            # API service layers
β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”œβ”€β”€ medicineService.js
β”‚   β”‚   β”œβ”€β”€ recordService.js
β”‚   β”‚   β”œβ”€β”€ logService.js
β”‚   β”‚   └── analyticsService.js
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useAuth.js
β”‚   β”‚   └── useFetch.js
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/               # Helper functions
β”‚   β”‚   └── helpers.js
β”‚   β”‚
β”‚   β”œβ”€β”€ styles/              # Global styles
β”‚   β”‚   └── global.css
β”‚   β”‚
β”‚   β”œβ”€β”€ main.jsx             # Entry point
β”‚   └── App.jsx              # Root component
β”‚
β”œβ”€β”€ index.html
└── package.json
Backend Architecture
backend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”‚   β”œβ”€β”€ db.js            # Database connection
β”‚   β”‚   └── cloudinary.js    # Cloud storage config
β”‚   β”‚
β”‚   β”œβ”€β”€ middleware/          # Express middleware
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js
β”‚   β”‚   β”œβ”€β”€ errorMiddleware.js
β”‚   β”‚   └── uploadMiddleware.js
β”‚   β”‚
β”‚   β”œβ”€β”€ controllers/         # Route handlers
β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”œβ”€β”€ userController.js
β”‚   β”‚   β”œβ”€β”€ medicineController.js
β”‚   β”‚   β”œβ”€β”€ recordController.js
β”‚   β”‚   β”œβ”€β”€ logController.js
β”‚   β”‚   └── analyticsController.js
β”‚   β”‚
β”‚   β”œβ”€β”€ models/              # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”œβ”€β”€ Medicine.js
β”‚   β”‚   β”œβ”€β”€ MedicineLog.js
β”‚   β”‚   └── MedicalRecord.js
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/              # API routes
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”œβ”€β”€ userRoutes.js
β”‚   β”‚   β”œβ”€β”€ medicineRoutes.js
β”‚   β”‚   β”œβ”€β”€ recordRoutes.js
β”‚   β”‚   β”œβ”€β”€ logRoutes.js
β”‚   β”‚   └── analyticsRoutes.js
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ token.js
β”‚   β”‚   β”œβ”€β”€ validators.js
β”‚   β”‚   └── sendEmail.js
β”‚   β”‚
β”‚   β”œβ”€β”€ cron/                # Scheduled tasks
β”‚   β”‚   └── reminderCron.js
β”‚   β”‚
β”‚   β”œβ”€β”€ app.js               # Express app setup
β”‚   └── server.js            # Server entry point
β”‚
β”œβ”€β”€ .env
└── package.json

πŸ”Œ API Endpoints

Authentication
Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login User login
POST /api/auth/logout User logout
GET /api/auth/me Get current user
Medicines
Method Endpoint Description
GET /api/medicines Get all medicines
POST /api/medicines Add new medicine
PUT /api/medicines/:id Update medicine
DELETE /api/medicines/:id Delete medicine
Medical Records
Method Endpoint Description
GET /api/records Get all records
POST /api/records Upload record
DELETE /api/records/:id Delete record

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

# Create feature branch
git checkout -b feature/amazing-feature

# Commit changes
git commit -m "feat: add amazing feature"

# Push to branch
git push origin feature/amazing-feature

# Open a Pull Request

πŸ“„ License

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


Built with ❀️ by Dinraj

⭐ Star this repo if you find it helpful! ⭐

Releases

No releases published

Packages

 
 
 

Contributors

Languages