Site Casanova Limaemedeiros Copilot Rules — Free CoPilot…
    Neura MarketNeura Market/CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityCoPilotCoPilot
    DeepSeekDeepSeekStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityPluginsTrending
    CoPilotRulesSite Casanova Limaemedeiros Copilot Rules
    Back to Rules

    Site Casanova Limaemedeiros Copilot Rules

    victormedeeeiros-design July 19, 2026
    0 copies 0 downloads
    Rule Content
    # Copilot Instructions - Site Casanova Lima e Medeiros
    
    ## Architecture Overview
    
    Wedding gift registry website with React/TypeScript frontend and Express.js backend, featuring dual authentication system, Stripe integration and Supabase database.
    
    ### Key Components
    - **Frontend**: React 18 + Vite + TypeScript + Tailwind CSS + shadcn/ui
    - **Backend**: Express.js + TypeScript + Supabase + Stripe
    - **Authentication**: Dual system - Simple admin token + Google OAuth for users
    - **Payments**: Stripe checkout with admin-configurable API keys
    - **Database**: Supabase with products, settings, and admin tables
    
    ## Project Structure
    
    ```
    ├── src/                          # React frontend
    │   ├── components/
    │   │   ├── UserAuth.tsx         # Google OAuth login component
    │   │   ├── GiftList.tsx         # Main gift display (hides admin features from users)
    │   │   ├── StripeProductManager.tsx # Admin-only Stripe integration
    │   │   └── admin/               # Admin-only components
    │   │       ├── AdminLogin.tsx   # Token-based admin login
    │   │       ├── AdminDashboard.tsx
    │   │       └── AdminPanelComplete.tsx # Full admin panel with Stripe config
    │   ├── hooks/
    │   │   ├── useAuth.ts          # User Google OAuth management
    │   │   ├── useAdminAuth.ts     # Admin token authentication
    │   │   └── useGifts.ts         # Gift management & Stripe operations
    │   ├── lib/
    │   │   ├── supabase.ts         # Frontend Supabase client
    │   │   └── stripe.ts           # Stripe utilities
    │   └── pages/
    │       ├── Index.tsx           # Public homepage
    │       └── UserLogin.tsx       # Dedicated user login page
    ├── backend/src/                 # Express API
    │   ├── controllers/
    │   │   ├── auth.ts             # Admin JWT authentication
    │   │   └── product.ts          # Stripe product sync
    │   ├── config/supabase.ts      # Backend database connection
    │   └── index.ts                # API routes with Stripe config endpoints
    └── database/
        └── setup.sql               # Supabase table structure
    ```
    
    ## Authentication Patterns
    
    ### Admin System
    - Uses environment variable `ADMIN_TOKEN` for simple authentication
    - Protects `/admin/*` routes with `adminAuth` middleware
    - Admin panel shows Stripe API key configuration and product management
    - localStorage-based session management for frontend
    
    ### User System
    - Google OAuth integration via Supabase Auth
    - Hook `useAuth()` manages authentication state
    - Users can browse gifts and make purchases
    - NO ACCESS to admin features like `StripeProductManager`
    
    ## Stripe Integration Workflow
    
    ### Admin Configuration Flow
    1. Admin logs in with token → `/admin/login`
    2. Accesses admin panel → `/admin`
    3. Enters Stripe secret key in settings
    4. Backend saves key to `settings` table in Supabase
    5. **Automatic bulk product sync triggered**
    6. All gifts get `stripe_product_id` and `stripe_price_id`
    
    ### Key API Endpoints
    ```typescript
    POST /admin/stripe-config    # Save Stripe API key
    POST /admin/sync-products    # Sync all products to Stripe
    GET  /admin/stripe-products  # List products from Stripe
    ```
    
    ### Data Flow Example
    ```typescript
    // Admin saves Stripe key → automatic sync
    const handleSaveApiKey = async () => {
      await fetch('/admin/stripe-config', { 
        body: { stripe_secret_key: key }
      });
      await handleSyncProducts(); // Auto-triggered
    };
    ```
    
    ## Development Patterns
    
    ### Component Visibility Control
    ```typescript
    // In GiftList.tsx - Hide admin features from regular users
    const isAdmin = localStorage.getItem('adminToken') !== null;
    
    {isAdmin && (
      <Button>Gerenciar Produtos Stripe</Button>
    )}
    ```
    
    ### Environment Configuration
    - Frontend: `VITE_SUPABASE_URL`, `VITE_SUPABASE_ANON_KEY`, `VITE_STRIPE_PUBLISHABLE_KEY`
    - Backend: `STRIPE_SECRET_KEY`, `ADMIN_TOKEN`, `SUPABASE_URL`, `SUPABASE_SERVICE_ROLE_KEY`
    
    ## Database Schema
    
    ### Key Tables
    ```sql
    settings(id, stripe_secret_key, updated_at)     # Stripe configuration
    products(id, name, price, stripe_product_id)    # Product catalog
    admins(id, email, password)                     # Optional JWT admins
    ```
    
    ## Common Tasks
    
    ### Adding New Gifts
    1. Update `initialGifts` array in `GiftList.tsx`
    2. Import gift images in assets structure  
    3. Products auto-sync to Stripe on first admin configuration
    
    ### Stripe API Key Updates
    1. Admin enters new key in settings panel
    2. Triggers `/admin/stripe-config` endpoint
    3. Backend validates and saves to database
    4. **Automatic re-sync of all products**
    5. Updates `stripe_product_id` for all gifts
    
    ### User vs Admin Access
    - Users: Google login → gift browsing → Stripe checkout
    - Admins: Token login → full panel → Stripe config → product management
    - Critical: `StripeProductManager` component NEVER shown to users
    
    ## Security Implementation
    
    ### Route Protection
    - Backend: `adminAuth` middleware validates token on sensitive endpoints
    - Frontend: Conditional rendering based on `localStorage.getItem('adminToken')`
    - Database: RLS policies protect admin and settings tables
    
    ### Key Files for Auth Flow
    - `src/components/GiftList.tsx` - User/admin visibility logic
    - `backend/src/index.ts` - Admin route protection  
    - `src/hooks/useAuth.ts` - User authentication state
    - `src/components/admin/AdminPanelComplete.tsx` - Stripe configuration UI

    Comments

    More Rules

    View all

    QPrisma Copilot Rules

    A
    alexandergg

    Mosl Custom Chart Copilot Rules

    R
    riviangeralt

    InOut App Copilot Rules

    J
    jeanvq

    Fastfood Express Copilot Rules

    J
    jersonjjcr

    Pds Pre View Copilot Rules

    E
    eiriksgata

    Vista Evolved Platform Copilot Rules

    V
    VistA-Evolved

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this CoPilot resource

    • Automated Execution Cleanup System with n8n API and Custom Retention Rulesn8n · $9.99 · Related topic
    • Receive and Analyze Emails with Rules in Sublime Securityn8n · $9.99 · Related topic
    • Create an IPL Cricket Rules Q&A Chatbot with Google Gemini APIn8n · $14.99 · Related topic
    • Automate Bing Copilot Searches and Summarize Results with AIn8n · $14.99 · Related topic
    Browse all workflows