This document outlines the steps needed to properly set up the StackTrack application for production deployment.
The application is already configured to use Block's Bitcoin price API:
const BLOCK_BITCOIN_PRICE_API_URL = 'https://pricing.bitcoin.block.xyz/current-price';This endpoint is publicly accessible and does not require an API key. It returns data in the format:
{ "USD": 12345.67 }The application currently has MOCK implementations of several external APIs:
- Amazon product search
- Etsy product search
- eBay product search
- Zillow property search
For production use, you must implement secure API access:
- Create a simple backend proxy (using Node.js, Express, Netlify Functions, etc.)
- Make all API calls through your backend to avoid exposing API keys in frontend code
- Set up proper CORS headers and rate limiting
- Implement proper caching to reduce API usage
- Use environment variables with Vite (.env.local file)
- Implement backend validation for any APIs requiring authorization
- Understand that client-side API keys are never fully secure
The application includes multiple Nostr login methods:
- nsec (private key login) - ✅ Working
- nos2x extension - ✅ Working
- Alby extension - ✅ Working
- Nostr Wallet Connect (NWC) - ❌ Incomplete
Before going live, implement a real NWC connection by following these steps:
- Add proper connection code using nostr-tools
- Handle NWC connection errors
- Store connection info securely
- See NWC documentation for implementation details
For production use, switch from localStorage to IndexedDB for better offline support:
- Use the existing IndexedDBService.ts file
- Update Dashboard.tsx to load wishlist items from IndexedDB instead of localStorage
- Update all data save operations to use IndexedDB
- Consider adding a data export/import feature for user backup
Never expose API keys in your frontend code:
- Copy
.env.exampleto.env.local - Add your real API keys to
.env.local - Make sure
.env.localis in your.gitignorefile - For production, set environment variables on your hosting platform
Run the production build:
# Install dependencies
npm install
# Build for production
npm run build
# Test the production build locally
npm run previewThe production build will be created in the dist directory.
Before deploying to production:
- Remove all mock data and testing code (search for warning comments)
- Implement proper error handling for API failures
- Test all login methods thoroughly
- Verify offline functionality works as expected
- Add proper analytics and error logging
- Ensure all API keys are secured properly
- Set up environment variables on your hosting platform
- Configure proper security headers
Deploy the dist directory to your preferred hosting platform:
- Vercel
- Netlify
- GitHub Pages
- AWS S3 + CloudFront
- Firebase Hosting
For optimal performance, configure:
- Caching headers for static assets
- Compression (Brotli or Gzip)
- CDN distribution
- HTTPS enforcement