Skip to content

tecch-wiz/Disciplr-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disciplr-backend

API and milestone engine for Disciplr: programmable time-locked capital vaults on Stellar.

What it does

  • Health: GET /api/health — service status and timestamp.
  • Vaults:
    • GET /api/vaults — list all vaults (in-memory placeholder).
    • POST /api/vaults — create a vault (body: creator, amount, endTimestamp, successDestination, failureDestination).
    • GET /api/vaults/:id — get a vault by id.

Data is stored in memory for now. Production would use PostgreSQL, a Horizon listener for on-chain events, and a proper milestone/verification engine.

Tech stack

  • Node.js + TypeScript
  • Express for HTTP API
  • Helmet and CORS for security and cross-origin

Local setup

Prerequisites

  • Node.js 18+
  • npm or yarn

Install and run

# From repo root
cd disciplr-backend
npm install
npm run dev

API runs at http://localhost:3000. Frontend dev server can proxy /api to this port.

Scripts

Command Description
npm run dev Run with tsx watch (hot reload)
npm run build Compile TypeScript to dist/
npm run start Run compiled dist/index.js
npm run lint Run ESLint on src

Example: create a vault

curl -X POST http://localhost:3000/api/vaults \
  -H "Content-Type: application/json" \
  -d '{
    "creator": "G...",
    "amount": "1000",
    "endTimestamp": "2025-12-31T23:59:59Z",
    "successDestination": "G...",
    "failureDestination": "G..."
  }'

Project layout

disciplr-backend/
├── src/
│   ├── routes/
│   │   ├── health.ts
│   │   └── vaults.ts
│   └── index.ts
├── package.json
├── tsconfig.json
└── README.md

Merging into a remote

This directory is a separate git repo. To push to your own remote:

cd disciplr-backend
git remote add origin <your-disciplr-backend-repo-url>
git push -u origin main

Replace <your-disciplr-backend-repo-url> with your actual repository URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%