How railwayapp/docs works
Project type and purpose
• This is a full-stack documentation site (“docs.railway.com”) built with Next.js and Contentlayer.
• Purpose: source markdown/MDX files under src/docs, generate static and dynamic doc pages, provide client-side search via a Meilisearch index, and serve everything on Railway.
File structure
• Top-level config & deployment
– .env.example, next.config.js, contentlayer.config.ts → Next/Contentlayer config
– meilisearch-docs-scraper.config.json → search‐index build config
– .github/workflows/ci.yml & build-search-index.yml → CI/CD pipelines
– railway.json → Railway deployment manifest
• Public assets
– public/ → images, fonts, static JSON for FAQs
• Source code
– src/pages → Next.js pages: static pages (index.tsx), dynamic routes ([...slug].tsx), API routes (pages/api/)
– src/components, layouts, mdxLayouts → reusable UI building blocks
– src/docs → markdown/MDX content for guides, tutorials, reference material
– src/hooks, utils, store → client‐side logic, state management, helper functions
• Build & styling
– tailwind.config.js, postcss.config.js, .babelrc.js → styling/build toolchain
– pnpm-lock.yaml, package.json → dependencies & scripts
Additional insights from README
• Next.js site, Node 18, uses pnpm
• Automatic deploys on Railway
• “build-search-index” workflow populates the search engine before deploy