Skip to content

About

TalentTrust REST API (Express on Vercel) for milestone escrow on Stellar - Swagger docs at /docs

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

TalentTrust Backend

Live

Express + TypeScript API for TalentTrust, a milestone-based freelancer escrow protocol on Stellar. The API mirrors the state machine of the Soroban escrow contract (Talenttrust-Contracts) so clients and freelancers can create engagements, fund escrow, release milestones, raise disputes and build reputation.

Storage is in-memory (seeded with demo data), so no database is required. On serverless hosting the data is per-instance and resets on redeploy.

Endpoints

Method Path Description
GET / Service info and endpoint list (JSON)
GET /health Health check
GET /docs Swagger UI
GET /openapi.json OpenAPI 3 spec
GET /api/v1/chain On-chain contract deployment info
GET /api/v1/stats Aggregate statistics
GET/POST /api/v1/contracts List (?status=, ?party=) / create escrow contracts
GET /api/v1/contracts/:id Get a contract
POST /api/v1/contracts/:id/deposit { "amount": 100 }
POST /api/v1/contracts/:id/milestones/:index/release Release a milestone
POST /api/v1/contracts/:id/dispute { "raisedBy": "G...", "reason": "..." }
POST /api/v1/contracts/:id/resolve { "freelancerBps": 5000 }
POST /api/v1/contracts/:id/cancel Cancel and refund
POST /api/v1/contracts/:id/reputation { "rating": 5 }
GET /api/v1/reputation/:address Freelancer reputation

Development

npm ci
npm run dev      # http://localhost:3001
npm run lint     # type check
npm test
npm run build && npm start

Configuration (all optional, see .env.example): PORT, ESCROW_CONTRACT_ID, STELLAR_NETWORK, STELLAR_RPC_URL, FRONTEND_URL.

Deployment

Deployed on Vercel as a serverless function: api/index.ts exports the Express app and vercel.json rewrites every path to it. src/index.ts only calls listen() when run directly.

vercel deploy --prod

License

MIT

About

TalentTrust REST API (Express on Vercel) for milestone escrow on Stellar - Swagger docs at /docs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages