✨ Features: - Camera OCR card scanning with Tesseract.js - Beautiful glowing card effects and animations - Intelligent card matching and recognition - Mobile-responsive design with Tailwind CSS 🏗️ Architecture: - Frontend: React TypeScript application - Backend: Vercel Functions (replacing FastAPI) - Database: JSON file with exported card data - Deployment: Single Vercel project 📁 Structure: - api/ - Vercel Functions backend endpoints - src/ - React frontend components and logic - src/data/cards.json - Card database (12 cards) - vercel.json - Optimized Vercel configuration 💰 Cost: /bin/zsh additional (uses existing Vercel Pro) 🚀 Ready for immediate Vercel deployment
26 lines
698 B
TypeScript
26 lines
698 B
TypeScript
// API Configuration for All-Vercel Setup
|
|
const API_CONFIG = {
|
|
development: {
|
|
baseURL: 'http://localhost:3000/api/v1', // Local Vercel dev server
|
|
},
|
|
production: {
|
|
baseURL: '/api/v1', // Relative URL for deployed Vercel functions
|
|
}
|
|
};
|
|
|
|
const environment = process.env.NODE_ENV as 'development' | 'production';
|
|
|
|
export const API_BASE_URL = API_CONFIG[environment].baseURL;
|
|
|
|
// Helper function to build full API URLs
|
|
export const buildApiUrl = (endpoint: string) => {
|
|
return `${API_BASE_URL}${endpoint.startsWith('/') ? endpoint : `/${endpoint}`}`;
|
|
};
|
|
|
|
// Export for use in services
|
|
const apiConfig = {
|
|
baseURL: API_BASE_URL,
|
|
buildUrl: buildApiUrl,
|
|
};
|
|
|
|
export default apiConfig;
|