Skip to content

advitiya6594/PillSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Š PillSync

Your personalized birth control companion - A full-stack web application for tracking birth control pill cycles, monitoring side effects, and checking medication interactions.

Version License

🌟 Features

  • πŸ“… Cycle Tracking: Track your pill pack cycle with visual indicators for active/placebo days
  • ⚑ Side Effects Monitoring: View common side effects based on your pill type and cycle day
  • ⚠️ Drug Interaction Checker: Check for interactions between your medications and birth control pills
  • 🎨 Beautiful UI: Modern, animated interface built with Figma design system
  • πŸ”„ Dual Mode: Demo mode with mock data or Real API mode with RxNav/OpenFDA integration

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • npm or yarn

Installation

  1. Clone the repository
git clone https://github.com/advitiya6594/PillSync.git
cd PillSync
  1. Install dependencies
# Install root dependencies
npm install

# Install server dependencies
cd server
npm install
cd ..

# Install frontend dependencies
cd frontend
npm install
cd ..
  1. Configure environment
# Server configuration
cd server
cp .env.example .env
# Edit .env and set USE_DEMO_DATA=true for demo mode

# Frontend configuration (already set up)
cd ../frontend
# .env contains VITE_API_URL=http://localhost:5050
  1. Run the application
# From project root - runs both backend and frontend
npm run dev

The app will be available at:

πŸ“ Project Structure

PillSync/
β”œβ”€β”€ frontend/                 # React + Vite frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx          # Main app entry
β”‚   β”‚   β”œβ”€β”€ bridge/          # API integration components
β”‚   β”‚   β”‚   β”œβ”€β”€ CycleBridge.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EffectsBridge.jsx
β”‚   β”‚   β”‚   └── InteractionsBridge.jsx
β”‚   β”‚   └── figma/           # UI components from Figma design
β”‚   β”‚       β”œβ”€β”€ FigmaLanding.jsx
β”‚   β”‚       └── ui/          # 45+ shadcn/ui components
β”‚   β”œβ”€β”€ tailwind.config.js   # Tailwind CSS v4
β”‚   └── vite.config.js       # Vite configuration with API proxy
β”‚
β”œβ”€β”€ server/                   # Express.js backend
β”‚   β”œβ”€β”€ index.js             # Main server file
β”‚   β”œβ”€β”€ miniData.js          # Demo/fallback data
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ rxnav.js         # RxNav/RxNorm API integration
β”‚   β”‚   β”œβ”€β”€ contraceptives.js # Pill ingredient definitions
β”‚   β”‚   └── openfda.js       # OpenFDA label lookup
β”‚   └── tests.http           # REST client tests
β”‚
└── package.json             # Root scripts for parallel dev

πŸ”Œ API Endpoints

Backend API (port 5050)

  • GET /api/health - Server health check and mode info
  • GET /api/cycle - Cycle tracking information
    • Query params: packType, startDate
  • POST /api/check-interactions - Check drug interactions
    • Body: { meds: string[], pillType: string }
  • GET /api/side-effects - Get side effects by pill type
    • Query param: kind (combined | progestin_only)

Example Usage

# Check API health
curl http://localhost:5050/api/health

# Get cycle info
curl "http://localhost:5050/api/cycle?packType=combined_24_4&startDate=2025-11-01"

# Check interactions
curl -X POST http://localhost:5050/api/check-interactions \
  -H "Content-Type: application/json" \
  -d '{"meds":["rifampin","topiramate"],"pillType":"combined"}'

🎨 Tech Stack

Frontend

  • React 18 - UI framework
  • Vite - Build tool and dev server
  • Tailwind CSS v4 - Utility-first CSS framework
  • Framer Motion - Animation library
  • Radix UI - Unstyled, accessible UI components
  • Lucide React - Icon library
  • dayjs - Date manipulation
  • clsx - Conditional classNames

Backend

  • Express.js - Web framework
  • Zod - Schema validation
  • dotenv - Environment configuration
  • Morgan - HTTP request logger
  • CORS - Cross-origin resource sharing
  • dayjs - Date manipulation

External APIs

  • RxNav/RxNorm (NLM) - Drug name resolution and interaction detection
  • OpenFDA - Drug label information (optional enrichment)

πŸ”§ Configuration

Environment Variables

Server (server/.env):

PORT=5050
USE_DEMO_DATA=true          # true for demo mode, false for real APIs
STRICT_REAL_MODE=false      # true to disable demo fallback

Frontend (frontend/.env):

VITE_API_URL=http://localhost:5050

Demo vs Real API Mode

  • Demo Mode (USE_DEMO_DATA=true): Uses mock data from miniData.js
  • Real Mode (USE_DEMO_DATA=false): Calls RxNav and OpenFDA APIs
  • Auto-fallback: Real mode falls back to demo data if APIs fail (unless STRICT_REAL_MODE=true)

πŸ“– Documentation

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

⚠️ Disclaimer

This is a demonstration application for educational purposes only.

  • NOT MEDICAL ADVICE: Always consult your healthcare provider for medical decisions
  • NOT A SUBSTITUTE: This app does not replace professional medical consultation
  • DATA ACCURACY: The interaction data is illustrative and may not be comprehensive
  • USE AT YOUR OWN RISK: The developers assume no liability for decisions made using this app

πŸ“ License

This project is licensed under the MIT License.

πŸ‘ Acknowledgments

  • RxNav API by National Library of Medicine
  • OpenFDA by U.S. Food and Drug Administration
  • shadcn/ui for the beautiful component system
  • Figma Community for design inspiration

πŸ“§ Contact

For questions or feedback, please open an issue on GitHub.


Made with πŸ’œ for better birth control awareness and safety.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors