Skip to content

Commit

Permalink
Fix specs doc link
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAcollision committed Nov 27, 2024
1 parent 05deabe commit 0506f38
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Pubky.app Data Model Specification

*Version 0.2.0*
_Version 0.2.0_

## Introduction

This document specifies the data models and validation rules for the Pubky.app client and homeserver interactions. It defines the structures of data entities, their properties, and the validation rules to ensure data integrity and consistency. This specification is intended for developers who wish to implement their own libraries or clients compatible with Pubky.app.

This document intents to be a faithful representation of our [Rust pubky.app models](https://github.com/pubky/pubky-nexus/tree/main/src/models/pubky_app). If you intend to develop in Rust, use them directly. In case of disagreement between this document and the Rust implementation, the Rust implementation prevails.
This document intents to be a faithful representation of our [Rust pubky.app models](https://github.com/pubky/pubky-app-specs/tree/main/src). If you intend to develop in Rust, use them directly. In case of disagreement between this document and the Rust implementation, the Rust implementation prevails.

## Data Models

Expand All @@ -32,17 +32,21 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Validation Rules:**

- **`name`:**

- Must be at least **3** and at most **50** characters.
- Cannot be the keyword `[DELETED]`; this is reserved for deleted profiles.

- **`bio`:**

- Maximum length of **160** characters if provided.

- **`image`:**

- If provided, must be a valid URL.
- Maximum length of **300** characters.

- **`links`:**

- Maximum of **5** links.
- Each `UserLink` must have:
- `title`: Maximum length of **100** characters.
Expand Down Expand Up @@ -70,6 +74,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Validation Rules:**

- **ID Validation:**

- The `file_id` in the URI must be a valid **Timestamp ID** (see [ID Generation](#id-generation)).

- **Additional Validation:**
Expand All @@ -87,6 +92,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod

- `content` (string, required): The content of the post.
- `kind` (string, required): The type of post. Possible values are:

- `Short`
- `Long`
- `Image`
Expand All @@ -106,9 +112,11 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Validation Rules:**

- **ID Validation:**

- The `post_id` in the URI must be a valid **Timestamp ID** (see [ID Generation](#id-generation)).

- **`content`:**

- Must not be the keyword `[DELETED]`; this is reserved for deleted posts.
- **For `kind` of `Short`:**
- Maximum length of **1000** characters.
Expand All @@ -118,9 +126,11 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
- Maximum length of **1000** characters.

- **`parent`:**

- If provided, must be a valid URI.

- **`embed`:**

- If provided:
- `uri` must be a valid URI.

Expand All @@ -144,9 +154,11 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Validation Rules:**

- **ID Validation:**

- The `tag_id` in the URI must be a valid **Hash ID** generated from the `uri` and `label` (see [ID Generation](#id-generation)).

- **`uri`:**

- Must be a valid URI.

- **`label`:**
Expand All @@ -169,6 +181,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Validation Rules:**

- **ID Validation:**

- The `bookmark_id` in the URI must be a valid **Hash ID** generated from the `uri` (see [ID Generation](#id-generation)).

- **`uri`:**
Expand Down Expand Up @@ -217,6 +230,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
#### IDs

- **Timestamp IDs**: IDs generated based on the current timestamp, encoded in Crockford Base32.

- Must be **13** characters long.
- Decoded ID must represent a valid timestamp after **October 1st, 2024**.
- Timestamp must not be more than **2 hours** in the future.
Expand Down Expand Up @@ -245,7 +259,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
- Converted to lowercase.
- Maximum length of 20 characters.

---
---

### PubkyAppFeed

Expand All @@ -256,6 +270,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
**Fields:**

- `feed` (object, required): The main configuration object for the feed.

- `tags` (array of strings, optional): Tags used to filter content within the feed.
- `reach` (string, required): Defines the visibility or scope of the feed. Possible values are:
- `following`: Content from followed users.
Expand Down Expand Up @@ -360,6 +375,7 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
"status": "Exploring the decentralized web."
}
```

### Example of PubkyAppPost

```json
Expand All @@ -383,10 +399,11 @@ This document intents to be a faithful representation of our [Rust pubky.app mod
```

## Notes

- All timestamps are Unix epoch times in seconds.
- Developers should ensure that all validation rules are enforced to maintain data integrity and interoperability between clients.
- This specification may be updated in future versions to include additional fields or validation rules.

## License
This specification is released under the MIT License.

This specification is released under the MIT License.

0 comments on commit 0506f38

Please sign in to comment.