Actions
ClientProject #2826
openClientProject #2825: [Module] : Korean Stock
[API] : API develop & Integration for korean stock
Description
Tasks:¶
1. Implement All Korean Stock APIs
-
Set up API routes and fetch logic for all required endpoints.
-
Implement both:
-
Next.js API Routes (under
/app/api/v1/korean-stock...) - Fetch Functions (server-side use)
-
Next.js API Routes (under
-
API List to Integrate:
-
/makers-and-bodytypes -
/models/?makerId='' -
/products -
/sitemap -
/products/:id
-
2. Testing Purposes Only – No UI Design
-
Do not implement or style any design components.
-
The purpose of this task is to ensure that:
- API endpoints are reachable
- Data is correctly fetched
- Fetch functions return typed responses
3. Create KoreanStock API Service Functions
-
Set up reusable fetcher functions inside
services/korean-stock.ts -
Write type-safe wrappers for each API with proper TypeScript interfaces or types
-
Examples:
getKoreanStockProducts()getKoreanStockProductDetail(id: string)- etc.
4. Redis integration¶
- Maintian contastaint file using key value pair. (/lib.constants.ts)
MODELS: {
KEY: (id: string) => `getKoreanModelCount-${id}`,
EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
},
PRODUCTS: {
KEY: (searchParams: Record<string, string | number | string[]>) =>
`getKoreanStockList-${JSON.stringify(searchParams)}`,
EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
},
PRODUCT_DETAIL: {
KEY: (id: string) => `getKoreanProductDetails-${id}`,
EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
},
SITEMAP: {
KEY: "getAllKoreanStockListForSeo",
EXPIRE_TIME_IN_SECONDS: 60 * 60 * 24, // 24 hours
},
Notes:¶
- Ensure all API calls are async and handle error states gracefully.
- Keep console logs or JSON previews for now (for verification).
- This issue is preparatory — future issues will focus on UI rendering and interactivity.
Updated by Md.Sajib Ahmed 8 months ago
- Status changed from In Progress to Complete
- % Done changed from 80 to 100
Actions