Hi everyone,
I have developed a native Flarum extension that implements a 100% serverless, zero-database Mock API generator and Server-Sent Events (SSE) stream simulator.
Architectural Approach: Zero-DB
Most developer utility extensions introduce unnecessary database migrations, custom tables, and heavy read/write overhead. This engine bypasses the persistence layer entirely.
By encrypting and packing user-generated JSON payloads directly into parameter-driven query strings, the extension guarantees zero database hits. It provides high-performance, completely disposable mock endpoints directly through URL logic.
Core Implementation
- Disposable Mocking: Parses and returns JSON payloads straight from the URI encryption.
- Live SSE Streams (
&stream=true): Upgrades the connection state to text/event-stream, emitting chunked object sequences every 1000ms.
- Latency Simulation (
&delay=3000): Simulates network lag on the fly to test client-side skeleton loaders and error-catch states.
Source Code & Setup
The extension structures code using Flarum’s native Mithril.js frontend components and compiles through the core webpack setup.
You can inspect the codebase, verify the architecture, or contribute here:
👉 andrexdd/flarum-serverless-mock-api
Feedback regarding the URI cryptography and custom JSON schema validations is highly appreciated.
Regards,
Andre Software