Backend API with Chainlink Runtime Environment (CRE) for decentralized property data aggregation and verification.
- Node.js 18+
- Supabase account
# Clone repo
git clone https://github.com/Asset-Oracle/assestOracle_Backend.git
cd assestOracle_Backend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Add your Supabase credentials to .env
# Start server
npm startServer runs on http://localhost:5000
POST /api/auth/connect-wallet- Connect walletGET /api/auth/user/:walletAddress- Get user profile
GET /api/assets- List all assets (marketplace)GET /api/assets/:id- Get single assetPOST /api/assets/register- Register new assetPOST /api/assets/:id/verify- Verify asset
GET /api/user/dashboard/:walletAddress- Get dashboard statsGET /api/user/portfolio/:walletAddress- Get user portfolio
POST /api/property/analyze- Analyze property data
POST /api/chainlink/request-verification- Request property verification via Chainlink FunctionsGET /api/chainlink/verification/:requestId- Check verification statusGET /api/chainlink/info- Get CRE integration info
- Request Verification:
POST /api/chainlink/request-verification
{
"propertyAddress": "123 Main St, San Francisco, CA"
}-
Chainlink DON Workflow:
- Request sent to Chainlink Decentralized Oracle Network
- DON executes JavaScript function (
chainlink/propertyDataFunction.js) - Function calls AssetOracle API for property data
- Data aggregated from multiple sources
- Result returned on-chain via smart contract callback
-
Check Status:
GET /api/chainlink/verification/:requestIdUser Request → Backend API → Chainlink Functions
↓
DON Executes JS Code
↓
Aggregates Property Data
↓
Returns Result On-Chain
↓
Smart Contract Stores Result
chainlink/propertyDataFunction.js- Chainlink Functions JavaScript sourcechainlink/PropertyVerificationConsumer.sol- Smart contract consumerroutes/chainlink.js- CRE API endpoints
users:
id(uuid, primary key)wallet_address(text, unique)name(text)email(text)created_at(timestamp)
assets:
id(uuid, primary key)name(text)description(text)category(text)estimated_value(numeric)location(jsonb)property_details(jsonb)images(jsonb)owner_wallet(text)verification_status(text: PENDING, VERIFIED, REJECTED)blockchain_data(jsonb)ai_analysis(jsonb)created_at(timestamp)
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
PORT=5000
NODE_ENV=development
OPENAI_API_KEY=your_openai_key (for AI integration)curl http://localhost:5000/api/healthcurl -X POST http://localhost:5000/api/auth/connect-wallet \
-H "Content-Type: application/json" \
-d '{"walletAddress":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","name":"Test User"}'curl -X POST http://localhost:5000/api/chainlink/request-verification \
-H "Content-Type: application/json" \
-d '{"propertyAddress":"123 Main St, San Francisco, CA"}'- Base URL:
http://localhost:5000(or deployed URL) - All endpoints return JSON with
{success: boolean, data: object}format - Use
/api/chainlink/request-verificationfor decentralized property verification
- Hook into
/api/property/analyzeendpoint - Replace mock AI analysis in
routes/property.jsline 60 - Input: aggregated property data
- Output: AI risk score and investment analysis
Ready to deploy to Railway, Render, or any Node.js hosting.
Backend Lead: Victoria Alayemie
Organization: Asset-Oracle
Hackathon: Chainlink Convergence 2026
MIT