digraph APIntegration {
  rankdir="TD"
  press[label="api.distributed.press"];
  social[label="social.distributed.press\n(Actor's Inbox)"];
  blog[label="myblog.com"];
  
  publisher [label="Site Publisher";shape="diamond"];
  reader [label="Website Reader"; shape="diamond"];

  generator [label="Static Site Generator\n(e.g. hugo)"];

  activitypub [label="Activitypub JSON Represenation"];
  content [label="HTML Content\n(posts, about page)"]

  dns [label="DNS"]
  p2p [label="P2P\n(IPFS/Hyper/Bittorrent)"]
  gateway [label="Gateway/NGINX"]

  moderation [label="Moderation Queue\n(follows/replies)"]
  
  subgraph ActivityPub {
    APUser [label="ActivityPub Users"; shape="diamond"]
    APServer [label="ActivityPub Server\n(e.g. Mastodon)"]
  }
  
  {rank=same; publisher; reader; APUser;}
  #{rank=same; press; social;}
  
  #publisher -> blog [style="dotted"]
  generator -> blog

  social -> moderation
  publisher -> moderation

  publisher -> generator;
  generator -> press;
  generator -> content;
  
  blog -> activitypub
  blog -> content
  blog -> dns

  reader -> p2p [label="Load HTML"]
  reader -> gateway [label="Load HTML"]
  
  webfinger [label="/.well-known/webfinger"]
  actor [label="ActivityPub Actor\nhttps://myblog.com/username.jsonld"]
  outbox [label="Actor's Outbox/Posts\nhttps://myblog.com/posts.jsonld"]
  
  activitypub -> webfinger [label="Resolve\n@username@domain.com"]
 
  webfinger -> actor [label="Link to Actor JSON"]
  actor -> outbox
  actor -> social [label="Actor Inbox"]

  social -> press [label="Publish replies\n/posts/{postId}/replies.jsonld"]
  social -> generator [label="WebHook for\nNew Replies"]

  dns -> press [label="_dnslink.*"]
  press -> p2p [label="Publish"]
  
  gateway -> p2p [label="Proxy for data"]
  
  gateway -> blog
  APServer -> gateway [label="Load ActivityPub data"]
  APUser -> APServer
  
  APServer -> social [label="Follow Request\nReplies"]
  
  content -> outbox [label="Link to AP\nVersions of posts"]
}
Select a repo