How xitenglongping755-cell/group21-step3-1 works
Giftia is a gift-discovery application: users search products by keyword, category, packaging and price, or use a family-birthday flow with tags and optional relation. The frontend loads tag choices, submits the active tab’s conditions to FastAPI, and renders ranked results as cards. The API queries the product database and adapts rows to the frontend’s Gift shape. The family UI supports featured cards, reasons and gift-giver voices, although the sampled backend does not show those fields being populated. Relationships reflect the excerpts and documented contracts; unsampled implementations are not inferred.
Main entry points: api.ts API client · page.tsx Search page · database.py Query helper · main.py Standard search
Components 10
Giftia frontend
- Search page
giftia-fromtend/app/page.tsx - API client
giftia-fromtend/lib/api.ts - Result card
giftia-fromtend/app/ResultCard.tsx
Search API
- Standard search
backend/main.py - Family search
backend/main.py - Usage tags
backend/main.py - Gift mapping
backend/main.py
Product data
- Query helper
backend/database.py - Gift database
Other components
- Gift seeker
Connections 13
- Gift seeker → Search page: uses
giftia-fromtend/app/page.tsx - Search page → API client: requests search
giftia-fromtend/app/page.tsx - Search page → API client: loads tags
giftia-fromtend/app/page.tsx - Search page → Result card: renders results
giftia-fromtend/app/page.tsx - API client → Standard search: calls /api/search
giftia-fromtend/lib/api.ts - API client → Family search: calls /api/family-search
giftia-fromtend/lib/api.ts - API client → Usage tags: calls /api/usage-tags
giftia-fromtend/lib/api.ts - Standard search → Query helper: queries products
backend/main.py - Family search → Query helper: queries products and tags
backend/main.py - Usage tags → Query helper: reads tag choices
backend/main.py - Standard search → Gift mapping: maps result rows
backend/main.py - Family search → Gift mapping: maps result rows
backend/main.py - Query helper → Gift database: executes SELECT
backend/database.py