Version 1.5.8 - A comprehensive web application for managing home medicine inventory with expiry tracking, family sharing, and intelligent notifications. Built with Next.js, TypeScript, and Firebase.
๐ View Changelog
- Family Groups: Create and manage medicine inventory for your entire family
- 6-Character Family Codes: Simple, secure family joining system (no email required)
- Optional Password Protection: Secure families with bcrypt-encrypted passwords
- Role-Based Access: Admin and member roles with appropriate permissions
- Real-time Sync: All family members see inventory updates instantly
- Code Regeneration: Admins can generate new family codes anytime
- Comprehensive Database: Store medicine details, quantities, categories, and locations
- Expiry Monitoring: Track expiration dates with visual warnings and alerts
- Smart Categories: Organize medicines by type (Pain Relief, Antibiotics, Vitamins, etc.)
- Location Tracking: Know exactly where each medicine is stored
- Powerful Search: Find medicines by name, description, or category
- Multiple Filters: Filter by category, location, stock status, expiry status
- Out of Stock Management: Mark medicines as out of stock with tracking
- Sorting Options: Sort by name, expiry date, quantity, or category
- Quick Access: Dedicated expired medicines page with filtering
- Delete Functionality: Remove medicines with confirmation dialogs
- Mobile-First: Fully optimized for phones and tablets
- Responsive Dashboard: Shopping list integration with tiled button layouts
- Touch-Friendly Forms: Large tap targets and intuitive layouts
- Improved Dropdown: Email overflow handling with proper text truncation
- Adaptive Navigation: Desktop navbar transforms to bottom navigation on mobile
- Professional Mobile UI: Clean interface that works perfectly on small screens
- Grid-Based Layout: Modern CSS grid for reliable responsive design
- Google OAuth: Quick sign-in with Google account
- Email/Password: Traditional authentication option
- Secure Sessions: Firebase authentication with automatic session management
- Protected Routes: Family-based access control
- Dark/Light Theme: Toggle between themes (system coming soon)
- Modern Icons: Beautiful Lucide React icons throughout
- Responsive Cards: Clean, card-based interface with mobile optimization
- Loading States: Smooth loading animations and states
- Shopping List Integration: Quick access from dashboard with purple theming
- Confirmation Modals: Safe deletion and action confirmations
- Frontend: Next.js 15, React 18, TypeScript
- Styling: Tailwind CSS
- Backend: Firebase Firestore, Firebase Auth
- Icons: Lucide React
- Deployment: Vercel (recommended)
- Build Tool: Turbopack (Next.js)
- Node.js 18+ installed
- Firebase project setup
- Google OAuth credentials (optional but recommended)
git clone https://github.com/yourusername/medistock.git
cd medistock
npm install
-
Create Firebase Project
- Go to Firebase Console
- Create a new project
- Enable Authentication (Email/Password and Google Sign-in)
- Create a Firestore database
-
Configure Authentication
- Enable Email/Password authentication
- Enable Google Sign-in (optional)
- Add your domain to authorized domains
-
Set Up Firestore
- Create a Firestore database in production mode
- Configure security rules (see below)
Create .env.local
file in the root directory:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key_here
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can read/write their own profile
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Family members can read/write medicines in their family
match /medicines/{medicineId} {
allow read, write: if request.auth != null &&
exists(/databases/$(database)/documents/families/$(resource.data.familyId)) &&
request.auth.uid in get(/databases/$(database)/documents/families/$(resource.data.familyId)).data.members[].userId;
}
// Family management - members can read, admins can write
match /families/{familyId} {
allow read: if request.auth != null &&
request.auth.uid in resource.data.members[].userId;
allow write: if request.auth != null &&
request.auth.uid in resource.data.members[?(@.role == 'admin')].userId;
}
// Activity logs - family members can read, system can write
match /activityLogs/{logId} {
allow read: if request.auth != null &&
exists(/databases/$(database)/documents/families/$(resource.data.familyId)) &&
request.auth.uid in get(/databases/$(database)/documents/families/$(resource.data.familyId)).data.members[].userId;
allow write: if request.auth != null;
}
}
}
npm run dev
Open http://localhost:3000 to view the application.
src/
โโโ app/ # Next.js App Router pages
โ โโโ auth/ # Authentication pages
โ โ โโโ signin/ # Sign in page
โ โ โโโ signup/ # Sign up page
โ โโโ dashboard/ # Main dashboard
โ โโโ family/ # Family management
โ โโโ logs/ # Activity logs
โ โโโ medicines/ # Medicine management
โ โ โโโ add/ # Add medicine form
โ โ โโโ expired/ # Expired medicines view
โ โ โโโ search/ # Search and filter
โ โโโ settings/ # User settings
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Home page redirect
โโโ components/ # React components
โ โโโ Layout/ # Layout components
โ โโโ BottomNav.tsx # Mobile bottom navigation
โ โโโ Layout.tsx # Main layout wrapper
โ โโโ Navbar.tsx # Desktop navigation
โโโ contexts/ # React contexts
โ โโโ AuthContext.tsx # Authentication state
โ โโโ FamilyContext.tsx # Family management state
โโโ lib/ # Utility functions
โ โโโ firebase.ts # Firebase configuration
โ โโโ utils.ts # Helper functions
โโโ types/ # TypeScript type definitions
โโโ index.ts # Application types
- Create Family: Set up family group with optional password protection
- Generate Family Code: Get unique 6-character code for easy sharing
- Invite Members: Share family code (and password if set) with family members
- Join Family: Enter family code and optional password to join
- Manage Security: Change or remove family passwords anytime (admins only)
- Regenerate Codes: Create new family codes when needed
- View Members: See all family members with their roles and join dates
- Add Medicines: Comprehensive form with all details
- Track Expiry: Visual indicators for expired/expiring medicines
- Organize: Categories and storage locations
- Search: Find medicines quickly with filters
- Bottom Navigation: Easy thumb navigation on mobile
- Profile Menu: Access family, settings, and logs from profile icon
- Responsive Design: Adapts to all screen sizes
- Touch-Friendly: Large tap targets and smooth interactions
-
Connect Repository
# Install Vercel CLI npm i -g vercel # Deploy vercel
-
Configure Environment Variables
- Add all Firebase config variables in Vercel dashboard
- Set production domains in Firebase console
-
Custom Domain (Optional)
- Add custom domain in Vercel dashboard
- Update Firebase authorized domains
The application can be deployed to:
- Netlify: Static hosting with serverless functions
- AWS Amplify: Full-stack deployment
- Google Cloud Platform: Native Firebase integration
- Self-hosted: Docker container deployment
The responsive design makes this web app perfect for:
- PWA Conversion: Add to home screen functionality
- Mobile Wrapper: Cordova/PhoneGap integration
- React Native: Code sharing opportunities
- Fork the Repository
- Create Feature Branch
git checkout -b feature/amazing-feature
- Commit Changes
git commit -m 'Add amazing feature'
- Push to Branch
git push origin feature/amazing-feature
- Open Pull Request
- TypeScript: Maintain strict type safety
- ESLint: Follow linting rules
- Responsive: Test on multiple screen sizes
- Accessibility: Ensure keyboard and screen reader support
# Development server
npm run dev
# Production build
npm run build
# Start production server
npm start
# Linting
npm run lint
# Type checking
npm run type-check
-
Firebase Configuration
# Check environment variables echo $NEXT_PUBLIC_FIREBASE_API_KEY
-
Build Errors
# Clear Next.js cache rm -rf .next npm run build
-
Authentication Issues
- Verify Firebase project settings
- Check authorized domains
- Confirm OAuth configuration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Check Firebase and Next.js docs
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js Team: Amazing React framework
- Firebase Team: Powerful backend services
- Tailwind CSS: Beautiful utility-first CSS
- Lucide: Gorgeous icon library
- Vercel: Excellent deployment platform
โ Shopping List Integration: Quick access shopping button on dashboard โ Enhanced Mobile Dashboard: Proper button tiling with CSS grid layout โ Responsive Design: Optimized layouts from mobile to desktop โ Out of Stock Management: Mark and filter medicines by stock status โ Delete Functionality: Safe medicine deletion with confirmations โ Bulk Operations: Manage expired medicines and shopping lists efficiently
โ Family Code System: No more email dependencies - simple 6-character codes โ Password Protection: Optional bcrypt-encrypted family passwords โ Enhanced Mobile UI: Perfect mobile experience with responsive design โ Improved Security: Better validation and admin-only operations โ Cleaner Interface: Conditional content display and better form handling
- Dark Theme: Complete dark mode implementation
- Push Notifications: Expiry reminders
- Barcode Scanner: Quick medicine addition
- Analytics Dashboard: Usage insights
- Backup/Export: Data portability
- Multiple Languages: Internationalization
- Medicine Database: Auto-complete from database
- Doctor Integration: Share with healthcare providers
Made with โค๏ธ for better medicine management
Keep your family healthy with organized medicine tracking!