blueeye-3184
Cursor
feat: Inventory Action Center ๅช›์’–๊ฝ‘ ่ซ›?Vercel/GitHub ?๊ณ•๋ฃž ?๋บฃโ”
1248c60
|
Raw History Blame Contribute Delete
4.34 kB
# API ๊ฒฝ๋กœ ๋Œ€์กฐ (๋ฐฑ์—”๋“œ main.py โ†” ํ”„๋ก ํŠธ์—”๋“œ fetch/apiGet)
๋ฐฑ์—”๋“œ(FastAPI) ๋ผ์šฐํŠธ์™€ ํ”„๋ก ํŠธ์—”๋“œ ํ˜ธ์ถœ ๊ฒฝ๋กœ๊ฐ€ ์ฒ ์ž๊นŒ์ง€ ์ผ์น˜ํ•˜๋Š”์ง€ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
## rewrites (next.config.js)
- `source: '/api/:path*'` โ†’ `destination: \`${backendUrl}/api/:path*\``
- backendUrl: `BACKEND_URL` ๋˜๋Š” `NEXT_PUBLIC_API_URL` ๋˜๋Š” ํ”„๋กœ๋•์…˜ ์‹œ **`lib/backend-url.js`** ์˜ `PRODUCTION_BACKEND_URL` (๋‹จ์ผ ์†Œ์Šค).
- **vercel.json** ์˜ rewrites destination URL์€ ์œ„์™€ ๋™์ผํ•˜๊ฒŒ ์œ ์ง€ (JSON์ด๋ผ import ๋ถˆ๊ฐ€, ์ˆ˜๋™ ๋™๊ธฐํ™”).
## ๋ฐฑ์—”๋“œ ๋ผ์šฐํŠธ โ†” ํ”„๋ก ํŠธ ํ˜ธ์ถœ
| ๋ฐฑ์—”๋“œ (main.py) | ํ”„๋ก ํŠธ ํ˜ธ์ถœ | ๋น„๊ณ  |
|------------------|-------------|------|
| GET /api/health | /api/health | page.tsx ํ—ฌ์Šค์ฒดํฌ |
| GET /api/apple-data | /api/apple-data | page.tsx fetchData |
| GET /api/city-category-pie | /api/city-category-pie | page.tsx |
| GET /api/store-markers | /api/store-markers | page.tsx |
| GET /api/continent-category-pie | /api/continent-category-pie | page.tsx |
| GET /api/store-category-pie | /api/store-category-pie?store_id= | page.tsx |
| GET /api/country-category-pie | /api/country-category-pie?country= | page.tsx |
| GET /api/safety-stock | /api/safety-stock | page.tsx |
| GET /api/safety-stock-forecast-chart | /api/safety-stock-forecast-chart, ?product_name= | page.tsx |
| GET /api/safety-stock-kpi | /api/safety-stock-kpi | page.tsx |
| GET /api/inventory-comments | /api/inventory-comments | page.tsx (GET/fetch) |
| POST /api/inventory-comments | POST /api/inventory-comments | page.tsx |
| GET /api/safety-stock-inventory-list | /api/safety-stock-inventory-list?status_filter= ๋“ฑ | page.tsx |
| GET /api/safety-stock-sales-by-store-period | /api/safety-stock-sales-by-store-period? | page.tsx |
| GET /api/safety-stock-sales-by-product | /api/safety-stock-sales-by-product? | page.tsx |
| GET /api/sales-quantity-forecast | /api/sales-quantity-forecast | page.tsx |
| GET /api/sales-box | /api/sales-box | page.tsx |
| GET /api/demand-dashboard | /api/demand-dashboard? | page.tsx, recommendation |
| GET /api/data-source | /api/data-source | page.tsx |
| GET /api/quick-status | /api/quick-status | page.tsx |
| GET /api/integration-status | /api/integration-status | page.tsx |
| GET /api/last-updated | /api/last-updated | page.tsx |
| GET /api/sales-summary | /api/sales-summary | sales/page, recommendation |
| GET /api/store-performance-grade | /api/store-performance-grade | sales/page |
| GET /api/sales-by-country-category | /api/sales-by-country-category?country= | sales/page |
| GET /api/sales-by-store | /api/sales-by-store?country= | sales/page |
| GET /api/sales-by-store-quarterly | /api/sales-by-store-quarterly? (route.ts ํ”„๋ก์‹œ) | sales/page |
| GET /api/sales-by-store-quarterly-by-category | /api/sales-by-store-quarterly-by-category? | sales/page |
| GET /api/recommendation-summary | /api/recommendation-summary | recommendation |
| GET /api/store-list | /api/store-list | recommendation (fetch) |
| GET /api/store-recommendations/{store_id} | /api/store-recommendations/${id} | recommendation |
| GET /api/store-sales-forecast/{store_id} | /api/store-sales-forecast/${id} | recommendation |
| GET /api/user-personalized-recommendations | /api/user-personalized-recommendations?store_id= | recommendation |
| GET /api/collab-filter-recommendations | /api/collab-filter-recommendations?store_id= | recommendation |
| POST /api/recommendation-feedback | /api/recommendation-feedback | recommendation apiPost |
| GET /api/region-category-pivot | /api/region-category-pivot | recommendation |
| GET /api/price-demand-correlation | /api/price-demand-correlation?product_name= | recommendation |
| GET /api/inventory-critical-alerts | /api/inventory-critical-alerts?limit=50 | recommendation |
| GET /api/customer-journey-funnel | /api/customer-journey-funnel | recommendation |
| GET /api/funnel-stage-weight | /api/funnel-stage-weight | recommendation |
| GET /api/predicted-demand-by-product | /api/predicted-demand-by-product | page.tsx |
## ๋ฐฑ์—”๋“œ๋งŒ ์กด์žฌ (ํ”„๋ก ํŠธ ๋ฏธํ˜ธ์ถœ)
- GET /api/sale-id-pie
- GET /api/country-stores-pie
- GET /api/continent-countries-pie
- GET /api/store-product-quantity-barchart
์œ„ ๊ฒฝ๋กœ๋Š” ํ”„๋ก ํŠธ์—์„œ ํ˜ธ์ถœํ•˜์ง€ ์•Š์Œ. ์‹ ๊ทœ ํ™”๋ฉด ์—ฐ๋™ ์‹œ ์ด ๋ฌธ์„œ์™€ ๊ฒฝ๋กœ๋ฅผ ๋งž์ถœ ๊ฒƒ.