Skip to content
CAI
Software that uses CAICheck a score

team-alembic/realworld

44.9

Weak · 18 September 2026

3.5k

lines of production code

Elixir

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a real-time social blogging platform that allows users to create, read, update, and delete articles, as well as follow other users and manage favorites. It features a modern web interface built with Phoenix LiveView, providing instant updates for comments, favorites, and feed filtering without page reloads. The application handles user authentication, profile management, and content moderation through a robust domain layer with explicit authorization policies.

Features

Add LiveView helper utilities for user context and date formatting

The application now includes a new LiveView helper module that provides utilities for rendering the home page and other LiveView components. This helper automatically assigns the current user to the socket state when a user ID is present in the session, enabling personalized views, and includes functions to format datetime objects into human-readable strings (e.g., "January 1, 2023") for display in the UI.

_lib/realworld\web/live · high confidence

Add user follow/unfollow capability to the Profiles domain

Users can now follow and unfollow other users via the Profiles domain. This change introduces a new \Follow\ resource and \Profiles\ domain in the \lib/realworld/profiles\ directory, implementing actions to list followings, check if a user is following another, and perform idempotent follow/unfollow operations using upserts to prevent duplicates.

lib/realworld/profiles · high confidence

Added local development seed script for demo data

A new seed script at priv/repo/seeds.exs has been added to facilitate local development by populating the database with demo users (demo, alice, bob, carol), sample articles, follows, favorites, and comments. The script uses domain actions rather than raw inserts to ensure policies and side effects are exercised, and it is idempotent so it can be run safely multiple times.

priv/repo · high confidence

Article detail page with real-time comments and social actions

Users can now view individual articles with full interaction capabilities: they can favorite/unfavorite articles and follow/unfollow authors directly from the article view, with the UI updating instantly. Logged-in users can post comments, which appear in real-time via Phoenix PubSub subscriptions without requiring a page refresh, and can delete their own comments. Guests are prompted to sign in to perform these actions, and are redirected to the login page if they attempt to favorite, follow, or comment while unauthenticated.

_lib/realworld\_web/live/article\live · high confidence

Automatic article slug generation and secure Markdown rendering

Articles now automatically generate URL-friendly slugs from their titles, ensuring that renaming an article updates its URL while maintaining uniqueness. Additionally, article body content is rendered from Markdown into sanitized HTML, allowing rich formatting while stripping potentially dangerous scripts and event handlers to prevent XSS attacks.

lib/realworld/articles/changes · high confidence

Live rendering of the home page with real-time favorites and pagination

The home page now uses Phoenix LiveView to render articles, allowing users to switch between the Global Feed and their private feed, filter by tags, and paginate through results without full page reloads. Users can favorite or unfavorite articles directly from the list, with the favorite count updating in real time via Phoenix PubSub broadcasts. The page also displays popular tags in a sidebar for easy filtering.

_lib/realworld\_web/live/page\live · high confidence

New article editor interface for creating and editing content

This change introduces a new LiveView-based editor page that allows users to create new articles and edit existing ones. The interface includes form fields for the article title, description, and markdown body, along with a tag input component that supports adding and removing tags via a JavaScript hook. The backend logic handles form validation, submission, and tag management, ensuring that tags added client-side are correctly persisted to the server even in race conditions.

_lib/realworld\_web/live/editor\live · high confidence

New user settings page for updating profile information

Users can now visit the settings page to update their profile details, including profile picture URL, username, bio, and email address. This new LiveView component provides a form with real-time validation and submission handling, allowing users to modify their public profile information directly from the application interface.

_lib/realworld\_web/live/settings\live · high confidence

Profile page now supports following users and viewing personal article lists

The profile page now allows users to follow and unfollow other users directly from the interface, with the follow status updating in real-time. Additionally, users can view their own articles or articles they have favorited via new tabs on the profile page, with favorite counts and statuses updating dynamically.

_lib/realworld\_web/live/profile\live · high confidence

Behavioural changes

