Skip to content

Commit

Permalink
feat: Adding EndUser, User and Organization to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Nov 19, 2023
1 parent 4061a49 commit a610284
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/images/models.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 30 additions & 4 deletions docs/models.prisma
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Used for creating visualizations of the schema via https://prismaliser.app/
// and https://prisma-erd.simonknott.de/
model Connector {
id String @id
type ConnectorType
Expand All @@ -21,10 +22,12 @@ model Provider {
}

model ConnectorConfig {
id String @id
connector Connector @relation(fields: [connector_id], references: [id])
connector_id String
resources Resource[]
id String @id
connector Connector @relation(fields: [connector_id], references: [id])
connector_id String
resources Resource[]
Organization Organization? @relation(fields: [organizationId], references: [id])
organizationId String?
}

model Resource {
Expand All @@ -35,6 +38,8 @@ model Resource {
connector_config_id String
pipeline_sources Pipeline[] @relation(name: "source")
pipeline_destinations Pipeline[] @relation(name: "destination")
end_user EndUser? @relation(fields: [end_user_id], references: [id])
end_user_id String?
}

model Pipeline {
Expand All @@ -49,3 +54,24 @@ enum ConnectorType {
Direct
Aggregator
}

model EndUser {
id String @id
resources Resource[]
Organization Organization? @relation(fields: [organizationId], references: [id])
organizationId String?
}

model Organization {
id String @id
apikey String
end_users EndUser[]
members User[]
connector_configs ConnectorConfig[]
}

model User {
id String @id
Organization Organization? @relation(fields: [organizationId], references: [id])
organizationId String?
}
27 changes: 14 additions & 13 deletions docs/technical/nomenclature.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ used throughout the documentation and code base.
To that end, here's a list of what our primitives are and examples of how you
can think of them in use.

## Lexicon

Used in a sentence:
A <strong>Pipeline</strong> simply connects a data <strong>Resource</strong> to/from Venice which transmits data across the <strong>Pipeline</strong> protocol, storing any data in Venice's unified <strong>Database</strong> and making it available via an <strong>API</strong>.
![Visualized using Prisma model](../images/models.svg)

| Term | Description | Created by |
| :-------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| <strong>Provider</strong> | A product or service that your customers use (e.g. **Chase**, **Quickbooks**). This is a concept we may reference in docs / user interface but does not yet exist as an actual entity in the Venice API / Database. | N/A |
| <strong>Connector</strong> | Source code adhering to the <string>Venice Protocol</string>, can be a direct connector (e.g. **Quickbooks**) which provides a single `Integration` or an aggregator connector (e.g. **Plaid**) that provides many `Integration`'s | Venice Repo |
| <strong>Integration</strong> | An integration represents a `Provider` supported by a `Connector`. There can be multiple integrations for a single provider if multiple connectors support the same provider (e.g. Merge and Railz both gives you the ability to connect to Quickbooks, in addition we have a direct Quickbooks connector for a total of 3 Quickbooks Integrations). | Venice Connector |
| <strong>Connector Config</strong> | A specific configuration of a <strong>Connector</strong>. Contains developer account credentials (e.g. `client_id`, `client_secret`), and misc configs (`sandbox` vs. `production`). Some connectors does not require configuration (e.g. **Postgres**). In the future can also contain sync settings (e.g. Automatically sync all Plaid items using this config to our main postgres Resource). | Developer (You) |
| <strong>Resource</strong> | Associated with a specific `Connector Config`. Contains customer credentials (e.g. `access_token`) and gives you the ability to call `Provider` APIs. Resource can also be used as either a <strong>Source</strong> or <strong>Destination</strong> within a <strong>Pipeline</strong> | End User (Your customer) |
| <strong>Pipeline</strong> | Pipeline moves data from a <strong>Source</strong> to a <strong>Destination</strong> and contains persistent state used for incremental syncs. | Developer (You) |
| Term | Description | Created by |
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
| <strong>Organization</strong> | An isolated Venice workspace with its own `Connector Config`s, `End User`'s and `User`s | Developer (You) |
| <strong>User</strong> | A developer using Venice to deliver great experiences! May belong to multiple `Organization`s. | Developer (You) |
| <strong>End User</strong> | A customer of yours gives you access to their `Resource` as part of using your product. | Developer (You) |
| <strong>Provider</strong> | A product or service that your customers use (e.g. **Chase**, **Quickbooks**). This is a concept we may reference in docs / user interface but does not yet exist as an actual entity in the Venice API / Database. | N/A |
| <strong>Connector</strong> | Source code adhering to the <string>Venice Protocol</string>, can be a direct connector (e.g. **Quickbooks**) which provides a single `Integration` or an aggregator connector (e.g. **Plaid**) that provides many `Integration`'s | Venice Repo |
| <strong>Integration</strong> | An integration represents a `Provider` supported by a `Connector`. There can be multiple integrations for a single provider if multiple connectors support the same provider (e.g. Merge and Railz both gives you the ability to connect to Quickbooks, in addition we have a direct Quickbooks connector for a total of 3 Quickbooks Integrations). | Venice Connector |
| <strong>Connector Config</strong> | A specific configuration of a <strong>Connector</strong>. Contains developer account credentials (e.g. `client_id`, `client_secret`), and misc configs (`sandbox` vs. `production`). Some connectors does not require configuration (e.g. **Postgres**). In the future can also contain sync settings (e.g. Automatically sync all Plaid items using this config to our main postgres Resource). | Developer (You) |
| <strong>Resource</strong> | Associated with a specific `Connector Config`. Contains customer credentials (e.g. `access_token`) and gives you the ability to call `Provider` APIs. Typically created by an `End User` but could also created by you in the dashboard (which then belongs to your organization). Resource can also be used as either a <strong>Source</strong> or <strong>Destination</strong> within a <strong>Pipeline</strong> | End User (Your customer) |
| <strong>Pipeline</strong> | Pipeline moves data from a <strong>Source</strong> to a <strong>Destination</strong> and contains persistent state used for incremental syncs. | Developer (You) |

When we say "connect" in the user interface, we mean invoking a connector to create a resource.

![Visualized using Prisma model](../images/models.svg)
Used in a sentence:
A <strong>Pipeline</strong> simply connects a data <strong>Resource</strong> to/from Venice which transmits data across the <strong>Venice</strong> protocol.

{/* Maybe we should support wikilinks if we want to really define nomenclature well */}

Expand Down

0 comments on commit a610284

Please sign in to comment.