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

Make 'Sites' the default webserver app #867

Merged
merged 24 commits into from
Sep 27, 2024
Merged

Conversation

James-Mart
Copy link
Member

@James-Mart James-Mart commented Sep 26, 2024

Description

This PR makes the Sites app the default server for storing/serving UI artifacts, instead of requiring the same storeSys boilerplate to be used within every app.

Accordingly, both the package infra and psibase CLI tool were updated to call storeSys on sites.

Furthermore, I needed to add a Sites plugin to accommodate the Branding app, which was previously calling its own storeSys action manually.

I removed the storageInterface, WebContentRow, and serveContent as interfaces, since they are no longer needed.

Docs changes

I also updated StorageInterface docs, CLI docs, and package support docs.

Benefits

  • Simpler to write services: 99% of cases it is unnecessary to add the store/serveContent boilerplate to a service.
  • RPC services can now be used exclusively for servicing queries, which makes them read-only and easier to reason about
  • Makes upgrades to UI storage/service easier as it is now centralized. For example it should now be fairly trivial to add gzip compression on all artifacts that use the Sites app.

@James-Mart James-Mart added the Dev Experience Related to the experience of developers label Sep 26, 2024
E -->|no| G{{target begins with '/common'?}} -->|yes| H['common-api' service's serveSys action]
G -->|no| I{{on a subdomain?}} -->|no| 404
I -->|yes| J{{Has registered server?}} -->|no| 404
J -->|yes| L[registered server's serveSys action]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@James-Mart James-Mart marked this pull request as ready for review September 26, 2024 15:51
libraries/psibase/common/include/psibase/webServices.hpp Outdated Show resolved Hide resolved
rust/psibase/src/web_services.rs Outdated Show resolved Hide resolved
rust/test_service_elections/src/lib.rs Show resolved Hide resolved
rust/test_package/query/src/lib.rs Outdated Show resolved Hide resolved
rust/psibase/src/package.rs Show resolved Hide resolved
services/system/HttpServer/src/HttpServer.cpp Outdated Show resolved Hide resolved
services/user/Branding/service/src/lib.rs Outdated Show resolved Hide resolved
@James-Mart James-Mart marked this pull request as draft September 27, 2024 17:12
@James-Mart James-Mart marked this pull request as ready for review September 27, 2024 18:20
@James-Mart James-Mart merged commit 7d40088 into main Sep 27, 2024
4 checks passed
@James-Mart James-Mart deleted the use-sites-for-storesys branch September 27, 2024 21:26
@James-Mart James-Mart changed the title Use sites for storesys Make 'Sites' the default webserver app Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev Experience Related to the experience of developers
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants