This is a Next.js (App Router) application generated with Create Fumadocs using the Next.js: Fumadocs MDX option.
It features basic setup, configurations, sign-in authentication, and tooling to standardize using Fumadocs as a template.
Next application code lives inside the
/srcdirectory.
https://fumadocs-template-ten.vercel.app/
Recommended version (used within this project)
node v24.11.0
npm v11.6.1
- This requires a Google Cloud Platform project configured with OAuth2 settings and credentials.
- Read on the Google Gmail, SMTP and OAuth2 Setup sections for more information.
- Retrieve the
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETenvironment variable values here. - Add the following in your Google Client ID's Authorized redirect URIs:
- https://<YOUR_DEPLOYED_APP_ROOT_DOMAIN>/api/auth/callback/google
- eg.,
http://localhost:3000/api/auth/callback/google(when working in local development)
- https://<YOUR_DEPLOYED_APP_ROOT_DOMAIN>/api/auth/callback/google
Tip
Setup required only if you want to enable Google sign-in
To allow unrestricted access on all routes, set matcher: [] in the /docsapp/src/proxy.ts file.
cd docsappnpm installnpm run devOpen http://localhost:3000 with your browser to see the result.
Note
Look over the Ennvironment Variables section for more building and Authentication options.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Tip
Set IS_WEBPACK=1 and WATCHPACK_POLLING=true to enable hot reloading in development mode when running in Docker on Windows, as Turbopack is currently unreliable in this setup.
Using Docker
-
Set up the environment variables in the
/docsappdirectory. Refer to the Environment Variables for more information. -
Build the image for local development..
docker compose build --no-cache
-
Run the container for local development.
docker compose up
Open http://localhost:3000 with your browser to see the result.
Note
The Fumadocs app lives inside the /docsapp directory.
All files and folders referenced in the following sections are relative to the /docsapp directory.
In the project, you can see:
lib/source.ts: Code for content source adapter,loader()provides the interface to access your content.lib/layout.shared.tsx: Shared options for layouts, optional but preferred to keep.
| Route | Description |
|---|---|
app/(home) |
The route group for your landing page and other pages. |
app/docs |
The documentation layout and pages. |
app/api/search/route.ts |
The Route Handler for search. |
A source.config.ts config file has been included, you can customise different options like frontmatter schema.
Read the Introduction for further details.
To learn more about Next.js and Fumadocs, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Fumadocs - learn about Fumadocs
Warning
Ensure only one of IS_BUILD_STATIC or IS_BUILD_DOCKER has a value of 1 to avoid build conflicts.
Create a .env.local file from the .env.example file.
| Variable | Description |
|---|---|
| GOOGLE_CLIENT_ID | Google OAuth2 client ID linked with your Google Cloud Platform project. |
| GOOGLE_CLIENT_SECRET | Google OAuth2 client secret associated with the GOOGLE_CLIENT_ID |
| NEXTAUTH_SECRET | Your nextauth secret (any random string will do) |
| NEXTAUTH_URL | Your root domain URL |
| ALLOWED_EMAIL_DOMAINS | Allowed Google email domains to sign-in with Google eg., gmail.com, company.com.Leave it blank or unset if you want to allow sign-in from all Gmail domains. |
| ALLOWED_EMAILS | Hard-coded list of comma-separated emails allowed to sign-in with Google. Leave it blank or unset if you want to allow sign-in from all Google accounts. |
| IS_BUILD_DOCKER | If value is 1, builds the NextJS app for Docker in production using the standalone mode build into the /docsapp/.next/standalone and /docsapp/.next/static directories. |
| IS_BUILD_STATIC | If value is 1, builds and exports the NextJS app into a static build in the /docsapp/out directory when running "npm run build"next.config.mjs file and the overall app before export. |
| IS_WEBPACK | Set to 1 to run the app in development mode using Webpack. β IMPORTANT: When running the app via Docker on Windows OS ( docker compose up), this must be set to 1 to enable hot reload. |
| WATCHPACK_POLLING | Set to true to enable Webpack-based hot reloading when running the app in Docker on Windows. Required because Turbopack hot reload is currently unreliable in this setup (Docker + Windows). |
| APP_NAME | Name of your Fumadocs documentation app. Defaults to "Fumadocs Template" |
| GH_USERNAME | Your GitHub username |
| GH_REPOSITORY | GitHub repository containing this documentation app |
| GH_REPO_DEFAULT_BRANCH | Default branch of the GH_REPOSITORY. Defaults to "main" |
@weaponsforge
20251118
20260320