Added release overlay scripts for database migrations and server startup

New shell and batch scripts have been added to the release overlays to standardize how the application is started and how database migrations are executed. The \migrate\ script (both Unix and Windows variants) now invokes \Realworld.Release.migrate\ to handle database schema updates, while the \server\ script sets the \PHX\_SERVER=true\ environment variable before starting the application, ensuring the Phoenix server component is correctly initialized in production releases.

rel · high confidence

Article feed filtering, sorting, and personalization logic

The system now supports filtering articles by tag, author, or whether they are favorited, and sorts results by newest first. For authenticated users viewing their personal feed, the list is restricted to articles from followed authors, and the response includes a flag indicating if each article is favorited by the current user. Anonymous users can still filter and sort but do not receive the favorited status.

lib/realworld/articles/preparations · high confidence

Database schema updates and ash-functions extension upgrades

This change updates the database schema and PostgreSQL extensions. It introduces new tables for user authentication tokens and user follow relationships, while refining the articles, tags, favorites, and comments tables with unique constraints and cascading delete references. A default profile image is now served locally instead of from an external API. Additionally, the ash-functions PostgreSQL extension is upgraded to version 4, adding UUID v7 generation functions and updating existing functions for stability.

priv/repo/migrations · high confidence

Introduce Ash 3.0-based Articles domain with real-time features

The Articles domain has been rebuilt using the Ash 3.0 framework, introducing a comprehensive set of resources for managing articles, comments, tags, and favorites. This update adds robust access control via Ash policies, ensuring that only authenticated users can create content and only authors can modify or delete their own articles. A key behavioral improvement is the introduction of real-time reactivity for comments and favorites; using Ash's PubSub notifier, the system now broadcasts events when comments are posted or favorites are toggled, allowing open pages to update live without a full refresh. The domain also supports advanced filtering for article feeds (by tag, author, or favoriter) and includes a private feed mode that shows content only from followed authors. Additionally, the implementation handles complex relationships, such as automatically creating or reusing tags during article publication and managing idempotent favorite upserts.

lib/realworld/articles · high confidence

Migrate accounts domain to Ash 3.0 with explicit authorization policies

The accounts domain (lib/realworld/accounts) has been refactored to align with Ash 3.0, introducing explicit authorization policies for User, Token, and the Accounts domain. User registration and sign-in now rely on AshAuthentication extensions with bypass policies for library interactions, while explicit anonymous policies allow public profile reads and registration. Token storage is secured with deny-by-default policies, allowing only AshAuthentication internal operations. The User resource includes a default profile image and session identifier for token revocation on logout.

lib/realworld/accounts · high confidence

Migrate authentication and error handling to Phoenix 1.8 conventions

The application now uses Phoenix 1.8 controller conventions, replacing the legacy \Phoenix.View\ approach with \use RealworldWeb, :html\ and HEEx templates. Authentication is handled via \AshAuthentication.Phoenix.Controller\, introducing new success, failure, and sign-out flows in \AuthController\. Error responses are standardized: \ErrorHTML\ and \ErrorJSON\ now use \Phoenix.Controller.status\_message\_from\_template\ to generate user-friendly messages for missing templates. The old \PageController\ has been removed as its functionality is likely subsumed by the new LiveView home page (referenced in commit messages but not shown in this diff).

_lib/realworld\web/controllers · high confidence

Migrate database layer to Ash and add authentication infrastructure

The application's data access has shifted from Ecto to the Ash framework, introducing a new repository module (Realworld.Repo) that utilizes AshPostgres and enforces a minimum PostgreSQL 16 requirement. To support this, a new release script (Realworld.Release) has been added to handle database migrations and rollbacks in production environments without Mix. Additionally, the Ash authentication system is now integrated into the application supervision tree, while the previous Swoosh-based mailer has been removed as it is no longer used.

lib/realworld · high confidence

Migrate layout templates to Phoenix 1.8 HEEx conventions

