How fotopaulooficial/gmc-prices works
Preços x Mercado retrieves Google Merchant benchmark data and presents it for filtering, comparison, and selection. The user sets a discount and reviews an approval summary; selected products are converted into Tray product lines and exported as CSV or XLSX. The server-side export path re-fetches selected rows from Merchant data rather than trusting browser-supplied prices. The README also documents optional Basic Auth and the Tray import template. UI-to-XLSX routing is documented as a capability, but the sampled UI excerpt does not show that request, so the edge is marked unverified.
Main entry points: tray.ts Tray line conversion · precos-app.tsx Filter and approval UI · page.tsx Catalog page · tray-export.ts Validate export selection
Components 14
Catalog interface
- Catalog page
app/page.tsx - Filter and approval UI
app/precos-app.tsx - Page layout
app/layout.tsx
Market data
- Price report and cache
lib/merchant.ts
Tray export
- Validate export selection
lib/tray-export.ts - Tray line conversion
lib/tray.ts - CSV export endpoint
app/api/precos.csv/route.ts - XLSX export endpoint
app/api/precos.xlsx/route.ts - XLSX builder
lib/tray-xlsx.ts - Tray import template
app/csv-template/modelo.xlsx
Access control
- Optional Basic Auth
middleware.ts
Other components
- Catalog user
- Google Merchant API
- Tray importer
Connections 18
- Catalog user → Catalog page: opens catalog
app/page.tsx - Catalog page → Price report and cache: loads prices
app/page.tsx - Catalog page → Filter and approval UI: renders
app/page.tsx - Price report and cache → Google Merchant API: queries report
lib/merchant.ts - Filter and approval UI → Tray line conversion: builds selection lines
app/precos-app.tsx - Filter and approval UI → CSV export endpoint: requests CSV
- Filter and approval UI → XLSX export endpoint: requests XLSX
- CSV export endpoint → Validate export selection: loads selection
app/api/precos.csv/route.ts - XLSX export endpoint → Validate export selection: loads selection
app/api/precos.xlsx/route.ts - Validate export selection → Price report and cache: reloads rows
lib/tray-export.ts - Validate export selection → Tray line conversion: builds export lines
lib/tray-export.ts - CSV export endpoint → Tray line conversion: formats CSV
app/api/precos.csv/route.ts - XLSX export endpoint → XLSX builder: builds workbook
app/api/precos.xlsx/route.ts - XLSX builder → Tray line conversion: formats lines
lib/tray-xlsx.ts - Tray line conversion → Tray import template: matches columns
lib/tray.ts - Catalog user → Optional Basic Auth: sends credentials
middleware.ts - Page layout → Catalog page: wraps page
app/layout.tsx - Catalog user → Tray importer: imports export
README.md