{"id":29744608,"url":"https://github.com/askitendo/cramppanchayat","last_synced_at":"2025-10-04T01:37:41.206Z","repository":{"id":301803242,"uuid":"1010095728","full_name":"AskitEndo/crampPanchayat","owner":"AskitEndo","description":"CrampPanchayat is a privacy-first, emoji-powered period tracking app with offline-first support, cultural inclusivity, and optional cloud sync via Supabase.","archived":false,"fork":false,"pushed_at":"2025-07-12T14:22:43.000Z","size":7125,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-26T10:00:09.022Z","etag":null,"topics":["android","expo","ios","open-source","react-native","supabase"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AskitEndo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-28T10:33:32.000Z","updated_at":"2025-07-12T14:22:46.000Z","dependencies_parsed_at":"2025-07-26T05:25:56.351Z","dependency_job_id":"3b93bea0-c09e-441c-9cff-df2c4e65615e","html_url":"https://github.com/AskitEndo/crampPanchayat","commit_stats":null,"previous_names":["askitendo/cramppanchayat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AskitEndo/crampPanchayat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AskitEndo%2FcrampPanchayat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AskitEndo%2FcrampPanchayat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AskitEndo%2FcrampPanchayat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AskitEndo%2FcrampPanchayat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AskitEndo","download_url":"https://codeload.github.com/AskitEndo/crampPanchayat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AskitEndo%2FcrampPanchayat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278254469,"owners_count":25956598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","expo","ios","open-source","react-native","supabase"],"created_at":"2025-07-26T05:23:02.556Z","updated_at":"2025-10-04T01:37:41.189Z","avatar_url":"https://github.com/AskitEndo.png","language":"TypeScript","funding_links":["https://github.com/sponsors/askitendo"],"categories":[],"sub_categories":[],"readme":"# 🩷 CrampPanchayat\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"src/assets/images/app-icon.png\" alt=\"CrampPanchayat App Icon\" width=\"120\" height=\"120\" style=\"border-radius: 20px\"/\u003e\n  \n  **Privacy-First Period Tracking App**\n  \n  *Anonymous • Offline-First • Cultural Sensitivity*\n  \n  [![React Native](https://img.shields.io/badge/React%20Native-0.74.5-blue.svg)](https://reactnative.dev/)\n  [![Expo](https://img.shields.io/badge/Expo-51.0.28-black.svg)](https://expo.dev/)\n  [![TypeScript](https://img.shields.io/badge/TypeScript-5.3.3-blue.svg)](https://www.typescriptlang.org/)\n  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n\u003c/div\u003e\n\n## 🌟 Overview\n\nCrampPanchayat is a **production-ready** offline-first period tracking app that prioritizes user privacy and accessibility. Built with React Native and TypeScript, it offers an emoji-based anonymous profile system, ensuring users can track their menstrual health without compromising personal data.\n\n### ✨ Key Features\n\n- **🎭 Emoji-Based Anonymous Profiles**: Choose from 16 culturally diverse emojis (🩷, 🦋, 🌙, 🌟, etc.)\n- **📱 Offline-First Architecture**: Works completely offline with optional cloud sync\n- **🔒 Privacy-First Design**: No email, phone numbers, or personal information required\n- **📅 Smart Calendar Tracking**: Manual date selection with intelligent cycle predictions\n- **🩺 Comprehensive Symptom Tracking**: 13+ categories with intensity ratings and notes\n- **👨‍👩‍👧‍👦 Multi-User Support**: Family sharing on a single device\n- **☁️ Real-time Cloud Sync**: Secure username-based cloud accounts with instant availability checking\n- **📊 Live Statistics**: Real-time cloud user statistics and community insights\n\n## 🏗️ Architecture\n\n### Tech Stack\n\n| Technology                 | Version  | Purpose                             |\n| -------------------------- | -------- | ----------------------------------- |\n| **React Native**           | 0.74.5   | Cross-platform mobile framework     |\n| **Expo**                   | 51.0.28  | Development platform and deployment |\n| **TypeScript**             | 5.3.3    | Type-safe JavaScript                |\n| **React Navigation**       | 6.x      | Type-safe navigation                |\n| **AsyncStorage**           | 1.23.1   | Offline-first local storage         |\n| **Supabase**               | 2.43.5   | Optional cloud sync with RLS        |\n| **React Native Calendars** | 1.1306.0 | Calendar components                 |\n| **Expo Linear Gradient**   | 13.0.2   | Beautiful UI gradients              |\n\n### 📁 Project Structure\n\n```\nsrc/\n├── components/          # Reusable UI components\n│   ├── ProfileCard/     # Emoji profile displays\n│   ├── SymptomCard/     # Symptom tracking widgets\n│   └── CalendarCard/    # Calendar components\n├── screens/            # Application screens\n│   ├── HomeScreen/      # Dashboard with cycle overview\n│   ├── CalendarScreen/  # Period tracking calendar\n│   ├── SymptomsScreen/  # Symptom logging interface\n│   ├── SettingsScreen/  # App configuration\n│   ├── ProfileSelector/ # Emoji profile management\n│   ├── DataManagement/ # Export/import/delete data\n│   ├── OnboardingScreen/# First-time user experience\n│   └── SupportScreen/   # Help and donations\n├── services/           # Business logic and APIs\n│   ├── storage.ts      # AsyncStorage wrapper\n│   ├── supabase.ts     # Cloud sync service with real-time features\n│   ├── cloudSync.ts    # Enhanced cloud synchronization\n│   ├── periodTracking.ts # Unified period tracking logic\n│   └── analytics.ts    # Anonymous usage tracking\n├── hooks/              # Custom React hooks\n│   ├── useProfiles.ts  # Profile management logic\n│   ├── usePeriodTracking.ts # Unified period data operations\n│   └── useSymptoms.ts  # Symptom tracking logic\n├── types/              # TypeScript definitions\n│   ├── index.ts        # Core type definitions\n│   └── navigation.ts   # Navigation types\n├── constants/          # App configuration\n│   └── index.ts        # Emojis, symptoms, settings\n├── utils/              # Utility functions\n│   ├── dateUtils.ts    # Date manipulation helpers\n│   ├── cycleCalculations.ts # Prediction algorithms\n│   └── optimization.ts # Performance utilities\n└── navigation/         # Navigation configuration\n    └── RootNavigator.tsx # Main navigation setup\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- **Node.js** (v18 or higher)\n- **npm** or **yarn**\n- **Expo CLI** (`npm install -g @expo/cli`)\n- **Android Studio** (for Android development)\n- **Xcode** (for iOS development, macOS only)\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/askitendo/cramppanchayat.git\n   cd cramppanchayat\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   # or\n   yarn install\n   ```\n\n3. **Set up environment variables**\n\n   ```bash\n   cp .env.example .env\n   # Edit .env with your Supabase credentials (optional)\n   ```\n\n4. **Start the development server**\n\n   ```bash\n   npm start\n   # or\n   expo start\n   ```\n\n5. **Run on device/simulator**\n\n   ```bash\n   # Android\n   npm run android\n\n   # iOS\n   npm run ios\n\n   # Web\n   npm run web\n   ```\n\n## 🔧 Configuration\n\n### Environment Variables\n\nCreate a `.env` file in the root directory:\n\n```env\n# Supabase Configuration (Optional - for cloud sync)\nEXPO_PUBLIC_SUPABASE_URL=your_supabase_url\nEXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key\n\n# Analytics (Optional - anonymous only)\nEXPO_PUBLIC_ANALYTICS_ENABLED=false\n```\n\n**Note**: The app works perfectly without any environment variables - all cloud features are optional!\n\n### Supabase Setup (Optional)\n\nFor cloud sync functionality, follow the **comprehensive setup guide**:\n\n1. **Quick Setup**: Use the complete database setup script\n\n   ```bash\n   # Run SUPABASE_COMPLETE_SETUP.sql in your Supabase SQL editor\n   # This includes all tables, functions, triggers, and security policies\n   ```\n\n2. **Features Included**:\n\n   - ✅ **Real-time Username Availability**: Instant feedback during account creation\n   - ✅ **Robust User Management**: Complete user deletion with proper cleanup\n   - ✅ **Row Level Security**: Advanced RLS policies for data protection\n   - ✅ **Cloud Statistics**: Live user count and community insights\n   - ✅ **Anonymous Sync**: Privacy-first cloud data synchronization\n\n3. **Database Functions**:\n   - `check_username_exists()` - Real-time username availability checking\n   - `delete_user_complete()` - Safe user deletion with full cleanup\n   - `validate_period_data()` - Data integrity validation\n\nFor detailed setup instructions, see [`SUPABASE_COMPLETE_SETUP.sql`](SUPABASE_COMPLETE_SETUP.sql).\n\n## 📱 Features in Detail\n\n### 🎭 Anonymous Emoji Profiles\n\nChoose from 16 carefully selected emojis representing diverse identities:\n\n- 🩷 Pink Heart, 🦋 Butterfly, 🌙 Crescent Moon, 🌟 Star\n- 🌺 Hibiscus, 🦄 Unicorn, 🌈 Rainbow, 💫 Shooting Star\n- 🌹 Rose, 🍃 Leaf, 🌻 Sunflower, 🌿 Herb\n- 🌷 Tulip, 🌼 Daisy, ✨ Sparkles, 🌱 Seedling\n\n### 📅 Smart Period Tracking\n\n- **Manual Date Selection**: Tap calendar dates to log periods\n- **Cycle Predictions**: AI-powered predictions based on personal patterns\n- **Flexible Tracking**: Handle irregular cycles and variations\n- **Historical Data**: View past cycles and identify patterns\n\n### 🩺 Comprehensive Symptom Tracking\n\nTrack 13+ symptom categories with intensity levels (1-5):\n\n| Physical             | Emotional       | Other             |\n| -------------------- | --------------- | ----------------- |\n| Cramps 🩸            | Mood Swings 😤  | Sleep Issues 😴   |\n| Headache 🤕          | Anxiety 😰      | Food Cravings 🍫  |\n| Bloating 🤰          | Irritability 😡 | Acne 😣           |\n| Breast Tenderness 💔 | Depression 😢   | Energy Changes ⚡ |\n| Fatigue 😴           | Stress 😵       | And more...       |\n\n### 🔒 Privacy \u0026 Security\n\n- **No Personal Data**: No email, phone, or real names required\n- **Local Storage**: All data stored locally on device by default\n- **Anonymous IDs**: Cloud sync uses anonymous identifiers only\n- **Data Ownership**: Easy export and deletion of all data\n- **Transparent**: Open source with clear privacy practices\n- **Real-time Username Check**: Secure username availability without data leaks\n- **Robust Deletion**: Complete data removal including all cloud traces\n\n### ☁️ Cloud Sync Features (Optional)\n\n- **🔄 Real-time Synchronization**: Instant data sync across devices\n- **👤 Username-based Accounts**: Simple username/password system\n- **📊 Live Statistics**: Community insights while maintaining anonymity\n- **🔒 Row Level Security**: Database-level privacy protection\n- **📱 Multi-device Support**: Access your data from any device\n- **🚫 Easy Account Deletion**: Complete data removal with one click\n\n## 🌍 Cultural Considerations\n\nCrampPanchayat is designed with global users in mind:\n\n- **Inclusive Emoji Selection**: Diverse representation in profile options\n- **Cultural Sensitivity**: Respectful language and imagery\n- **Accessibility**: Screen reader support and high contrast options\n- **Multi-Language Ready**: Architecture supports localization\n- **Educational Content**: Culturally appropriate health information\n\n## 🗺️ Roadmap \u0026 Recent Updates\n\n### ✅ **Latest Release (v1.0.5) - January 2025**\n\n- ✅ **Enhanced Cloud Sync**: Real-time username availability checking\n- ✅ **Improved Statistics**: Live cloud user statistics with proper sign-in state handling\n- ✅ **Robust User Management**: Complete user deletion with proper cleanup\n- ✅ **Unified Period Tracking**: Consolidated period tracking logic for better performance\n- ✅ **Enhanced Database**: Complete Supabase setup with advanced RLS policies\n- ✅ **Bug Fixes**: Fixed duplicate notes, improved error handling, better state management\n\n### 🔮 Long Term Vision (v2.0+) - 2026\n\n- 👥 **Privacy-First Community**: Anonymous health insights and peer support features\n- 💊 **Comprehensive Fertility Tracking**: Optional fertility awareness method support\n- 🧠 **Holistic Wellness**: Integration with sleep, stress, and nutrition tracking\n- 🔐 **End-to-End Encryption**: Advanced security for all user data\n- 📱 **Progressive Web App**: Browser-based access with full offline capabilities\n- 🌙 **Wellness Ecosystem**: Complete menstrual and reproductive health platform\n\n### 🛠️ Technical Achievements\n\n- ✅ **Zero TypeScript Errors**: Strict typing throughout the codebase\n- ✅ **Robust Error Handling**: Comprehensive fallbacks and user feedback\n- ✅ **Database Security**: Advanced RLS policies and safe user management\n- ✅ **Real-time Features**: Live username checking and cloud statistics\n- ✅ **Performance Optimized**: Unified tracking logic and efficient state management\n- ✅ **Production Ready**: Comprehensive testing and error boundary implementation\n\n### 🧪 **Quality Assurance**\n\n- **Database Integrity**: All SQL functions tested with proper error handling\n- **Type Safety**: 100% TypeScript coverage with strict configuration\n- **User Experience**: Real-time feedback and intuitive error messages\n- **Privacy Compliance**: No personal data logging or unauthorized access\n- **Cross-platform**: Tested on iOS, Android, and web platforms\n\n_Want to contribute to these goals? Check out our [Contributing Guide](CONTRIBUTING.md)!_\n\n## 🚀 Production Ready Features\n\n### ✅ **Recent Critical Fixes (January 2025)**\n\n**Username Availability System**:\n\n- ✅ Real-time database checking via `check_username_exists()` SQL function\n- ✅ Accurate feedback during account creation (no more false \"available\" messages)\n- ✅ Debounced checking (500ms) for optimal user experience\n- ✅ Proper error handling and fallback behavior\n\n**Cloud Statistics Display**:\n\n- ✅ Shows \"Sign in to see total cloud users\" when not authenticated\n- ✅ Live user count when signed in\n- ✅ Proper loading states and error handling\n- ✅ Responsive sign-in state management\n\n**Database \u0026 User Management**:\n\n- ✅ Complete Supabase setup in single `SUPABASE_COMPLETE_SETUP.sql` file\n- ✅ Robust user deletion with UUID/TEXT type handling\n- ✅ Advanced RLS policies for secure data access\n- ✅ Automatic auth cleanup triggers\n\n**Code Quality \u0026 Performance**:\n\n- ✅ Unified period tracking logic (removed duplicates)\n- ✅ Zero TypeScript compilation errors\n- ✅ Enhanced error boundaries and user feedback\n- ✅ Optimized state management and data flow\n\n### 🔧 **Developer Experience**\n\n- **Single SQL Setup**: One comprehensive database setup file\n- **Type Safety**: Strict TypeScript with comprehensive interfaces\n- **Error Handling**: Graceful degradation and user-friendly messages\n- **Documentation**: Comprehensive setup guides and code comments\n- **Testing**: Production-tested with real user scenarios\n\n## 🤝 Contributing\n\nWe welcome contributions from developers, designers, and health advocates!\n\n### Development Setup\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes and test thoroughly\n4. Commit using conventional commits: `git commit -m 'feat: add amazing feature'`\n5. Push to your branch: `git push origin feature/amazing-feature`\n6. Open a Pull Request\n\n### Code Style Guidelines\n\n- **TypeScript**: Strict typing with comprehensive interfaces\n- **React Components**: Functional components with proper TypeScript props\n- **Testing**: Write tests for critical functionality\n- **Performance**: Use React.memo, useMemo, and useCallback appropriately\n- **Privacy**: Never log or store personal information\n\n## 📊 Data Management\n\n### Local Storage\n\n- **AsyncStorage**: Primary storage for offline-first experience\n- **Data Format**: JSON with version control for migrations\n- **Backup**: Export data as JSON for personal backup\n- **Performance**: Optimized unified period tracking logic\n\n### Cloud Sync (Optional)\n\n- **Supabase**: PostgreSQL with Row Level Security (RLS)\n- **Anonymous**: Uses device-generated anonymous IDs\n- **Selective**: Users choose what data to sync\n- **Real-time**: Live username availability and statistics\n- **Secure**: Complete user deletion with proper cleanup\n\n### 🔧 Database Features\n\n- **Advanced RLS**: Row Level Security for data protection\n- **Smart Functions**: Real-time username checking and user management\n- **Data Validation**: Automatic period data structure validation\n- **Cleanup Triggers**: Automatic auth data cleanup on user deletion\n- **Performance Indexes**: Optimized queries for large datasets\n\n## 💝 Support the Project\n\nCrampPanchayat is free and open source. Support development through:\n\n- **UPI Donations**: Scan QR code in app\n- **GitHub Sponsors**: [Sponsor on GitHub](https://github.com/sponsors/askitendo)\n- **Contributions**: Code, design, translations, or documentation\n- **Spread the Word**: Share with friends and family\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"src/assets/images/upi-qr.png\" alt=\"UPI Donation QR Code\" width=\"200\" height=\"200\"/\u003e\n  \u003cp\u003e\u003cem\u003eUPI Donation QR Code\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n## 📄 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"src/assets/images/AskitEndo.png\" alt=\"Askit Endo Logo\" width=\"150\"/\u003e\n  \n  **Made with 🩷 for menstrual health awareness**\n  \n  *For people you love from people they love.*\n  \n  ---\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskitendo%2Fcramppanchayat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskitendo%2Fcramppanchayat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskitendo%2Fcramppanchayat/lists"}