The application's layout templates (app, live, and root) have been rewritten to use the new HEEx syntax and Phoenix 1.8 conventions. This update replaces the previous rendering approach with modern HEEx components, including the use of \.live\_title\ for dynamic page titles and \phx-click\ handlers for dismissing flash messages in live views. Users will see the same visual structure and navigation, but the underlying template engine is now aligned with the latest Phoenix standards.

_lib/realworld\web/components/layouts · high confidence

Migrate to Ash 3.0, Bandit, and Phoenix 1.8 conventions

The application updates its HTTP adapter from Cowboy to Bandit and adopts Phoenix 1.8 conventions for error rendering (using HTML/JSON modules instead of the legacy ErrorView). It introduces Ash 3.0 and AshAuthentication for data and authentication, configuring Ash domains and token signing secrets across all environments. Database configuration is standardized via Ecto with environment-specific connection details, and the Swoosh mailer dependency is removed.

config · high confidence

Migrate web layer to Phoenix 1.8 conventions

The application's web layer has been updated to align with Phoenix 1.8 standards, replacing the legacy \Phoenix.View\ module with \Phoenix.Component\ and \Phoenix.HTML\ for rendering. This change introduces verified routes via the \\~p\ sigil, updates LiveView layouts to use the new \Layouts\ module convention, and integrates \PhoenixHTMLHelpers\ for form building. Users will benefit from modernized component-based rendering and improved route safety, while the underlying view helpers have been consolidated into a new \html\_helpers\ macro.

lib · high confidence

Migrate web layer to Phoenix 1.8 conventions and Ash Authentication

The web layer has been updated to follow Phoenix 1.8 conventions, replacing the legacy \Phoenix.View\ module with \PhoenixHTMLHelpers\ and \Phoenix.HTML.Form\ in error helpers, and switching the router to use the new \html:\ layout syntax with \RealworldWeb.Layouts\. Authentication is now handled by Ash Authentication, introducing live sessions for both authenticated and potentially authenticated states, which enables features like user profile viewing, article editing, and settings updates via LiveView routes (\/login\, \/register\, \/profile/:username\, \/editor\, \/settings\). The router also integrates Ash's session loading plugs and removes the deprecated Swoosh mailbox preview in favor of standard static asset handling.

_lib/realworld\web · high confidence

Migrate web layer to Phoenix 1.8 function components

The application's web layer has been refactored to use Phoenix 1.8 conventions, replacing the deprecated Phoenix.View module with function components. This introduces a new \nav\_link\ component that automatically highlights the current navigation item based on the path, and a streamlined \simple\_form\ component in the core UI library, while removing unused Tailwind and Heroicons components to align with the project's existing Conduit stylesheet.

_lib/realworld\web/components · high confidence

Migration to Ash Framework with Phoenix LiveView

The application has been rewritten to use the Ash Framework (including ash\_postgres and ash\_authentication) alongside Phoenix LiveView, replacing the previous Ecto-based architecture. This change introduces a new domain-layer structure with explicit authorization policies, real-time updates via PubSub, and a new authentication flow. Users will now interact with a LiveView-based UI, and the project includes new tooling for development such as .tool-versions for Erlang/Elixir pinning, a Dockerfile for containerization, and Fly.io deployment configuration.

(repo-wide) · high confidence

New LiveView-based sign-in and registration pages

The authentication interface has been replaced with new Phoenix LiveView pages that support both sign-in and registration. Users can now submit forms with email and password, and optionally a username during registration. The system provides real-time client-side validation via phx-change and handles submission by redirecting to a token-based sign-in flow upon success, while clearing sensitive fields on error.

_lib/realworld\_web/live/auth\live · high confidence

Removal of legacy Phoenix layout templates

The application has removed the standard Phoenix layout templates (app.html.heex, live.html.heex, and root.html.heex) from the codebase. This eliminates the default HTML structure, including the main container wrapper, flash message display logic, and the default header with navigation links and Phoenix branding, effectively stripping the site of its previous base layout definitions.

