Skip to content

weaponsforge/fumadocs-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

fumadocs-template

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 /src directory.

Demo

https://fumadocs-template-ten.vercel.app/

πŸ“‹ Requirements

1. NodeJS v24

Recommended version (used within this project)
node v24.11.0
npm v11.6.1

2. Google OAuth2 Client (optional)

  • 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_ID and GOOGLE_CLIENT_SECRET environment 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)

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.

3. Docker (optional)

πŸ“– Run development server

1. Navigate to the /docsapp directory

cd docsapp

2. Install dependencies.

npm install

3. Run the app

npm run dev

4. Launch the local website.

Open http://localhost:3000 with your browser to see the result.

Note

Look over the Ennvironment Variables section for more building and Authentication options.


Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.


⚑ Quickstart

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

  1. Set up the environment variables in the /docsapp directory. Refer to the Environment Variables for more information.

  2. Build the image for local development..

    docker compose build --no-cache
  3. Run the container for local development.

    docker compose up

Open http://localhost:3000 with your browser to see the result.

Explore

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.

Fumadocs MDX

A source.config.ts config file has been included, you can customise different options like frontmatter schema.

Read the Introduction for further details.

Learn More

To learn more about Next.js and Fumadocs, take a look at the following resources:

Environment Variables

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"

⚠️ Fumadocs (or any Next.js) app that uses heavy React Server Components (RSC) and Next.js server features will fail to build as a static output. Te enable true static export, adjust necessary settings in the 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

About

Clean, beautiful, modular documentation template built with Fumadocs + Google OAuth2 and Docker configs

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors