Devika 판매

Flarum is a fast, extensible PHP forum platform with a rich extension ecosystem including GDPR tools, real-time WebSocket updates, an extension manager, and a full JS/PHP developer toolchain.
This block provides the full Flarum monorepo source, including the core framework and all first-party extensions (akismet, approval, embed, flags, mentions, tags, and more). It targets backend/fullstack developers who want to build, extend, or embed Flarum's forum platform into an existing Node.js or PHP-backed project, or who want to author their own Flarum extensions using the established patterns found here.
.github/ - CI/CD workflow definitions for backend, frontend, PHPStan, and release preparationbin/ - Shell scripts for running tests (bin/test.sh)extensions/ - All first-party Flarum extensions (akismet, approval, bbcode, embed, emoji, flags, gdpr, lang-english, likes, lock, markdown, mentions, messages, nicknames, package-manager, pusher, realtime, statistics, sticky, subscriptions, suspend, tags)framework/ - Core Flarum framework PHP and JS sourcejs-packages/ - Shared JavaScript/TypeScript packages used across extensionsphp-packages/ - Shared PHP packages used across extensions.bundlewatch.config.json - Bundle size monitoring configuration.styleci.yml - Style CI configuration for PHP code style enforcementCHANGELOG.md - Full version history for the monorepoLICENSE.md - MIT licenseREADME.md - Project overview and contribution guidecomposer.json - PHP dependency manifest for the monorepoflarum-monorepo.json - Monorepo tooling configurationpackage.json - Root npm workspace configurationnpm install mithril
npm install iframe-resizer
npm install typescript
npm install webpack webpack-cli
No native iOS/Android build steps are required. This is a web-only frontend stack (Mithril.js) paired with a PHP backend. If you are running the PHP side, you will need Composer and PHP 8.0+:
composer install
Drop the source/ directory into your project root, e.g. ./flarum-source/.
Each extension under source/extensions/<name>/js/ is a self-contained npm package. To work on one, navigate into it:
격리된 샌드박스를 띄워 서버에서 바로 실행하세요 — 로컬 설정 불필요.
이 버전에 대한 Tetrees AI Review
This PHP, TypeScript, JavaScript cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
파이프라인 avcp-2026-08-04.1 · SHA-256 bfe51ab10cd550db…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
검토일 2026년 8월 4일
이 제품을 AI IDE, 웹 빌더 또는 클라우드 IDE로 바로 가져오세요.
Tetrees를 호환 AI IDE에 연결해 보유 제품을 불러오고, 판매자 업로드 권한을 노출하지 않은 채 검증된 ZIP을 받으세요.
아직 리뷰가 없습니다.
토론을 불러오는 중…
cd flarum-source/extensions/akismet/js
npm install
Wire up TypeScript. Each extension ships its own tsconfig.json. Ensure your root tsconfig.json includes the relevant paths for Flarum's virtual module aliases:
{
"compilerOptions": {
"paths": {
"flarum/*": ["./flarum-source/framework/core/js/src/*"],
"flarum/common/*": ["./flarum-source/framework/core/js/src/common/*"],
"flarum/forum/*": ["./flarum-source/framework/core/js/src/forum/*"],
"flarum/admin/*": ["./flarum-source/framework/core/js/src/admin/*"]
}
}
}
Build an extension using its webpack config:
cd flarum-source/extensions/akismet/js
npx webpack --config webpack.config.js
Environment: no .env variables are required for the JS layer. The PHP layer requires standard Laravel-style env vars (DB_HOST, DB_DATABASE, APP_KEY, etc.) documented in Flarum's installation guide.
For the full PHP stack, run composer install at the monorepo root and follow Flarum's standard installation procedure.
import { extend } from 'flarum/common/extend';
extend(
target: object,
method: string,
callback: (returnValue: any, ...originalArgs: any[]) => void
): void;
Used to add behavior after an existing method runs without replacing it. The callback receives the method's return value as its first argument followed by the original arguments. Use this when you need to augment output (e.g., adding items to a list) without disrupting existing logic.
import { override } from 'flarum/common/extend';
override(
target: object,
method: string,
callback: (original: (...args: any[]) => any, ...args: any[]) => any
): void;
Replaces a method entirely, receiving the original function as the first argument so it can be called conditionally. Use this when you need to intercept and potentially change the return value based on runtime conditions, such as swapping a flag reason label.
import app from 'flarum/forum/app';
// or
import app from 'flarum/admin/app';
app.initializers.add(id: string, initializer: () => void): void;
Registers a named initializer that runs when the Flarum application boots. The id must be unique (conventionally the extension's composer package name with / replaced by -). All extend/override calls for an extension are placed inside this callback to ensure the app is ready before patching.
Extend the post controls destructive list to insert a custom action when a specific flag type is present, following the akismet extension pattern.
import { extend } from 'flarum/common/extend';
import app from 'flarum/forum/app';
import type Post from 'flarum/common/models/Post';
import type ItemList from 'flarum/common/utils/ItemList';
import type Mithril from 'mithril';
import PostControls from 'flarum/forum/utils/PostControls';
app.initializers.add('my-extension', () => {
extend(
PostControls,
'destructiveControls',
function (items: ItemList<Mithril.Children>, post: Post) {
if (items.has('approve')) {
const flags = post.flags();
if (flags && flags.some((flag) => flag?.type() === 'my-flag-type')) {
const approveItem = items.get('approve');
if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {
(approveItem as any).children = app.translator.trans('my-ext.forum.post.custom_label');
}
}
}
}
);
});
Override the flagReason method on the Post component to return custom text for your extension's flag type, falling back to the original for all other types.
import { override } from 'flarum/common/extend';
import app from 'flarum/forum/app';
import PostComponent from 'flarum/forum/components/Post';
app.initializers.add('my-extension', () => {
override(PostComponent.prototype, 'flagReason', function (original, flag) {
if (flag.type() === 'my-custom-flag') {
return app.translator.trans('my-ext.forum.post.custom_flagged_text');
}
return original(flag);
});
});
Use the approval extension pattern to declare that granting one permission requires another to be granted first.
import { extend } from 'flarum/common/extend';
import app from 'flarum/admin/app';
app.initializers.add('my-extension', () => {
extend(app, 'getRequiredPermissions', function (required: string[], permission: string) {
if (permission === 'discussion.myCustomAction') {
required.push('startDiscussion');
}
});
});
.github/ - GitHub Actions workflows for automated testing, linting, and publishing; not needed at runtime.bin/ - Contains test.sh, a convenience script to run the full test suite locally.extensions/ - Each subdirectory is a standalone Flarum extension with its own PHP source, JS source, locale files, and migrations.framework/ - The Flarum core framework; provides all base classes, components, and utilities that extensions import from flarum/*.js-packages/ - Reusable JS/TS packages shared across extensions (e.g., build tooling, type definitions).php-packages/ - Reusable PHP packages shared across extensions (e.g., testing helpers, shared utilities)..bundlewatch.config.json - Configures bundle size limits checked in CI to prevent asset bloat..styleci.yml - Enforces PSR-2/PSR-12 PHP coding standards automatically on PRs.CHANGELOG.md - Tracks all changes per release across the monorepo.composer.json - Declares PHP dependencies and autoloading for the entire monorepo.flarum-monorepo.json - Tooling config for monorepo management scripts.package.json - Defines npm workspaces so all extension JS packages share a single node_modules.flarum/* imports resolve to nothing: The flarum/ path alias is only resolved by Flarum's custom webpack config; copy the webpack.config.js from any extension as your starting point rather than writing one from scratch.extend callback fires before app is ready: Always place extend/override calls inside app.initializers.add, never at module top level.app.initializers.add must use a globally unique string; collisions silently drop one initializer. Use your full package name.@types/mithril and ensure your tsconfig.json includes "moduleResolution": "bundler" or "node16" to resolve .d.ts files correctly.extend.php; confirm the path matches your actual migrations/ directory.iframeResizer.contentWindow.js import must be the very first import in the entry file; reordering breaks the parent-frame handshake.I have the Flarum monorepo source in the `flarum-source/` directory of my project.
I also have `USAGE.md` at the project root describing the real exports and integration patterns.
Please help me integrate Flarum extension functionality into my project step by step:
1. Read `USAGE.md` for the real exported symbols (`extend`, `override`, `app.initializers.add`).
2. Read the relevant extension source under `flarum-source/extensions/<name>/js/src/` for patterns.
3. Create a new extension entry file that uses `app.initializers.add` with a unique ID.
4. Use `extend` or `override` from `flarum/common/extend` to patch the target component or utility.
5. Wire up the webpack build using the pattern in `flarum-source/extensions/akismet/js/webpack.config.js`.
6. Do not invent any Flarum APIs; only use symbols visible in the source files and USAGE.md.
My goal: [describe your specific customization here].
Flarum is open-source software licensed under the MIT License. See source/LICENSE.md for the full text. Upstream package: flarum monorepo. Community resources: flarum.org, Flarum Discuss.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
전체 설치 가이드와 연동 프롬프트는 구매 후 열람할 수 있습니다.
Game Source Code & Interactive Templates
무료