Backend API for Predictify — a Stellar/Soroban prediction-markets dApp.
This service indexes on-chain market state from the Predictify Soroban contract, exposes a REST API for the frontend, handles wallet-based authentication, and ships notifications + leaderboards.
- Node.js 20 + TypeScript
- Express for HTTP
- Drizzle ORM + PostgreSQL for persistence
- zod for env + request validation
- pino for structured logging
- JWT (jsonwebtoken) for wallet-based session auth
- Stellar SDK for Soroban RPC + Horizon
- Jest + supertest for tests
cp .env.example .env # fill JWT_SECRET, DATABASE_URL, contract id
npm install
npm run db:migrate
npm run devsrc/
config/ env + logger
routes/ health, markets (more to come)
services/ domain services
middleware/ errorHandler, auth (planned)
db/ drizzle schema
tests/ jest tests
docs/ architecture docs
scripts/ dev helpers
This starter is intentionally minimal. The full backlog is tracked in GitHub Issues under the OFFICIAL CAMPAIGN label. Major themes:
- Wallet-based auth (Stellar address challenge/signature → JWT)
- Market CRUD + caching layer
- Soroban-RPC indexer with reorg/gap handling
- Predictions + claims endpoints
- Leaderboards & user profiles
- Webhook delivery + DLQ
- Observability (metrics, tracing, /readyz with deep checks)
- OpenAPI spec + contract tests
MIT