Skip to content

rockstarallegue/pathos-api

Repository files navigation

da_header

DESIGN DOCUMENT: The bridges from the pathchain to the user interface

🐬 MySQL ⛁ relational database connection to the 🖇 pathchain

This design document explains the relational database structure on how the pathchain is connected to the user interface features. It is very helpful to look at in order to understand the recursive properties of the tracking nature of pathos.cloud.

This is the seed for the primal feature of ☁ pathos.cloud that is a user posting a path.

Important stablishments

☁ pathos.cloud ::= It is a tool to build paths of data and knowledge that are cryptographically secured by being tied into healthy backtracking-able origin chains. This tool is currently a web application where path-crafting is done manually.

⛁ relational database ::= ⛁ RDB ::= 🐬 MySQL relational database that stores the pointers to the 🖇 pathchain hashes and holds a minimalistic table infrastructure to manage the login and posting features for the user interface.

🖇 pathchain ::= The pathchain is the abstract representation of the digital trees of knowledge on ☁ pathos.cloud.


The tables of the ⛁ RDB

This a representation on how the active entites on the system relate to each other (an entity-relationship model of the RDB).

er

The active tables' references: entity 👾, user 👤, node, path, label, link, skeleton, post, action 🕹️.


☁ pathos.cloud API REST TABLE DOCUMENTATION:

entity 👾

Entities are the ones who post on pathos.cloud. They can be human users, human user extensions, organizations of humans or bots

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `secret_id` varchar(64) NOT NULL,
  `type_id` varchar(64) NOT NULL

Relationships

The entity.ancestor_id field requires an existing entity record.

The entity.type_id field requires an existing entity type record.

The entity.secret_id field requires an existing secret record.

entity_type

This is a Type seeder table that serves as a catalogue for entity types

Types: USER, BOT, ORGANIZATION, COMMUNITY

secret 🔑

Secrets are hashes that represent unique tokens to perform actions at several layers on the pathchain.

SQL Definition

  `id` varchar(64) NOT NULL,
  `owner_id` varchar(64) NOT NULL,
  `password` varchar(255),
  `receiver_id` varchar(64),
  `type_id` INT NOT NULL,
  `used` varchar(64)

Relationships

The secret.owner_id field requires an existing entity record.

The secret.receiver_id field requires an existing entity record.

The secret.type_id field requires an existing secret record.

secret_type

This is a Type seeder table that serves as a catalogue for entity types

Types: INVITE_SECRET, TOKEN

user 👤

The user tables keep the record to manage the login process while taking care of the integrity of the user related to the entity chain on the patchain.

SQL Definition

`id` varchar(64) NOT NULL,
`entity_id` varchar(64) NOT NULL,
`login` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL

Relationships

The user.entity_id field requires an existing entity record.

node

Nodes are the prime elements of paths.

Node representation

node

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `owner_id` varchar(64) NOT NULL

Relationships:

The node.ancestor_id field requires a existing node record.

The node.owner_id field requires an existing entity record.

label

Labels are the classification elements of the pathchain.

Single label representation

label

Labels can classify each other recursively. This feature allows a multi-dimensional classification structure for paths. Label relevance depends on context and how users rank them.

Nested label representation

nested_label

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `name` varchar(255) DEFAULT '',
  `owner_id` varchar(64) NOT NULL

Relationships:

The label.ancestor field requires an exisging label record.

The label.owner field requires an existing entity record.

path

Linear path representation

The first node with the red dot is the head of the path

path

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `head_id` varchar(64) NOT NULL,
  `owner_id` varchar(64) NOT NULL

Relationships:

The path.ancestor_id field requires an existing path record.

The path.head_id field requires an existing link record.

The path.owner_id field requires an existing entity record.

The links

Links are the representation of all the bonds inside the pathchain. The pathchain can be described as a tree with labels.

The tree is just a path of bonded paths. Paths come from bonded nodes that can be bonded to paths and paths of bonded paths.

All links look the same in SQL structure:

  `id` varchar(64) NOT NULL,
  `next_id` varchar(64) NOT NULL,
  `prev_id` varchar(64) NOT NULL,
  `target_id` varchar(64) NOT NULL,
  `type_id` varchar(64) NOT NULL

Relationships:

The link.next_id field requires a link. When the link is the last element of a path, link.next_id should point to the link.id itself.

The link.prev_id field requires a link. When the link is the head of a path, link.prev_id should point to the link.id itself.

The link.target_id field requires a path, node or label field.

The links limits

This is how paths of any dimension can be built through link connections using the links

nodenode link representation

node__node

nodepath link representation

node__path

nodepath of paths link representation

node__path_of_paths

nodepath of paths of paths link representation

node__monster

pathpath link representation

path__path

path of pathspath of paths link representation

monster__path

Labels

labellabel link representation