_lib/realworld\web/templates/layout · high confidence

Removal of legacy Phoenix view modules

The \ErrorView\, \LayoutView\, and \PageView\ modules in the web layer have been removed. This change reflects the migration away from the traditional \Phoenix.View\ module pattern towards Phoenix 1.8 conventions, where these specific view implementations are no longer required or are handled differently by the framework.

_lib/realworld\web/views · high confidence

Removal of legacy Phoenix welcome page template

The default \index.html.heex\ template for the application's home page has been deleted. This removes the static welcome content, including the "Welcome to Phoenix" header, resource links (Guides, Source, Changelog), and help links (Forum, IRC, Twitter, Slack, Discord) that were previously rendered at the root path. This change aligns with the migration to Phoenix 1.8 conventions, where the default view module is no longer used in the same way, and the template is no longer required for the basic application structure.

_lib/realworld\web/templates/page · high confidence

Tag input now uses a JavaScript hook and theme CSS is vendored

The tag input field now uses a JavaScript hook to handle adding tags via the Enter key, improving the user interaction for tagging content. Additionally, the Conduit theme CSS has been vendored locally to ensure the application's styling remains available and consistent, even though the original CDN source is no longer accessible.

assets · high confidence

Test coverage

Added LiveView integration tests and migrated error view tests; Added comprehensive test coverage for core domain resources; New test support infrastructure with data builders and LiveView testing.

Dependencies

Upgrade to Phoenix 1.8 and Ash 3.0 with new HTTP adapter

The application dependencies have been significantly updated, primarily upgrading the core framework from Phoenix 1.6 to 1.8 and Phoenix LiveView from 0.17 to 1.2. The HTTP adapter has been switched from Plug Cowboy to Bandit. Additionally, the data layer has been migrated to Ash 3.0, introducing new dependencies for Ash Postgres, Ash Authentication, and MDEx for markdown rendering, while removing retired dependencies like Swoosh and Earmark.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 45.

Lenses

  • Code Health 99
  • Architecture 83
  • Maturity 57
  • Readiness 29
  • Security 94
  • Accessibility 42

Changes since last survey

  • 137 commits — 112 feature/other, 25 fixes

By area

  • lib/realworld_web — 60 commits
  • (root) — 30 commits
  • lib/realworld — 30 commits
  • (repo) — 3 commits
  • config/config.exs — 3 commits
  • priv/repo — 3 commits
  • test/realworld — 2 commits
  • assets/css — 1 commit
  • assets/js — 1 commit
  • config/runtime.exs — 1 commit
  • lib/realworld_web.ex — 1 commit
  • rel/overlays — 1 commit
  • test/realworld_web — 1 commit

Notable commits

  • fix: Merge pull request #3 from vonagam/fix-broadcast-type
  • fix: Revert "chore: replace token_signing_secret with :secret_key_base instead"
  • fix: fix: Ash.set_actor instead of passing actor in context manually
  • fix: fix: adapt application code to upgraded Ash dependencies
  • fix: fix: add policies to User, Token and Tag
  • fix: fix: correct LiveView event handling and actor threading
  • fix: fix: do not pass in actor id as argument when following/unfollowing profile
  • fix: fix: error when title is empty
  • fix: fix: give phx-change forms stable ids for LiveView form recovery
  • fix: fix: live view layout string deprecation warning
  • fix: fix: make the token signing secret environment-specific
  • fix: fix: new article link
  • fix: fix: pass submitted params to the settings Form.submit
  • fix: fix: public list_articles
  • fix: fix: public profile page
  • fix: fix: redirect to sign in page when user not logged in
  • fix: fix: remove wrong broadcast_type
  • fix: fix: serve the default profile image locally — api.realworld.io is dead
  • fix: fix: set session_identifier :jti to revoke tokens on logout
  • fix: fix: show followed content in my feed improvement: add more realtime reactivity
  • …and 117 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

team-alembic/realworld was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 0ee23dfb2ff0b93e9483c910d30f737b710b2509 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.