Skip to content

Hello World: the example module and what each of its pages shows

Describes Hello World 0.4.0.

Hello World is the example module for developers who build their own PhoenixKit modules. It has no business use: every page shows one part of the module system working, so you can see it live and copy the pattern.

Where to find it

Turn it on under Modules in the admin, then open Hello World in the Modules section of the sidebar (/admin/hello-world). Its pages appear under it: Overview, Events, Components and Notifications.

To see it, a role needs the Hello World permission in the roles and permissions matrix. The module also adds one sub-permission there, Moderate, which only unlocks one extra button on the Overview page.

The Hello World Plugin page: badges for what it shows, the activity logging demo, module info, the current user, and Explore the showcase The Hello World Plugin page: badges for what it shows, the activity logging demo, module info, the current user, and Explore the showcase

The example module's overview.

Overview

The Hello World Plugin card confirms the module is wired in: Auto-discovery, Routing, Permissions, Admin layout, Sidebar tab and Activity logging.

Activity Logging Demo writes entries to the activity log:

  • Log demo event: logs one event and shows “Event logged — check the Events tab!”. The time appears next to the buttons as Last logged at.
  • Log moderation event: shown only to roles that have the Moderate sub-permission while the module is on. Without it, the page says where the button would be.
  • Show the code pattern: opens the code that logs the event.

Module Info lists the module’s name, key, version and whether it is enabled. Current User shows your email and roles and three checks: Admin?, Module access? and Can moderate?. Use it to test what a role can do.

Explore the showcase links to the Events feed and the Components showcase. Next Steps lists the files a developer edits when turning this into their own module.

Events

A feed of everything the module logged: the Overview buttons and the Notifications demo. The Action menu filters by action (All Actions shows everything), Clear removes the filter, and the count on the right says how many events match. Each entry shows who did it (or System) and how long ago; its View details link opens the entry in the core activity log. Older entries load as you reach the end of the list.

With nothing logged yet, the page says No events recorded yet and points you back to Log demo event.

Components

A live catalogue of the components PhoenixKit offers to module pages: icons, badges, buttons, alerts, form inputs, tables, pagination, empty and loading states, modals, a popover, bulk selection, a search picker, a draggable list, charts and date navigation, each with the code to copy. The top half is plain daisyUI markup; below PhoenixKit Core Components come the PhoenixKit components themselves. Forms and buttons on this page only change the demo on screen.

The Hello World components showcase: icons, badges, buttons and alerts, each with Show snippet The Hello World components showcase: icons, badges, buttons and alerts, each with Show snippet

Components: the admin's building blocks with their code.

Notifications

Shows how a module sends notifications to a user’s inbox bell.

  • Send a notification: sends you a plain notification.
  • Send with custom display: sends one with its own text, icon and link.
  • Your recent notifications: your last five, with Seen to mark one read and the cross to dismiss it. Mark all seen and Dismiss all act on all of them. The unread count sits at the top of Try it.

Both demo notifications come from a fixed demo sender, so they reach your own inbox. They are also listed on the Events page. The module adds a Hello World entry to each user’s notification preferences, with Greetings and Custom demos under it, so a user can mute either kind.

The Hello World notifications page: how notifications work, Send a notification, and your recent notifications The Hello World notifications page: how notifications work, Send a notification, and your recent notifications

Notifications, the PhoenixKit way.

Elsewhere in the admin

  • Dashboards: a Hello world widget (category Hello World) with Card, Counter (live) and Contract (debug) views and settings such as Greeting, Tone and Punctuation. It needs the Dashboards module.
  • Projects: a Hello World project extension that adds a Hello tab to a project, with a greeting button that counts how often it was pressed. It needs the Projects module and is off by default for each project.

What it doesn’t do

It stores nothing of its own that you would use: it is a template. The events and notifications it creates are demo entries in the core activity log and inbox.

For developers

The module’s README is the guide to building a module: callbacks, tabs, permissions, translations, activity logging, notifications, widgets and project extensions. Copy the package, rename it, and replace the pages with your own.