emomo-frontend is a React-based web application designed for searching, viewing, and discovering memes. It serves as the frontend for the Emomo platform, interacting with a backend API to fetch meme data based on semantic search queries (likely powered by VLM descriptions).
Key Features:
- Semantic Search: Users can search for memes using natural language queries.
- Meme Discovery: A homepage displaying recommended memes.
- Detailed View: Modal view for individual memes with high-resolution images and metadata.
- Resilience: Includes a "Demo Mode" with hardcoded data that activates automatically if the backend API is unreachable.
- Framework: React 19 (TypeScript)
- Build Tool: Vite 7
- Styling: CSS Modules (
*.module.css) + Global CSS - Animation: Framer Motion
- Testing: Playwright (End-to-End)
- Linting: ESLint + TypeScript-ESLint
/
├── src/
│ ├── api/ # API client functions (search, fetch memes)
│ ├── components/ # UI Components (Header, MemeGrid, etc.)
│ ├── types/ # Shared TypeScript definitions (Meme, API responses)
│ ├── App.tsx # Main application logic (Routing/State)
│ └── main.tsx # Entry point
├── e2e/ # Playwright end-to-end tests
├── public/ # Static assets
└── .env.example # Template for environment variables
npm installCopy .env.example to .env and configure:
cp .env.example .envVITE_API_BASE: URL of the backend API (defaults tohttp://localhost:8080/api/v1).VITE_API_TOKEN: Optional authentication token.
npm run dev
# Starts Vite server at http://localhost:5173npm run build
# Outputs to dist/ directory- Run E2E Tests:
npm run test(Headless) ornpm run test:ui(Interactive UI) - Lint Code:
npm run lint
- Components: Create new components in
src/components/with a correspondingPascalCase.module.cssfile. - State Management: Uses React hooks (
useState,useEffect) for local state. Complex global state is currently minimal. - API: All network requests are encapsulated in
src/api/index.ts. - Types: Define shared interfaces in
src/types/index.ts. - Styling: Prefer CSS Modules for component-specific styles. Global styles go in
src/App.cssorsrc/index.css.