Download README.md from Jessedbrown/daisy-client: direct link, hf CLI and curl.
- Browser
- Download file 4.8 kB
-
https://huggingface.co/Jessedbrown/daisy-client/resolve/main/README.md
- Command line
-
hf download hf://Jessedbrown/daisy-client/README.md
-
curl -L -o README.md https://huggingface.co/Jessedbrown/daisy-client/resolve/main/README.md
Daisy - Digital Closet Frontend
A modern React-based frontend application for managing your digital wardrobe and discovering new fashion items through web scraping.
π Features
- Digital Closet Management: Add, view, and organize your wardrobe items
- Product Discovery: Search and browse scraped fashion products from major retailers
- Image Upload: Upload and manage photos of your clothing items
π Tech Stack
- Framework: React 18 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS + Radix UI Components
- State Management: TanStack Query (React Query)
- Routing: React Router DOM v7
- Form Handling: React Hook Form with Zod validation
- HTTP Client: Axios
- Testing: Vitest + React Testing Library
- Deployment: Vercel
π Architecture Overview
The frontend follows a modern React architecture with clear separation of concerns:
Component Structure: The application uses a component-based architecture with reusable UI components built on Radix UI primitives. Components are organized into logical groups (ui, forms, layout) with consistent naming conventions.
State Management: TanStack Query handles server state management, providing caching, background updates, and optimistic updates. Local component state is managed with React hooks, while form state uses React Hook Form for optimal performance and validation.
π¦ Installation & Setup
Prerequisites
- Node.js 18+
- npm or yarn
Quick Start
Clone the repository
git clone https://github.com/JesseBrown1980/daisy-client.git cd daisy-clientInstall dependencies
npm installEnvironment Configuration
Create a
.env.localfile in the root directory:VITE_API_BASE_URL=http://localhost:3000/api/v1 VITE_APP_NAME=DaisyStart the development server
npm run devThe application will be available at
http://localhost:5173
Build for Production
npm run build
The built files will be in the dist/ directory.
π Project Structure
src/
βββ api/ # API client and endpoint definitions
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ router/ # Routing components
β βββ __tests__/ # Component tests
βββ hooks/ # Custom React hooks
βββ lib/ # Utility libraries and configurations
βββ pages/ # Page components
βββ styles/ # Global styles
βββ types/ # TypeScript type definitions
βββ utils/ # Helper functions and utilities
π§ Available Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run build:test- Build for testing environmentnpm run build:prod- Build for production environmentnpm run preview- Preview production buildnpm run test- Run testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coverage reportnpm run lint- Lint codenpm run format- Format code with Prettier
π Environment Variables
| Variable | Description | Default |
|---|---|---|
VITE_API_BASE_URL |
Backend API base URL | http://localhost:3000/api/v1 |
VITE_APP_NAME |
Application name | Daisy |
π Deployment
Vercel (Recommended)
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy - Vercel will automatically build and deploy
Manual Deployment
Build the project
npm run buildDeploy the
dist/folder to your hosting provider
π API Integration
The frontend communicates with the backend API through a centralized API client. All endpoints are typed with TypeScript for better development experience.
Key API Endpoints Used:
GET /closet- Fetch closet itemsPOST /closet- Add new closet itemDELETE /closet/:id- Remove closet itemGET /products- Search productsPOST /products/:id/add-to-closet- Add product to closetGET /scrape/brands- Get available brandsPOST /scrape/brand/:brand- Start scraping
π‘ Error Handling
- Error Boundaries: Catch and handle React component errors
- API Error Handling: Centralized error handling with user-friendly messages
- Form Validation: Real-time validation with clear error messages
- Network Error Recovery: Automatic retries and offline support