From b6a8a67803a51699ec0d585bc884eb240405cd28 Mon Sep 17 00:00:00 2001 From: Paul Gaikwad Date: Fri, 17 Oct 2025 01:30:33 +0200 Subject: [PATCH 01/10] Added Dynamic Fetching Feature. Removed earlier static fetching --- _data/sidebars/community_sidebar.yaml | 5 +- _data/sidebars/docs_sidebar.yml | 7 +- content/docs/fundamentals/fundamentals-faq.md | 140 ++++++++++++++++++ tools/forum-proxy.js | 55 +++++++ 4 files changed, 203 insertions(+), 4 deletions(-) create mode 100644 content/docs/fundamentals/fundamentals-faq.md create mode 100644 tools/forum-proxy.js diff --git a/_data/sidebars/community_sidebar.yaml b/_data/sidebars/community_sidebar.yaml index 636e7fd5df8..135cd9931b9 100644 --- a/_data/sidebars/community_sidebar.yaml +++ b/_data/sidebars/community_sidebar.yaml @@ -118,11 +118,10 @@ entries: - title: Example - OpenFOAM adapter url: /community-guidelines-adapters-openfoam.html output: web - + + - title: Community channels url: /community-channels.html output: web - - diff --git a/_data/sidebars/docs_sidebar.yml b/_data/sidebars/docs_sidebar.yml index 9f784b47c94..32d9b2238c4 100644 --- a/_data/sidebars/docs_sidebar.yml +++ b/_data/sidebars/docs_sidebar.yml @@ -43,7 +43,12 @@ entries: - title: Roadmap url: /fundamentals-roadmap.html output: web, pdf - + + - title: FAQ + url: /fundamentals-faq.html + output: web, pdf + tags: faq + - title: Previous versions url: /fundamentals-previous-versions.html output: web, pdf diff --git a/content/docs/fundamentals/fundamentals-faq.md b/content/docs/fundamentals/fundamentals-faq.md new file mode 100644 index 00000000000..03c7c469998 --- /dev/null +++ b/content/docs/fundamentals/fundamentals-faq.md @@ -0,0 +1,140 @@ +--- +layout: default +title: FAQ +parent: Fundamentals +permalink: /fundamentals-faq.html +tags: [faq] +--- + +

preCICE Forum Browser

+

Search and filter discussions mirrored from the preCICE Discourse forum.

+ +
+ + + + +
+ +

+

+ +
+ + + diff --git a/tools/forum-proxy.js b/tools/forum-proxy.js new file mode 100644 index 00000000000..5c3a6e8eaf8 --- /dev/null +++ b/tools/forum-proxy.js @@ -0,0 +1,55 @@ +const express = require("express"); +const fetch = require("node-fetch"); + +const app = express(); +const PORT = process.env.PORT || 3000; + +// Allow all origins (for frontend CORS) +app.use((req, res, next) => { + res.header("Access-Control-Allow-Origin", "*"); + next(); +}); + +app.get("/forum", async (req, res) => { + try { + const [topicsRes, catsRes] = await Promise.all([ + fetch("https://precice.discourse.group/latest.json"), + fetch("https://precice.discourse.group/categories.json"), + ]); + + const topicsJson = await topicsRes.json(); + const catsJson = await catsRes.json(); + + const catMap = {}; + catsJson.category_list.categories.forEach((c) => (catMap[c.id] = c.name)); + + const topics = topicsJson.topic_list.topics.map((t) => ({ + id: t.id, + slug: t.slug, + title: t.title, + fancy_title: t.fancy_title, + url: `https://precice.discourse.group/t/${t.slug}/${t.id}`, + category: catMap[t.category_id] || "General", + tags: t.tags || [], + created_at: t.created_at, + last_posted_at: t.last_posted_at, + excerpt: t.excerpt, + posts_count: t.posts_count, + views: t.views, + like_count: t.like_count, + closed: t.closed, + pinned: t.pinned, + })); + + res.json({ + source: "preCICE Discourse (live)", + generated_at: new Date().toISOString(), + topics, + }); + } catch (err) { + console.error("Proxy error:", err); + res.status(500).json({ error: "Failed to fetch forum data" }); + } +}); + +app.listen(PORT, () => console.log(`Forum proxy running on port ${PORT}`)); From c7a599bbd40171717b049a92a60b891e724761ee Mon Sep 17 00:00:00 2001 From: Paul Gaikwad Date: Sat, 18 Oct 2025 21:15:40 +0200 Subject: [PATCH 02/10] =?UTF-8?q?make=20FAQ=20section=20production-ready?= =?UTF-8?q?=20with=20cleaner=20UI=20and=20resilient=20forum=20fetching=20?= =?UTF-8?q?=20=20-=20Simplified=20FAQ=20page=20layout=20(removed=20categor?= =?UTF-8?q?y=20and=20tag=20filters)=20=20=20-=20Updated=20text=20and=20str?= =?UTF-8?q?ucture=20for=20clarity=20and=20usability=20=20=20-=20Added=20pr?= =?UTF-8?q?oduction-grade=20forum-fetch.js=20with:=20=20=20=20=20=E2=80=A2?= =?UTF-8?q?=20Retry=20and=20timeout=20logic=20for=20robust=20data=20fetchi?= =?UTF-8?q?ng=20=20=20=20=20=E2=80=A2=20Improved=20loading=20and=20error?= =?UTF-8?q?=20feedback=20for=20users=20=20=20=20=20=E2=80=A2=20Cleaner=20F?= =?UTF-8?q?AQ=20card=20design=20with=20hover=20effects=20=20=20-=20Integra?= =?UTF-8?q?ted=20backend=20proxy=20for=20fetching=20FAQ-tagged=20Discourse?= =?UTF-8?q?=20topics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/docs/fundamentals/fundamentals-faq.md | 123 +---------------- js/forum-fetch.js | 127 ++++++++++++++++++ package.json | 87 ++++++++++++ tools/forum-proxy.js | 43 ++---- 4 files changed, 230 insertions(+), 150 deletions(-) create mode 100644 js/forum-fetch.js create mode 100644 package.json diff --git a/content/docs/fundamentals/fundamentals-faq.md b/content/docs/fundamentals/fundamentals-faq.md index 03c7c469998..27d0228583d 100644 --- a/content/docs/fundamentals/fundamentals-faq.md +++ b/content/docs/fundamentals/fundamentals-faq.md @@ -6,18 +6,14 @@ permalink: /fundamentals-faq.html tags: [faq] --- -

preCICE Forum Browser

-

Search and filter discussions mirrored from the preCICE Discourse forum.

+

Frequently Asked Questions

+

Browse and search frequently asked questions mirrored from the preCICE Discourse forum.

- - - +