Skip to content

Posts by Asif Mughal

51 articles

When an app fails: fault isolation and recovery

How Basehim keeps one broken app from taking a site down: code checked before it is loaded, failures contained while it starts, the app switched off with a report for the administrator, and a validated way to turn it back on.

Asif Mughal

Public routes for apps

Give your app public pages and endpoints with $this->router()->site(): every HTTP method, parameters, named URLs, per-route sign-in, permissions, CSRF and rate limits, and pages rendered inside the active theme, without ever overriding core's own URLs.

Asif Mughal

Connect an AI assistant to your site

A step-by-step tutorial. Connect Claude, or any MCP client, to your Basehim site over OAuth or with an API key. Choose the right account and scopes, try useful prompts, and know how to disconnect.

Asif Mughal

Publish from a script with the REST API

A step-by-step tutorial. Write a small Node.js script that publishes Markdown files to Basehim - creating the category, uploading a cover image, and updating the same post on later runs - with a scoped API key and proper error handling.

Asif Mughal

Import an RSS feed on a schedule

A step-by-step tutorial. Build an app that checks an RSS feed every hour and saves new items as draft posts, using scheduled tasks, outbound HTTP, terms, declared permissions and the app log, plus a real cron job for punctual runs.

Asif Mughal

Give your app an MCP tool for AI agents

A step-by-step tutorial. Expose your app's data to AI assistants as an MCP tool with its own scope, decide which roles may grant it, and test it with an API key and a JSON-RPC call.

Asif Mughal

Add a "Was this helpful?" widget with AJAX

A step-by-step tutorial. Build an app that asks readers whether a post helped, records answers through a rate-limited public AJAX action, stores them in its own table and shows a report to editors.

Asif Mughal

Build a theme from scratch

A step-by-step tutorial. Build "Notebook", a clean reading theme with a header, menus, a sidebar widget area, post cards, pagination, comments, an author box and a Customizer accent colour, in plain PHP and CSS.

Asif Mughal

Build your first app: an announcement bar

A step-by-step tutorial. Build a small Basehim app with a settings screen in the admin and a message bar on every public page, and learn the manifest, boot(), admin routes, CSRF, settings, views and front-end output along the way.

Asif Mughal

Contributing and running the tests

Set up a development checkout, run the dependency-free test suite with and without a database, write unit and integration tests, follow the code conventions, and send a pull request.

Asif Mughal