An _experimental_ (Read: not-usable or in anyway done) distributed/federated podcasting platform based on [ActivityPub.](https://raw.githubusercontent.com/w3c/activitypub/gh-pages/activitypub-tutorial.txt)
## Usage
Getting started:
Ensure that you're using go11 with go-modules turned on.
```sh
export GO111MODULE=on # Put this in your .zshrc or .bash_profile or whatnot
```
Clone/Download the project with:
```sh
go get git.macaw.me/inhosin/subhub
```
Building a binary with make (or [mmake](https://github.com/tj/mmake) if you're fancy):
```sh
make
```
Building and then running that binary:
```sh
make run
```
Running tests:
```sh
make test
```
Setting up your database (this works best if you have postgres already [running locally](https://postgresapp.com/)):
```sh
make database
```
Creating a new migration in `db/migrations`:
```sh
make migration NAME=some_name_here
```
## Learning about ActivityPub
![explaination](https://i.imgur.com/ShgecWe.png)
### Basic Description
ActivityPub gives every user (or `actor` in it's vocab) on a server an "inbox" and an "outbox". But these are really just endpoints:
```
https://myactpub.site/activity/user/flaque/inbox
https://myactpub.site/activity/user/flaque/outbox
```
ActivityPub asks that you accept `GET` and `POST` requests to these endpoints where a `POST` tells a the server to put that in a user's queue or feed and `GET` lets the user retrieve info from the feed.
You send messages called `ActivityStreams` that are really just a special spec of JSON:
"content": "Say, did you finish reading that book I lent you?"}
```
#### Objects, Actors, and Activities
(**Note:** Pubcast uses a slightly different internal naming than ActivityPub. To have more understandable code in the context of podcasts, ActivityPub's `Organization` actor type is a `Show` inside Pubcast. Additionally, the `Object` type is a Pubcast `Episode`.)
ActivityPub is based on [a formalized vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/) of data types, actions and folks doing the actions.
An `Object` is a generic data type written in JSON:
Objects have [a set collection of formalized properties](https://www.w3.org/TR/activitystreams-vocabulary/#properties) such as `id`, `name`, `url`, etc but you technically can create your own. Objects serve as a base type for other Activity Steam's core set of types.
For example, there are a set of [actor types](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types) that themselves are `Objects`.
[Activities](https://www.w3.org/TR/activitystreams-vocabulary/#h-activity-types) are also subtypes of `Object`, and are used to describe relationships between objects. Some examples of activities include:
- Accept
- Create
- Move
- Question
- Undo
- Follow
- View
An `Activity` json might look something like this: