Complete documentation package for frontend engineers working with the MarketWay Navigator API.
1. API_DOCUMENTATION.md - Complete API Reference
- What it contains: Full API documentation with all endpoints, request/response schemas, data models, and code examples
- When to use: When you need detailed information about any endpoint, including all parameters, response fields, and error codes
- Best for: Reference during development, understanding API capabilities
2. API_QUICK_REFERENCE.md - Quick Start Guide
- What it contains: Concise examples, TypeScript types, React hooks, and common patterns
- When to use: When you need quick code snippets or want to get started fast
- Best for: Copy-paste examples, quick lookups, troubleshooting common issues
3. FRONTEND_INTEGRATION_GUIDE.md - Integration Guide
- What it contains: Practical integration examples for React, Vue.js, and vanilla JavaScript
- When to use: When setting up your frontend project to consume the API
- Best for: Project setup, implementing API clients, creating reusable hooks/composables
4. MarketWay_API.postman_collection.json - Postman Collection
- What it contains: Pre-configured API requests for all endpoints
- When to use: For testing API endpoints without writing code
- Best for: API exploration, manual testing, sharing with team members
-
First Time? Start here:
1. Read: API_QUICK_REFERENCE.md (5 min) 2. Import: MarketWay_API.postman_collection.json into Postman 3. Test: Try a few endpoints in Postman 4. Integrate: Follow FRONTEND_INTEGRATION_GUIDE.md for your framework -
Need Details? Check:
API_DOCUMENTATION.md β Full endpoint specifications -
Building a Feature? Use:
FRONTEND_INTEGRATION_GUIDE.md β Copy component examples API_QUICK_REFERENCE.md β Get TypeScript types
// Quick example from API_QUICK_REFERENCE.md
fetch('http://127.0.0.1:8000/product/search?q=shoes')
.then(res => res.json())
.then(data => console.log(data.results));π See: API_QUICK_REFERENCE.md β Quick Examples β Search Products
// Full component example in FRONTEND_INTEGRATION_GUIDE.md
import { useAsk } from '../hooks/useMarketApi';
// ... complete component codeπ See: FRONTEND_INTEGRATION_GUIDE.md β React Integration β Chat Component
{
"answer": "string",
"source": "local" | "online" | "combined",
"images": ["string"]
}π See: API_DOCUMENTATION.md β POST /ask β Response
const formData = new FormData();
formData.append('file', audioBlob, 'query.wav');
fetch('/voice/query', { method: 'POST', body: formData });π See: API_QUICK_REFERENCE.md β Voice Query
| Endpoint | Method | Purpose | Documentation |
|---|---|---|---|
/ask |
POST | Ask questions about market | Docs |
/product/search |
GET | Search for products | Docs |
/line/info/{name} |
GET | Get line details | Docs |
/history |
GET | Get market history | Docs |
/voice/query |
POST | Voice interaction | Docs |
/image/identify |
POST | Image recognition | Docs |
/navigate |
GET | Get directions | Docs |
http://127.0.0.1:8000/docs
Auto-generated Swagger UI for testing endpoints directly in your browser.
Import MarketWay_API.postman_collection.json into Postman:
- Open Postman
- Click "Import"
- Select the JSON file
- Start testing!
Local: http://127.0.0.1:8000
Production: https://your-api-domain.com
- β Use the Postman collection to test endpoints before coding
- β Implement error handling for all API calls
- β Debounce search inputs to reduce API calls
- β Cache responses for frequently accessed data (like history)
- β Use TypeScript types from the documentation
- β Encode URL parameters (especially line names with spaces)
- β Don't forget Content-Type headers for JSON requests
- β Don't use FormData for JSON endpoints (only for file uploads)
- β Don't make API calls on every keystroke (use debouncing)
- β Don't hardcode the API URL (use environment variables)
- β Don't ignore error responses
your-frontend-project/
βββ src/
β βββ api/
β β βββ client.ts # API client setup
β βββ services/
β β βββ marketApi.ts # API service layer
β βββ hooks/ # React hooks
β β βββ useMarketApi.ts
β βββ components/
β β βββ ProductSearch.tsx
β β βββ MarketChat.tsx
β β βββ LineDetails.tsx
β βββ types/
β βββ api.ts # TypeScript types
βββ .env # Environment variables
βββ package.json
π See: FRONTEND_INTEGRATION_GUIDE.md for complete setup instructions
React Developers:
- Setup: FRONTEND_INTEGRATION_GUIDE.md β React Integration
- Hooks: FRONTEND_INTEGRATION_GUIDE.md β Custom React Hooks
- Components: FRONTEND_INTEGRATION_GUIDE.md β React Components
Vue.js Developers:
- Setup: FRONTEND_INTEGRATION_GUIDE.md β Vue.js Integration
- Composables: FRONTEND_INTEGRATION_GUIDE.md β Composables
Vanilla JS Developers:
- Examples: FRONTEND_INTEGRATION_GUIDE.md β Vanilla JavaScript
- Quick snippets: API_QUICK_REFERENCE.md
Setting Up:
- FRONTEND_INTEGRATION_GUIDE.md β Setup
- FRONTEND_INTEGRATION_GUIDE.md β API Client Setup
Building Features:
- API_QUICK_REFERENCE.md β TypeScript Types
- FRONTEND_INTEGRATION_GUIDE.md β Components
- API_DOCUMENTATION.md β Endpoint Details
Debugging:
- API_DOCUMENTATION.md β Error Handling
- API_QUICK_REFERENCE.md β Common Pitfalls
- Postman Collection β Test endpoints manually
- Full API Docs: API_DOCUMENTATION.md
- Quick Reference: API_QUICK_REFERENCE.md
- Integration Guide: FRONTEND_INTEGRATION_GUIDE.md
- Backend README: backend/README.md
- Swagger UI: http://127.0.0.1:8000/docs
- Postman Collection: MarketWay_API.postman_collection.json
- Check the documentation files above
- Test with Postman collection
- Review code examples in integration guide
- Contact the backend team
- β Read API_QUICK_REFERENCE.md
- β Import and test Postman collection
- β Try basic fetch examples from Quick Reference
- β Build a simple search component
- β Set up API client from Integration Guide
- β Create custom hooks/composables
- β Implement error handling
- β Add loading states
- β Implement caching strategy
- β Add request debouncing
- β Handle file uploads (voice/image)
- β Optimize performance
- Total Endpoints: 7
- JSON Endpoints: 5
- File Upload Endpoints: 2
- Authentication Required: None
- Rate Limiting: None (currently)
- API Version: 1.0.0
- Documentation Version: 1.0.0
- Last Updated: 2025-11-28
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MarketWay Navigator API - Quick Reference β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Base URL: http://127.0.0.1:8000 β
β Docs: http://127.0.0.1:8000/docs β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β POST /ask Ask questions β
β GET /product/search?q= Search products β
β GET /line/info/{name} Get line details β
β GET /history Get market history β
β POST /voice/query Voice interaction β
β POST /image/identify Image recognition β
β GET /navigate?line_name= Get directions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
You now have everything you need to integrate the MarketWay Navigator API into your frontend application. Choose your framework, follow the integration guide, and start building amazing features!
Happy Coding! π