Skip to content

Commit c3afc9c

Browse files
committed
feat(faq): 🚀 add FAQ section with dynamic content and translations
1 parent 766f5f1 commit c3afc9c

5 files changed

Lines changed: 205 additions & 0 deletions

File tree

‎apps/web/src/locales/site/en.json‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,44 @@
304304
"library": "Media library tips"
305305
}
306306
}
307+
},
308+
"faq": {
309+
"eyebrow": "FAQ",
310+
"title": "What people ask before installing",
311+
"items": {
312+
"what": {
313+
"question": "What is VitNode?",
314+
"answer": "An open-source platform for community websites. Members and roles, publishing with the Content Engine, search, moderation and an admin panel (AdminCP) come out of the box, built on TanStack Start, Hono, Drizzle and PostgreSQL."
315+
},
316+
"free": {
317+
"question": "Is VitNode free to use?",
318+
"answer": "Yes. VitNode is <license>MIT-licensed</license>: no paid tiers, no per-member pricing, no lock-in. You run it on your own server and own your data. The only bills are your hosting and, if you switch them on, your AI providers."
319+
},
320+
"ready": {
321+
"question": "Can I run my community on VitNode today?",
322+
"answer": "Not in production yet. VitNode 2.0 is a canary build, so expect bugs and breaking changes between releases. For now it is for exploring, prototyping and building plugins ahead of the stable release."
323+
},
324+
"non_dev": {
325+
"question": "I’m not a developer. Can I still build with VitNode?",
326+
"answer": "Day-to-day running happens in the AdminCP, no code needed. Installing and extending still need a terminal, and that is where an AI coding agent like Claude Code earns its keep: the docs ship as <code>llms-full.txt</code>, so your agent can read them and do the setup with you."
327+
},
328+
"hosting": {
329+
"question": "Where can I host it, and what does it need to run?",
330+
"answer": "Anywhere Node.js 22+ or Bun runs: your own server, Docker or Cloudflare Workers. It needs PostgreSQL; Redis is optional and speeds up caching. The generator can add a Docker Compose file with both. Start with the <setup>setup guide</setup>."
331+
},
332+
"plugins": {
333+
"question": "How do I add features VitNode does not ship with, like a forum, a blog or paid content for members?",
334+
"answer": "With plugins. Official ones add a blog, a forum and one-time payments through Stripe. When you need something of your own, the <code>vitnode</code> CLI generates a plugin with pages, an API, database tables and AdminCP screens in a few minutes. See <create>Create a plugin</create>."
335+
},
336+
"languages": {
337+
"question": "Can my community speak more than one language?",
338+
"answer": "Yes. The interface is translated, and content is translated field by field with a fallback language, so a missing translation never leaves a blank page. Sitemaps include hreflang links, so search engines send each reader to their own language."
339+
},
340+
"ai": {
341+
"question": "Which AI models does it work with, and who pays for them?",
342+
"answer": "Any model the Vercel AI SDK supports: OpenAI, Anthropic, Google and more. You bring your own keys, set a monthly budget in the AdminCP and choose which roles get AI. Members spend AI points, so nobody burns through the budget in an afternoon."
343+
}
344+
}
307345
}
308346
},
309347
"search": {

‎apps/web/src/locales/site/pl.json‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,44 @@
304304
"library": "Sprzedam rower"
305305
}
306306
}
307+
},
308+
"faq": {
309+
"eyebrow": "FAQ",
310+
"title": "O co ludzie pytają przed instalacją",
311+
"items": {
312+
"what": {
313+
"question": "Czym jest VitNode?",
314+
"answer": "To platforma open source do stron społeczności. Członkowie i role, publikowanie w Content Engine, wyszukiwarka, moderacja i panel administracyjny (AdminCP) działają od razu. Całość zbudowano na TanStack Start, Hono, Drizzle i PostgreSQL."
315+
},
316+
"free": {
317+
"question": "Czy VitNode jest darmowy?",
318+
"answer": "Tak. VitNode jest na <license>licencji MIT</license>: bez płatnych planów, bez opłat za członków i bez uzależnienia od dostawcy. Uruchamiasz go na własnym serwerze, a dane należą do Ciebie. Płacisz tylko za hosting i, jeśli je włączysz, za dostawców AI."
319+
},
320+
"ready": {
321+
"question": "Czy mogę już dziś uruchomić na nim swoją społeczność?",
322+
"answer": "Jeszcze nie produkcyjnie. VitNode 2.0 to wersja canary, więc spodziewaj się błędów i zmian łamiących zgodność między wydaniami. Na razie służy do poznawania platformy, prototypowania i budowania wtyczek przed stabilnym wydaniem."
323+
},
324+
"non_dev": {
325+
"question": "Nie jestem programistą. Czy mimo to zbuduję coś z VitNode?",
326+
"answer": "Codzienną pracę wykonujesz w AdminCP, bez kodu. Instalacja i rozbudowa wymagają jednak terminala i tu przydaje się agent AI do kodowania, na przykład Claude Code: dokumentacja jest dostępna jako <code>llms-full.txt</code>, więc agent może ją przeczytać i przeprowadzić konfigurację razem z Tobą."
327+
},
328+
"hosting": {
329+
"question": "Gdzie mogę go hostować i czego potrzebuje do działania?",
330+
"answer": "Wszędzie tam, gdzie działa Node.js 22+ lub Bun: na własnym serwerze, w Dockerze albo w Cloudflare Workers. Wymaga PostgreSQL; Redis jest opcjonalny i przyspiesza cache. Generator może dodać plik Docker Compose z oboma. Zacznij od <setup>przewodnika instalacji</setup>."
331+
},
332+
"plugins": {
333+
"question": "Jak dodać funkcje, których VitNode nie ma, na przykład forum, bloga albo płatne treści dla członków?",
334+
"answer": "Za pomocą wtyczek. Oficjalne dodają bloga, forum i jednorazowe płatności przez Stripe. Gdy potrzebujesz czegoś własnego, CLI <code>vitnode</code> w kilka minut wygeneruje wtyczkę ze stronami, API, tabelami w bazie i ekranami AdminCP. Zobacz <create>Tworzenie wtyczki</create>."
335+
},
336+
"languages": {
337+
"question": "Czy moja społeczność może mówić w kilku językach?",
338+
"answer": "Tak. Interfejs jest przetłumaczony, a treści tłumaczysz pole po polu z językiem zapasowym, więc brak tłumaczenia nigdy nie zostawi pustej strony. Mapy witryny zawierają linki hreflang, dzięki czemu wyszukiwarki kierują każdego czytelnika do jego języka."
339+
},
340+
"ai": {
341+
"question": "Z jakimi modelami AI działa i kto za nie płaci?",
342+
"answer": "Z każdym modelem obsługiwanym przez Vercel AI SDK: OpenAI, Anthropic, Google i innymi. Używasz własnych kluczy, ustawiasz miesięczny budżet w AdminCP i decydujesz, które role mają dostęp do AI. Członkowie wydają punkty AI, więc nikt nie wyczerpie budżetu w jedno popołudnie."
343+
}
344+
}
307345
}
308346
},
309347
"search": {

‎apps/web/src/site/home/home-content.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { RouteMessages } from '@vitnode/core/tanstack/i18n'
22

33
import { HOME_NAMESPACES } from '@/site/home/namespaces'
44
import { BentoSection } from '@/site/home/sections/bento'
5+
import { FaqSection } from '@/site/home/sections/faq'
56
import { HeroSection } from '@/site/home/sections/hero'
67
import { IntegrationsSection } from '@/site/home/sections/integrations'
78
import { MarketingPage } from '@/site/marketing/marketing-page'
@@ -16,6 +17,7 @@ export const HomeRouteContent = () => (
1617
</div>
1718
<BentoSection />
1819
<IntegrationsSection />
20+
<FaqSection />
1921
</MarketingPage>
2022
</RouteMessages>
2123
)

‎apps/web/src/site/home/namespaces.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export const HOME_NAMESPACES = [
22
'core.global',
33
'site.home.hero',
44
'site.home.bento',
5+
'site.home.faq',
56
] as const
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
import { Link } from '@tanstack/react-router'
2+
import {
3+
Accordion,
4+
AccordionContent,
5+
AccordionItem,
6+
AccordionTrigger,
7+
} from '@vitnode/core/components/ui/accordion'
8+
import { useTranslations } from 'use-intl'
9+
10+
import { LICENSE_URL } from '@/site/marketing/links'
11+
import { MarketingSection, SectionHeading } from '@/site/marketing/shared'
12+
13+
const FAQ_ITEMS = [
14+
'what',
15+
'free',
16+
'ready',
17+
'non_dev',
18+
'hosting',
19+
'plugins',
20+
'languages',
21+
'ai',
22+
] as const
23+
24+
const LINK = 'text-primary font-medium underline-offset-4 hover:underline'
25+
26+
const plainText = (chunks: string) => chunks
27+
28+
export const FaqSection = () => {
29+
const t = useTranslations('site.home.faq')
30+
31+
const structuredData = {
32+
'@context': 'https://schema.org',
33+
'@type': 'FAQPage',
34+
mainEntity: FAQ_ITEMS.map((key) => ({
35+
'@type': 'Question',
36+
acceptedAnswer: {
37+
'@type': 'Answer',
38+
text: t.markup(`items.${key}.answer`, {
39+
code: plainText,
40+
create: plainText,
41+
license: plainText,
42+
setup: plainText,
43+
}),
44+
},
45+
name: t(`items.${key}.question`),
46+
})),
47+
}
48+
49+
return (
50+
<MarketingSection id="faq" labelledBy="faq-title">
51+
<SectionHeading
52+
align="center"
53+
eyebrow={t('eyebrow')}
54+
id="faq-title"
55+
title={t('title')}
56+
/>
57+
58+
<Accordion
59+
className="bg-card mx-auto w-full max-w-3xl overflow-hidden rounded-2xl border"
60+
defaultValue={[FAQ_ITEMS[0]]}
61+
hiddenUntilFound
62+
>
63+
{FAQ_ITEMS.map((key) => (
64+
<AccordionItem
65+
className="data-open:bg-muted/50 ease-fluid transition-[background-color] duration-300"
66+
key={key}
67+
value={key}
68+
>
69+
<AccordionTrigger className="hover:bg-muted/50 cursor-pointer touch-manipulation items-center gap-4 rounded-none px-5 py-4 text-base transition-[background-color] duration-150 focus-visible:ring-inset sm:px-6 sm:text-lg **:data-[slot=accordion-trigger-icon]:size-5">
70+
<span className="flex-1 text-pretty">
71+
{t(`items.${key}.question`)}
72+
</span>
73+
</AccordionTrigger>
74+
<AccordionContent className="ease-fluid text-muted-foreground in-data-ending-style:opacity-0 in-data-starting-style:translate-y-2 in-data-starting-style:opacity-0 max-w-prose px-5 pb-5 text-base leading-relaxed text-pretty transition-[opacity,translate] delay-75 duration-300 in-data-ending-style:delay-0 in-data-ending-style:duration-150 motion-reduce:transition-none sm:px-6 sm:pb-6">
75+
<p>
76+
{t.rich(`items.${key}.answer`, {
77+
code: (chunks) => (
78+
<code className="bg-muted text-foreground rounded px-1 py-0.5 font-mono text-sm">
79+
{chunks}
80+
</code>
81+
),
82+
create: (chunks) => (
83+
<Link
84+
className={LINK}
85+
params={{ _splat: 'dev/plugins/create' }}
86+
to="/docs/$"
87+
>
88+
{chunks}
89+
</Link>
90+
),
91+
license: (chunks) => (
92+
<a
93+
className={LINK}
94+
href={LICENSE_URL}
95+
rel="noopener noreferrer"
96+
target="_blank"
97+
>
98+
{chunks}
99+
</a>
100+
),
101+
setup: (chunks) => (
102+
<Link
103+
className={LINK}
104+
params={{ _splat: 'dev/setup' }}
105+
to="/docs/$"
106+
>
107+
{chunks}
108+
</Link>
109+
),
110+
})}
111+
</p>
112+
</AccordionContent>
113+
</AccordionItem>
114+
))}
115+
</Accordion>
116+
117+
<script
118+
// oxlint-disable-next-line react/no-danger
119+
dangerouslySetInnerHTML={{
120+
__html: JSON.stringify(structuredData).replaceAll('<', '\\u003c'),
121+
}}
122+
type="application/ld+json"
123+
/>
124+
</MarketingSection>
125+
)
126+
}

0 commit comments

Comments
 (0)