This repository is organized as an npm workspaces monorepo for a crypto market + prediction platform.
The platform is currently configured for these assets:
- Bitcoin (BTC)
- Ethereum (ETH)
- XRP
The dashboard runs as a Vite web app deployed on Vercel and fetches market data directly from public crypto market APIs.
apps/web— React + TypeScript frontend (Vite), production app for Vercel.apps/api— TypeScript backend (optional for future server-side features).packages/shared— Shared TypeScript interfaces and DTOs.src+tests— Baseline data pipeline utilities and tests.
npm installIf install fails with 403 Forbidden, try the smart installer script that checks multiple registries and falls back automatically:
npm run install:depsIf your company uses an internal npm proxy, set it explicitly:
NPM_REGISTRY_URL=https://<your-internal-registry> npm run install:depsnpm run dev:web- Web default:
http://localhost:5173
npm run lint
npm run typecheck
npm testThe web app now includes two sign-in experiences:
- Client Sign In: passwordless email magic link (
signInWithOtp) with email verification. - Admin Sign In: email + password (
signInWithPassword) and admin-role checks.
Create apps/web/.env.local from the checked-in example:
cp apps/web/.env.example apps/web/.env.localapps/web/.env.example is prefilled with this project's Supabase URL and publishable key. Update VITE_ADMIN_EMAIL_ALLOWLIST if you want to use a different admin email.
For backend/database environment (root .env or apps/api/.env):
SUPABASE_URL=https://pietlhvbfihcgfxmoysn.supabase.co
SUPABASE_SERVICE_ROLE_KEY=<your-service-role-key>
# Connection pooling (transaction mode, best for short-lived serverless requests)
DATABASE_URL="postgresql://postgres.pietlhvbfihcgfxmoysn:[YOUR-PASSWORD]@aws-1-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true"
# Connection pooling (session mode, best for long-lived app sessions)
DATABASE_URL="postgresql://postgres.pietlhvbfihcgfxmoysn:[YOUR-PASSWORD]@aws-1-us-east-1.pooler.supabase.com:5432/postgres"
# Direct connection (migrations)
DIRECT_URL="postgresql://postgres:[YOUR-PASSWORD]@db.pietlhvbfihcgfxmoysn.supabase.co:5432/postgres"In Supabase dashboard:
- Enable Email provider in Auth settings.
- Configure your redirect URL to include your app origin (e.g.
http://localhost:5173). - For reliable email links across environments, set
VITE_AUTH_REDIRECT_URL(for example your deployed URL) inapps/web/.env.localand allow that URL in Supabase Auth redirect settings. - For admins, either:
- set
app_metadata.role = "admin", or - add their email to
VITE_ADMIN_EMAIL_ALLOWLIST.
- set
With this setup, clients are verified via email before signing in, while admins get a separate UI and access to the admin console.
For a practical implementation plan for date-based ML predictions and near real-time price updates (BTC/ETH/XRP), see docs/CRYPTO_PREDICTION_SYSTEM_GUIDE.md.
After the API reliability foundation is stable, the next implementation phases are:
- Auth — Supabase Auth integration with JWT-backed sessions.
- Alerts + Notifications — User-defined alert rules and scheduled notification jobs (email, push, webhook).
- User Portfolio Features — Portfolio tracking and watchlists.
- Billing + Tiering — Subscription plans, usage tiers, and rate limits.
- Audit/Admin Controls — Audit logs, admin visibility, and control surfaces.
The API now includes foundational authenticated endpoints for core platform capabilities:
GET /api/me— current authenticated user context- Alerts:
GET/POST/DELETE /api/alerts/rules - Portfolio:
GET/POST /api/portfolio/positions - Watchlists:
GET/POST/DELETE /api/watchlists/items - Billing tier profile:
GET /api/billing/profile,POST /api/billing/profile/tier - Admin audit logs:
GET /api/admin/audit-logs(admin role only)
For local development, use Authorization: Bearer dev_<userId> (e.g. dev_demo or dev_admin) to authenticate requests against these new endpoints.
If you want a production URL for anyone to open (and a custom domain), follow DEPLOYMENT_GUIDE.md.
- Fastest path: Vercel
- Also supported: Netlify
This project and its model outputs are for educational and research purposes only and do not constitute financial advice.