Skip to content
Snippets Groups Projects
Commit 8f7d640e authored by Tarje.Lavik's avatar Tarje.Lavik
Browse files

Add preview documentation

parent c254d26e
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
This diff is collapsed.
......@@ -17,7 +17,7 @@ LAYOUT_WITH_LEGEND()
title Component diagram for Sanity Studio
Container(spa, "Sanity Studio SPA", "Javascript and React", "Provides all editing functionality to editors via their web browser.")
Container(spa, "Sanity Studio SPA", "Javascript and React", "Provides all editing functionality to editors via their web browser.", SANITY)
ContainerDb_Ext(sanity_db, "Sanity Cloud Storage", "Google Cloud", "Stores metadata and files.", "SANITY")
Container_Ext(auth, "Google Authentication", "Google Cloud", "Authenticates editors.", "google_cloud_platform")
......@@ -28,16 +28,34 @@ System_Ext(nb, "NB.no", "Content provider")
Container_Boundary(api, "SPA Application", "SANITY") {
Component(sign, "Sign In Controller", "React", "Allows users to sign in to the Studio.")
Component(import_tool, "Import tool", "React", "Plugin for importing external resources into the Studio.")
Component(preview, "Desk preview", "React", "Preview tab addition to desk forms.")
Component(resolveProductionUrl, "resolveProductionUrl", "React", "Sends correct id to preview api along with secret.")
Rel(import_tool, sanity_db, "Uses")
Rel(preview, resolveProductionUrl, "Uses")
Rel(sign, auth, "Uses", "JSON/HTTPS")
}
Container_Boundary(next, "Next app", "", NEXT) {
Container_Boundary(app, "Preview fetch") {
Component(overlay, "/*", "Route", "Serves static page.")
}
Container_Boundary(next_api, "Server side API") {
Component(api_preview, "/api/preview?token=[]&slug=[]", "Route", "Validates token and sets preview variable to true")
Component(api_exit_preview, "/api/exit-preview", "Route", "Sets preview variable to false")
}
Rel_R(api_preview, overlay, "Redirects", "JSON/HTTPS")
Rel_U(overlay, preview, "Streams changes", "JSON/HTTPS")
}
Rel_D(import_tool, marcus, "Imports", "HTTPS")
Rel_D(import_tool, kulturnav, "Imports", "HTTPS")
Rel_D(import_tool, nb, "Imports", "HTTPS")
Rel_L(spa, sanity_db, "Uses", "JSON/HTTPS")
Rel_D(spa, api, "Uses", "JSON/HTTPS")
Rel(sign, auth, "Uses", "JSON/HTTPS")
Rel_U(import_tool, marcus, "Imports", "HTTPS")
Rel_U(import_tool, kulturnav, "Imports", "HTTPS")
Rel_U(import_tool, nb, "Imports", "HTTPS")
Rel_R(spa, sanity_db, "Uses", "JSON/HTTPS")
Rel_D(overlay, sanity_db, "Uses", "JSON/HTTPS")
Rel_R(resolveProductionUrl, api_preview, "Uses", "JSON/HTTPS")
Rel_U(spa, api, "Uses", "JSON/HTTPS")
@enduml
\ No newline at end of file
......@@ -33,11 +33,20 @@ Container_Boundary(next, "Next app", "", NEXT) {
Container_Boundary(api, "Server side API") {
Component(api_manifest, "/api/manifest/[id]", "Route", "Fetch basic metadata and connected images by id from Sanity DB")
}
Container_Boundary(components, "Components") {
Component(mirador_viewer, "/miradorViewer", "React", "Fetch basic metadata and connected images by id from Sanity DB")
}
Container_Boundary(functions, "Functions") {
Component(getStaticProps, "getStaticProps", "function", "Static Generation: Fetch data at build time.")
Component(getStaticPaths, "getStaticPaths", "function", "Static Generation: Specify dynamic routes to pre-render pages based on data.")
Component(getServerSideProps, "getServerSideProps", "function", "Server-side Rendering: Fetch data on each request.")
}
Rel_D(app, components, "Uses", "JSON/HTTPS")
Rel_R(app, getStaticPaths, "Lists paths to generate", "JSON/HTTPS")
Rel_D(getStaticPaths, getStaticProps, "Builds static page", "JSON/HTTPS")
Rel_D(id, mirador_viewer, "Uses", "JSON/HTTPS")
Rel_D(mirador_viewer, api_manifest, "Uses", "JSON/HTTPS")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment