export const metadata = {
    title: 'Follow',
    description: 'The Follow entity allows users to subscribe to each other',
}

# Follow

Sometimes, [Users](/entities/user) want to subscribe to each other to see each other's content. The `Follow` entity facilitates this, by definining a subscription relationship between two users. {{ className: 'lead' }}

## Vocabulary

- **Follower**: The user who is subscribing to another user. If `Joe` is following `Alice`, `Joe` is the follower.
- **Followee**: The user who is being subscribed to. If `Joe` is following `Alice`, `Alice` is the followee.
- **Subscribing**: Identical to **Following**. The act of subscribing to another user's content.

## Usage

Consider the following example:

`Joe`, a user on `social.joe.org`, wants to follow `Alice`, a user on `alice.dev`.

### Sending a Follow Request

To establish a follow relationship, `social.joe.org` can do the following:

1. Create a `Follow` entity with `Joe` as the author and `Alice` as the followee.
2. Send the `Follow` entity to `Alice`'s inbox.
3. Mark the relationship as "processing" in its database until `Alice` accepts the follow request.

### Accepting the Follow Request

To accept the follow request, `Alice` can do the following:

1. Create a [FollowAccept](/entities/follow-accept) entity with `Alice` as the author and `Joe` as the follower.
2. Send the `FollowAccept` entity to `Joe`'s inbox.

### Rejecting the Follow Request

To reject the follow request, `Alice` can do the following:

1. Create a [FollowReject](/entities/follow-reject) entity with `Alice` as the author and `Joe` as the follower.
2. Send the `FollowReject` entity to `Joe`'s inbox.

### Final Steps

Depending on whether the follow request is accepted or rejected, `social.joe.org` can then update the relationship status accordingly in its database.

## Behaviour

Once a follow relationship is established, the **followee**'s instance should send all new notes from the **followee** to the **follower**'s inbox.

## Entity Definition

<Row>
    <Col>
        <Properties>
            <Property name="uri" type="null" required={false}>
                This entity does not have a URI.
            </Property>
            <Property name="author" type="URI" required={true} typeLink="/types#uri">
                URI of the `User` considered the 'follower'.
            </Property>
            <Property name="followee" type="URI" required={true} typeLink="/types#uri">
                URI of the `User` that is being followed.
            </Property>
        </Properties>
    </Col>

    <Col sticky>
    
    ```jsonc {{ title: 'Example Follow' }}
    {
        "type": "Follow",
        "id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
        "author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
        "created_at": "2021-01-01T00:00:00.000Z",
        "followee": "https://example.com/users/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
    }
    ```
    
    </Col>
</Row>

## Graph

<p>
    <a href="/graphs/how-follows-work.svg" target="_blank">View the full-size graph</a>
</p>

<div className="bg-zinc-800 rounded border border-zinc-900/5 dark:border-white/5 p-4">
    <img src="/graphs/how-follows-work.svg" alt="How Follows Work" className="w-full" />
</div>
