Skip to content

Latest commit

 

History

History
147 lines (101 loc) · 3.18 KB

File metadata and controls

147 lines (101 loc) · 3.18 KB

Contributing to OpenDrip

Thanks for your interest in contributing. This document covers how to set up the project, the codebase structure, and the process for submitting changes.


Setup

Prerequisites

  • Node.js 18+
  • A GitHub personal access token (read-only repo scope)
  • A Stellar testnet account

Install

git clone https://github.com/Darkdruce/OpenDrip-
cd OpenDrip-
npm install

Configure

cp config/.env.example config/.env

Fill in config/.env:

GITHUB_TOKEN=your_github_token
STELLAR_SECRET=your_stellar_secret_key
STELLAR_NETWORK=testnet

Run locally

npm run dev

This starts both the API (localhost:3001) and the web dashboard (localhost:3000).


Project Structure

Each concern lives in its own package under packages/. The API in apps/api imports from these packages directly via relative paths.

packages/
  stellar/      — Stellar SDK wrappers (wallet, payments, transactions)
  drips/        — Drips pool and stream management
  github/       — GitHub API integration (metrics, contributors)
  payments/     — Distribution engine and treasury
  reputation/   — Scoring algorithm

apps/
  api/          — Express REST API
  web/          — Next.js dashboard

Making Changes

Adding a new scoring weight

Edit packages/reputation/index.ts:

const WEIGHTS = {
  commits: 1,
  mergedPRs: 3,
  issuesResolved: 2,
  docsContributions: 1.5,
  // add new metric here
};

Also update ContributorMetrics interface and the GitHub fetch logic in packages/github/contributors.ts.

Adding a new API route

  1. Create a file in apps/api/src/routes/yourroute.ts
  2. Export a default Express Router
  3. Register it in apps/api/src/index.ts:
import yourRouter from "./routes/yourroute";
app.use("/your-path", yourRouter);

Adding a new package

  1. Create a folder under packages/yourpackage/
  2. Add an index.ts that exports the public API
  3. Import it in other packages or routes using a relative path

Type Checking

./node_modules/.bin/tsc --noEmit

This checks all packages and the API. The web app has its own tsconfig.json and is checked separately by Next.js.


Tests

Tests live in tests/unit/ and tests/integration/. They are plain TypeScript files that can be run with ts-node:

npx ts-node tests/unit/scoring.test.ts
npx ts-node tests/integration/pools.test.ts

When adding new logic, add a corresponding test file.


Pull Request Guidelines

  • Keep PRs focused — one feature or fix per PR
  • Run tsc --noEmit before submitting — no type errors
  • Update relevant docs if you change API behaviour or scoring logic
  • Use clear commit messages: feat:, fix:, docs:, refactor:

Roadmap Items Open for Contribution

Item Difficulty
Drips on-chain stream integration Hard
Sponsor deposit dashboard Medium
Per-second payout streaming Hard
Multi-repo contributor aggregation Medium
DAO governance for weight config Hard
AI-based contribution analysis Medium
Cross-chain funding pools Hard

Pick one, open an issue to discuss the approach, then submit a PR.