Skip to content

Latest commit

 

History

History
239 lines (184 loc) · 5.7 KB

File metadata and controls

239 lines (184 loc) · 5.7 KB

DomaScore Quick Start Guide

🚀 Getting Started

This guide will help you quickly set up and start developing DomaScore using the provided templates and Doma Protocol integration.

Prerequisites

  • Node.js 18+ and npm/yarn
  • PostgreSQL or MongoDB for data storage
  • Redis for caching (optional but recommended)
  • Doma API key (get from https://api-testnet.doma.xyz)

Step 1: Project Setup

# Clone the repository
git clone <your-repo>
cd doma-score

# Install frontend dependencies
cd frontend
npm install

# Install backend dependencies (if separate)
cd ../backend
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

Step 2: Database Setup

# PostgreSQL setup
createdb domascope
npm run db:migrate

# Or MongoDB setup
# Ensure MongoDB is running
npm run db:seed # Optional: seed with sample data

Step 3: Initial Development Flow

Option A: Parallel Development (Recommended for Teams)

Terminal 1 - Data Pipeline Developer

# Start with Phase 1.1 from TASKS.md
# Use DEVELOPMENT_PROMPTS.md Prompt 1.1
# Focus on GraphQL client and data fetching
npm run dev:data-pipeline

Terminal 2 - ML Engineer

# Start with Phase 1.3 from TASKS.md
# Use DEVELOPMENT_PROMPTS.md Prompt 1.3
# Build ML models using fetched data
npm run dev:ml

Terminal 3 - Frontend Developer

# Start with Phase 2.2 from TASKS.md
# Use DEVELOPMENT_PROMPTS.md Prompt 2.2
# Build dashboard using frontend template
cd frontend && npm run dev

Option B: Sequential Development (Solo Developer)

  1. Data First: Complete Phase 1.1-1.2 to get data flowing
  2. ML Models: Build basic prediction model (Phase 1.3)
  3. Frontend: Create simple valuation UI (Phase 2.2)
  4. Iterate: Add features incrementally

Step 4: Using the Development Tools

With Claude or AI Assistant

  1. Open DEVELOPMENT_PROMPTS.md
  2. Copy the relevant prompt for your current task
  3. Paste it into Claude/ChatGPT/Cursor
  4. Provide any additional context about your setup
  5. Implement the generated code

Example:

"Using the frontend template in the frontend/ directory, 
[paste Prompt 2.2 here]"

Manual Development

  1. Open TASKS.md
  2. Find your current phase
  3. Check off tasks as you complete them
  4. Refer to the Doma docs for API details

Step 5: Integration Points

Doma Subgraph

// Quick test to verify connection
const SUBGRAPH_URL = 'https://api-testnet.doma.xyz/graphql';

async function testConnection() {
  const query = `{
    names(take: 1) {
      items {
        name
      }
    }
  }`;
  
  const response = await fetch(SUBGRAPH_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ query })
  });
  
  console.log(await response.json());
}

Poll API

// Quick test for real-time events
const POLL_API = 'https://api-testnet.doma.xyz/v1/poll';

async function testPollAPI() {
  const response = await fetch(POLL_API, {
    headers: { 'Api-Key': process.env.DOMA_API_KEY }
  });
  
  console.log(await response.json());
}

Step 6: Key Implementation Order

  1. Minimum Viable Product (MVP)

    • GraphQL client for historical data
    • Basic ML model (even simple linear regression)
    • Single domain valuation endpoint
    • Simple web interface
  2. Enhanced Features

    • Real-time updates via Poll API
    • Advanced ML models
    • Trend detection
    • API for developers
  3. Polish

    • Performance optimization
    • Comprehensive tests
    • Documentation
    • Demo preparation

Step 7: Common Commands

# Development
npm run dev          # Start all services
npm run dev:frontend # Frontend only
npm run dev:api      # API only
npm run dev:worker   # Background jobs

# Testing
npm test            # Run all tests
npm run test:unit   # Unit tests only
npm run test:e2e    # End-to-end tests

# ML Operations
npm run ml:train    # Train models
npm run ml:evaluate # Evaluate model performance
npm run ml:export   # Export model for production

# Data Operations
npm run data:fetch  # Fetch latest data
npm run data:process # Process and feature extraction
npm run data:export # Export for analysis

Step 8: Debugging Tips

GraphQL Issues

  • Check API key is correct
  • Verify endpoint URL (testnet vs mainnet)
  • Use GraphQL playground for testing queries

ML Model Issues

  • Start with simple features (length, TLD)
  • Ensure enough training data (>1000 samples)
  • Check for data preprocessing bugs

Frontend Issues

  • Verify wallet connection setup
  • Check WebSocket connection for real-time updates
  • Use React Developer Tools

Step 9: Demo Checklist

Before your demo, ensure:

  • Sample domains load instantly
  • Valuations show confidence intervals
  • Real-time updates work smoothly
  • API documentation is accessible
  • Portfolio analysis handles 50+ domains
  • Mobile responsive design works

Step 10: Resources

  • Doma Docs: /doma-docs/ in this repo
  • Tasks: TASKS.md for complete task list
  • Prompts: DEVELOPMENT_PROMPTS.md for AI assistance
  • Frontend Components: /frontend/components/ for reusable UI
  • Contract Templates: /contracts/ for any on-chain needs

Need Help?

  1. Check the relevant .md file in /doma-docs/
  2. Look for similar patterns in the template code
  3. Use the prompts with AI assistants
  4. Focus on MVP first, enhance later

🎯 Quick Wins

For a fast demo:

  1. Hardcode some ML predictions to show the UI
  2. Use cached Subgraph data to avoid rate limits
  3. Focus on 1-2 impressive features rather than completeness
  4. Prepare a script with interesting domains to demo

Good luck with your DomaScore development! 🚀