label__label

labelnode link representation

label__node

labelpath link representation

label__path

labelpath of paths link representation

label__monster

skeleton

Skeletons are a pair of paths, one of labels and another one of nodes and paths. Skeletons are dictionaries of data structures where the labels define the meaning for who are using them.

Skeleton representation

skeleton

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `name` varchar(255) DEFAULT '',
  `keys_head_id` varchar(64) NOT NULL,
  `vals_head_id` varchar(64) NOT NULL,
  `owner_id` varchar(64) NOT NULL

Relationships:

The skeleton.ancestor_id field requires an existing skeleton record.

The skeleton.keys_head_id field requires an existing path record.

The skeleton.keys_vals_id field requires an existing path record.

The skeleton.owner_id field requires an existing entity record.

post

Posts are elements that hold nodes and paths. They are posted by entities and they allow other users to interact with them and also branch or mirror content into new connected posts coming from them.

SQL definition:

  `id` varchar(64) NOT NULL,
  `ancestor_id` varchar(64) NOT NULL,
  `target_id` varchar(64) NOT NULL,
  `title` varchar(255) DEFAULT '',
  `owner_id` varchar(64) NOT NULL

Relationships:

The post.ancestor_id field requires an existing post record.

The post.target_id field requires an existing link or node record.

The path.owner_id field requires an existing entity record.

action 🕹️

Actions are performed by entities in relationships with posts. They could be understood better by assuming the preffix "to" to them in relationship with a post c:

SQL Definition

  `id` varchar(64) NOT NULL,
  `message` varchar(255) DEFAULT '',
  `moment` varchar(255) DEFAULT '',
  `owner_id` varchar(64) NOT NULL,
  `post_id` varchar(64) NOT NULL,
  `type_id` INT NOT NULL

Relationships

The action.owner_id field requires an existing entity record.

The action.post_id field requires an existing post record.

The action.type_id field requires an existing action type record.

action_type

This is a Type seeder table that serves as a catalogue for entity types

Types: SHARE, HOLD, OWN, CREATE, INTERACT, CONNECT, LABEL

connection 🔌

A connection connects one post with another

SQL Definition

  `id` varchar(64) NOT NULL,
  `action_id` varchar(64) NOT NULL,
  `message` varchar(255) DEFAULT '',
  `post_id` varchar(64) NOT NULL,
  `type_id` INT NOT NULL

Relationships

The connection.action_id field requires an existing action record.

The connection.post_id field requires an existing post record.

The connection.type_id field requires an existing connection type record.

connection_type

This is a Type seeder table that serves as a catalogue for entity types

Types: CONNECTION, REFLECTION, MUTATION

interaction ⏫

Measurable things user do with posts

SQL Definition

  `id` varchar(64) NOT NULL,
  `action_id` varchar(64) NOT NULL,
  `message` varchar(255) DEFAULT '',
  `references_id` varchar(64),
  `type_id` INT NOT NULL,
  `value` varchar(255) DEFAULT ''

Relationships

The interaction.action_id field requires an existing action record.

The interaction.references_id field requires an existing skeleton record.

The interaction.type_id field requires an existing interaction type record.

interaction_type

This is a Type seeder table that serves as a catalogue for entity types

Types: COMMENT, VOTE_UP, VOTE_DOWN, ⚡

type

The type tables & their seeders

These tables contain the minimum expression to represent the "do-able" things in pathos.cloud. They're the minimum catalog of types for the system to operate with a login and a posting platform behaviour. The seeders are pretty self-explaining for the kind of information that they're supposed to label. Altough the labels do exist in pathos.cloud, this is an attempt to cut down a lot of redundancies that will cause a lot of problems.

All of the following tables share the following structure described in SQL:

`id` integer(64) NOT NULL,
`name` varchar(64) NOT NULL

APPENDIX: CLASS DIAGRAM & RDB

UML CLASS DIAGRAM UML_TEXTURIZED


Public Endpoints

Endpoint

http://pathos.cloud/secrets/pioneer/

Response

{
    "message": "GET PIONEER SECRET",
    "pioneer": {
        "birthday": "moments/18fe44feca315e346964887a21364f71943153cb76b66a0aebf9b1d02cdc736f",
        "register": "moments/bb37cc06cdaf8f393bfbe18db68a7f95d04d6ed9edeaddfc85db8ac8cf39873c",
        "invite": "users/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4",
        "tag": "users/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4"
    },
    "results": {
        "register": "moments/7d4d3131fcd20e606090d91f3bdc0d4831798e6af24001ee25dcac8a6426a50c",
        "author": "pioneer/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4",
        "used": false,
        "tag": "secrets/4acda9de3b4720ecf504f7661f2ce47180226af4380a40507eea0e2a37012ed0"
    }
}

Login Endpoints

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages