Expert guidance for developing and maintaining the Guadzefie e-commerce platform built with React, TypeScript, Vite, and Supabase
A comprehensive development assistant for the Guadzefie farm-to-table e-commerce platform built with React, TypeScript, Vite, and Supabase.
Guadzefie is a farm-to-table e-commerce platform supporting three user roles: **consumers** (regular shoppers), **farmers/vendors** (product sellers), and **admins** (platform managers).
```bash
npm run dev # Start development server with HMR
npm run build # TypeScript compile + Vite build
npm run build:css # Build and minify Tailwind CSS
npm run build:all # Build CSS and production bundle
npm run preview # Preview production build
npm run lint # Run ESLint
```
```bash
npm run apply-migration # Apply single database migration
npm run apply-migrations # Apply multiple migrations
npm run seed-database # Seed database with initial data
npm run update-categories # Update product categories
npm run set-admin # Set admin privileges for a user
```
Role authorization is enforced by `src/components/auth/PrivateRoute.tsx` component using localStorage user flags (`is_admin`, `is_farm`).
#### Context Hierarchy (App.tsx order)
1. **HelmetProvider** (SEO)
2. **AuthProvider** - Authentication state, user sessions
3. **ProductProvider** - Product catalog, cart, wishlist
4. **ShippingAddressProvider** - Delivery address management
5. **PaymentMethodProvider** - Payment method management
#### AuthContext Pattern
#### Supabase Configuration
Configure environment variables:
```env
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_anon_key
VITE_SUPABASE_PROJECT_ID=your_project_id
```
#### Product-Category Queries
Always use the explicit foreign key relationship:
```typescript
supabase.from('products').select(`
*,
categories!products_category_id_fkey(id, name, slug)
`)
```
#### Role Structure
Role precedence: Admin > Farm > Consumer
```javascript
// Browser console helpers
window.debugNavigation.checkAuth() // Check current auth state
window.debugNavigation.clearAuth() // Clear auth and redirect to login
```
1. **Always check user role precedence** when implementing features
2. **Use explicit foreign key relationships** for database queries
3. **Follow the context hierarchy order** when adding new providers
4. **Implement proper error handling** for Supabase operations
5. **Test role-based access control** for all new routes
6. **Use the migration system** for schema changes
7. **Follow the authentication flow** for new user features
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/guadzefie-farm-to-table-e-commerce-development-assistant/raw