{"filename":"tailwind-react-firebase-cursorrules-prompt-file.mdc","content":"---\ndescription: \"Cursor rules for Tailwind development with React and Firebase integration.\"\nglobs: **/*\nalwaysApply: false\n---\nHere are some best practices and rules to follow for creating a high-quality, mobile-first web app with excellent UI/UX using Tailwind, React, and Firebase:\n\nMobile-First Design:\nAlways design and implement for mobile screens first, then scale up to larger screens.\nUse Tailwind's responsive prefixes (sm:, md:, lg:, xl:) to adjust layouts for different screen sizes.\n\nConsistent Design System:\nCreate a design system with consistent colors, typography, spacing, and component styles.\nUtilize Tailwind's configuration file (tailwind.config.js) to define your custom design tokens.\n\nPerformance Optimization:\nUse React.lazy() and Suspense for code-splitting and lazy-loading components.\nImplement virtualization for long lists using libraries like react-window.\nOptimize images and use next/image for automatic image optimization in Next.js.\n\nResponsive Typography:\nUse Tailwind's text utilities with responsive prefixes to adjust font sizes across different screens.\nConsider using a fluid typography system for seamless scaling.\n\nAccessibility:\nEnsure proper color contrast ratios using Tailwind's text-* and bg-* classes.\nUse semantic HTML elements and ARIA attributes where necessary.\nImplement keyboard navigation support.\n\nTouch-Friendly UI:\nMake interactive elements (buttons, links) at least 44x44 pixels for easy tapping.\nImplement touch gestures for common actions (swipe, pinch-to-zoom) where appropriate.\n\nUSE THE IMAGES IN THE MOCKUPS FOLDER AS EXAMPLE OF HOW TO STYLE THE APP AND CREATE THE LAYOUT\n\nWHEN CREATING A FILE DON'T CONFLICT IT WITH .TSX AND .JSX FILES\n\nFirebase Best Practices:\nImplement proper security rules in Firebase.\nUse Firebase SDK's offline persistence for better performance and offline support.\nOptimize queries to minimize read/write operations.\n\nError Handling and Feedback:\nImplement proper error boundaries in React.\nProvide clear feedback for user actions (loading states, success/error messages).\n\nAnimation and Transitions:\nUse subtle animations to enhance UX (e.g., page transitions, micro-interactions).\nUtilize Tailwind's transition utilities or consider libraries like Framer Motion.\n\nForm Handling:\nUse libraries like Formik or react-hook-form for efficient form management.\nImplement proper form validation with clear error messages.\n\nCode Organization:\nFollow a consistent folder structure (e.g., components, hooks, pages, services).\nUse custom hooks to encapsulate and reuse logic.\n\nNative-like Features:\nImplement pull-to-refresh for content updates.\nUse smooth scrolling and momentum scrolling.\nConsider using libraries like react-spring for physics-based animations.\n\nHere’s a concise prompt for a language model to help you with the logic for creating AI-powered medication insights in your app:\n\nPrompt:\nDesign a feature for a pill management app that tracks user interactions with medications (Take/Skip) and generates monthly adherence reports.\n\nThe app should:\n\nUser Interface:\nDisplay pills for \"Morning,\" \"Afternoon,\" and \"Night\" with buttons for \"Take\" and \"Skip.\"\nShow a confirmation modal for user actions.\n\nData Collection:\nLog user interactions (pill ID, action, timestamp, notes) in a database.\n\nMonthly Report:\nAggregate data to calculate total pills scheduled vs. taken, adherence percentage, and trends (e.g., frequently skipped pills).\n\nAI Insights:\nUse basic statistical analysis to generate personalized suggestions based on user feedback (e.g., side effects, missed doses).\n\nDashboard:\nCreate a section for users to view their monthly reports, including adherence percentage, trends, and AI-generated suggestions.\n\nThis prompt provides a clear and structured request for assistance in developing the feature, focusing on key components and functionality.\n"}