Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dagit-server - Community Forum Server

License

A Go server that indexes dagit posts from IPFS, supports moderation via stamps, and serves curated feeds per community. Single binary, handles many users.

Architecture

dagit (pydagit)     Protocol library (Python)
       ↓ publishes posts to IPFS
dagit-server        Indexes, moderates, serves feeds (Go)
       ↓ provides feeds to
memex               Client workstation (Python)

Posts are signed with Ed25519 keys (did:key identities), stored on IPFS, and submitted to dagit-server by CID. The server verifies signatures, indexes content in SQLite with full-text search, and filters feeds through moderator stamps.

Quick Start

# Build
go build ./cmd/dagit-server

# Run (requires IPFS daemon on localhost:5001)
./dagit-server
# Server runs on http://localhost:5000

Environment Variables

Variable Default Description
PORT 5000 HTTP listen port
DAGIT_DB dagit_server.db SQLite database path
IPFS_API http://localhost:5001/api/v0 IPFS HTTP API URL

API

Health Check

curl localhost:5000/health

Submit a Post

Submit a CID to fetch from IPFS, verify its signature, and index it:

curl -X POST localhost:5000/api/submit \
  -H 'Content-Type: application/json' \
  -d '{"cid":"QmYourPostCID..."}'

Feed (Approved Posts)

Get posts that moderators have stamped for a community tag:

curl 'localhost:5000/api/feed?tag=science&limit=20'

Pending Posts

Posts awaiting moderation:

curl 'localhost:5000/api/pending?tag=science'

Get Post

curl localhost:5000/api/post/{cid}

Search

Full-text search across post content and tags:

curl 'localhost:5000/api/search?q=quantum+computing'

Moderators

# Register a moderator
curl -X POST localhost:5000/api/moderators \
  -H 'Content-Type: application/json' \
  -d '{"did":"did:key:z6Mk...","tag":"science"}'

# List moderators for a tag
curl 'localhost:5000/api/moderators?tag=science'

Moderation Flow

  1. A user publishes a post via dagit (Python) to IPFS
  2. The CID is submitted to dagit-server via POST /api/submit
  3. The server fetches the post from IPFS, verifies the Ed25519 signature, and indexes it
  4. The post appears in GET /api/pending?tag=...
  5. A moderator publishes a stamp post (type: "stamp", refs: [post CID], tags: [community])
  6. The stamp CID is submitted to dagit-server
  7. The server verifies the stamp, checks the author is a registered moderator, and records the approval
  8. The original post now appears in GET /api/feed?tag=...

Project Structure

cmd/dagit-server/main.go       Entry point, config, router, graceful shutdown
internal/
  api/handlers.go               HTTP handlers (8 endpoints)
  dagit/types.go                Post struct, protocol constants
  dagit/did.go                  DID decoding (base58btc → Ed25519)
  dagit/verify.go               Signature verification
  db/schema.go                  SQLite DDL, indexes, FTS5
  db/sqlite.go                  Query functions
  ingest/ingest.go              Fetch, verify, classify, index
  ipfs/client.go                IPFS HTTP API client

License

BSD 3-Clause License. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages