Minimal, standalone frontend for DePick Telegram bot integration.
This is a lightweight Vite + React + TypeScript app with zero dependencies on:
- OAuth providers (Google, LINE)
- Wallet SDKs (Kaia, MetaMask, OKX)
- SSE/WebSocket connections
- Redux/Zustand state management
- i18n/localization
-
Predict Page (
/predictand/predict/:matchId)- View upcoming matches
- Place predictions with dynamic odds calculation
- Token-based betting only
-
Claim Page (
/claim)- View claimable winning predictions
- Claim rewards
Authentication is handled via JWT token passed in URL parameter:
/predict?auth_token=<JWT>
/predict/:matchId?auth_token=<JWT>
/claim?auth_token=<JWT>
The JWT is generated by the backend when the Telegram bot user requests a link.
- Install dependencies:
npm install- Create
.envfile:
cp .env.example .env- Configure API URL in
.env:
VITE_API_URL=http://localhost:3000
- Run development server:
npm run dev- Build for production:
npm run buildWithout wallet SDKs, OAuth libraries, and other heavy dependencies, the production bundle is ~80% smaller than the main frontend.
The bot is deployed directly to the NestJS backend at /bot/ path:
# From DePick.Bot directory
./deploy-to-backend.shThis will:
- Build the bot (
npm run build) - Copy
dist/to../DePick.BE/public/ - Backend serves static files at
/bot/prefix
Benefits:
- Single deployment
- No CORS issues (same origin)
- Simpler architecture
- Uses relative API URLs
Access:
- Development:
http://localhost:3001/bot/predict?auth_token=JWT - Production:
https://yourdomain.com/bot/predict?auth_token=JWT
Backend serves the bot, so set in DePick.BE/.env:
URL_HOSTING_TELEGRAM_APP=https://yourdomain.com
Bot uses same origin for API calls (no VITE_API_URL needed).