Skip to content

Improved support for modules in Relic #2500

Open

Description

@vlidholt

It would be very useful to be able to add web pages or webhooks to modules. Use cases include authentication and integration with 3rd party services. With the proposed changes in routing (see #2489) this is mostly trivial as the module can simply include any Route. Depending on the use case, the Route can be added directly to the WebServer or to a subroute using a router.

The only issue is how we handle HTML templates and static files, as they may need to be copied into the main project. This could be done by the serverpod generate command. The web directory of the server package could have a sub-directory called modules. When running the generate command, Serverpod would copy the files from each module's web directory (e.g., my_module_server/web) into the main projects modules directory (e.g., web/modules/my_module).

A server Widget located in a module would refer to its template as normal but with an added module property set.

class MyWidget extends Widget {
  DefaultPageWidget() : super(
    name: 'my_template',
    module: 'my_module',
  ) {
    values = {
      'served': DateTime.now(),
      'runmode': Serverpod.instance.runMode,
 };
 }
}

Activity

  1. added
    enhancement
    on Jul 18, 2024
  2. added
    area: web server
    on Aug 29, 2024
  3. moved this to Later 🥳 in Serverpod Frameworkson Mar 5, 2025
  4. moved this to Later 🥳 in Serverpod Frameworkson Jun 16, 2025
  5. moved this from Later 🥳 to Next 🌟 in Serverpod Frameworkson Jun 16, 2025
  6. moved this from Next Up 🎯 to Planned 🔭 in Serverpod Frameworkson Jul 31, 2025
  7. moved this from Planned 🔭 to Backlog 🗂️ in Serverpod Frameworkson Jul 31, 2025
  8. SandPod commented on Oct 6, 2025

    @SandPod
    Contributor

    Disconnecting from the web server RFC since this will be implemented at a later stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: web serverenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions