Skip to content

Add a Flarum extension for CoworkingView price-index cards - #66

Open
erich-mueller wants to merge 1 commit into
mainfrom
cursor/flarum-coworking-prices-865d
Open

erich-mueller wants to merge 1 commit into
mainfrom
cursor/flarum-coworking-prices-865d

Conversation

@erich-mueller

Copy link
Copy Markdown
Contributor

Summary

Adds integrations/flarum/, a Flarum 1.8 extension laid out as a standalone package root (coworkingview/flarum-coworkingview, title CoworkingView Coworking Prices). It is not published to Packagist from this pull request.

The extension shows public Price Index figures for one city:

  • [coworking city=berlin] (optional product and locale) in posts. Figures are filled when the post is rendered, from a cached API reading, and the stored post text stays the BBCode.
  • A sidebar card on the discussion list and on discussions. Admins set the city, language, product, and whether the card is shown.

Every card prints the API attribution string and links to https://coworkingview.com. The extension code is MIT. The figures stay CC BY 4.0.

How the data is fetched

One HTTPS GET to https://api.coworkingview.com/v1/market/rates with locale and city only. No API key and no post text. locale is always sent. A 429 or 5xx is retried once. Successful readings, unknown cities, and unpublished cities are cached for 10 minutes. COWORKINGVIEW_API_URL can replace the origin only.

Checks

  • composer validate --strict --no-check-publish passes.
  • php tests/run.php passes (synthetic fixture, no network).
  • npm run build in integrations/flarum/js succeeds, and js/dist is committed.

CI for this repo is .github/workflows/flarum.yml. The same checks live in integrations/flarum/.github/workflows/ci.yml for when that directory is the root of coworkingview/flarum-coworkingview.

Open in Web Open in Cursor 

The extension reads the public rates endpoint and shows a city card in posts and the forum sidebar, with the API attribution kept on the card.

Co-authored-by: E. M. <erich-mueller@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant