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
|
|
|
|
# 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# 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 |
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
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 |
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 RequestThis 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! β