Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update arch diagram in general #344

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions services/image/src/tests/type-endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,17 @@ test('type-endpoint - 200 - json', async () => {
`)
})

test('type-endpoint - 302 - image', async () => {
test('type-endpoint - 200 - image', async () => {
const res = await fetch(
'https://image-beta.w.kodadot.xyz/type/endpoint/https://polkadot-data.s3.us-east-2.amazonaws.com/metadata/nfts-88/nfts-88_collection-img.png',
{ redirect: 'manual' }
)

expect(res.ok).toBe(false)
expect(res.status).toBe(302)
expect(res.ok).toBe(true)
expect(res.status).toBe(200)

const redirectURL = res.headers.get('location')
expect(redirectURL).toBe(
'https://imagedelivery.net/jk5b6spi_m_-9qC4VTnjpg/https---polkadot-data-s3-us-east-2-amazonaws-com-metadata-nfts-88-nfts-88-collection-img-png/public'
)

const res2 = await fetch(redirectURL)
expect(res2.ok).toBe(true)
expect(res2.headers.get('content-type')).toBe('image/png')

const data = await res2.blob()
expect(data).toMatchInlineSnapshot(`
Blob {
Symbol(kHandle): Blob {},
Symbol(kLength): 86717,
Symbol(kType): "image/png",
}
`)
expect(redirectURL).toBe(null)
})

test('type-endpoint - 200 - image - original', async () => {
Expand Down
65 changes: 57 additions & 8 deletions services/ogi-route/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,60 @@ Better alternative implementation:
## Architecture diagram

```mermaid
graph LR;
user --> koda.art
koda.art -- assigned routes --> ogi-route{{ogi-route}}
koda.art -- routes doesn't match --> nft-gallery{{nft-gallery}}
ogi-route --> isbot
isbot -- true --> ogi{{ogi}}
isbot -- false --> nft-gallery
```
graph LR
A[User] --> B[koda.art]
B --> C{ogi-route}
C -->|SEO sensitive paths| D[ogi]
C -->|All other routes| E[nft-gallery]
E -->|For generative art| F[dyndata]
E -->|For generative art| G[fxart]
E -->|NFT & contract info| M[oda]

F -->|Generate| H[Dynamic ID for substrate]
F -->|Generate| I[Dynamic metadata]
F -->|/image| O{Cache exists?}
O -->|Yes| P[Return from R2 bucket]
O -->|No| Q[Capture service]
Q --> R[Store in R2 bucket]
R --> P

G -->|Generate| J[Dynamic ID for substrate]
G -->|Generate| K[Dynamic metadata]
G -->|Schedule| L[Calendar endpoints]

M -->|Unified endpoint| N[Substrate & EVM NFT<br/>and contract details]

style C fill:#f9f,stroke:#333,stroke-width:2px
style D fill:#bbf,stroke:#333,stroke-width:2px
style E fill:#bfb,stroke:#333,stroke-width:2px
style F fill:#fbb,stroke:#333,stroke-width:2px
style G fill:#fbb,stroke:#333,stroke-width:2px
style M fill:#bff,stroke:#333,stroke-width:2px
style O fill:#fcf,stroke:#333,stroke-width:2px
style Q fill:#cff,stroke:#333,stroke-width:2px

classDef note fill:#fff,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
classDef endpoint fill:#ffe,stroke:#333,stroke-width:1px;
classDef storage fill:#ffd,stroke:#333,stroke-width:2px;

N1[SEO sensitive paths<br/>e.g., /gallery, /collection]:::note
N2[Main gallery for<br/>user interactions]:::note
N3[Generative art<br/>components]:::note
N4[Unified NFT &<br/>contract info service]:::note

H:::endpoint
I:::endpoint
J:::endpoint
K:::endpoint
L:::endpoint
N:::endpoint
P:::storage
R:::storage

N1 -.-> C
N2 -.-> E
N3 -.-> F
N3 -.-> G
N4 -.-> M

```