This is an example project that demonstrates how a documentation site created with the ObjectDocs CLI works in a real-world scenario. It's designed to test and validate deployment on platforms like Vercel.
This example serves multiple purposes:
- Testing Reference: Validate that CLI-created projects can be deployed successfully
- Deployment Guide: Demonstrate the correct setup for production deployments
- Integration Test: Ensure
@objectdocs/cliand@objectdocs/sitework together correctly when installed from npm (not workspace)
- Real npm packages: Uses
@objectdocs/clifrom npm registry (notworkspace:*) - Standalone setup: Completely independent from the monorepo
- Vercel-ready: Configured for deployment on Vercel and other platforms
- Production representative: Mirrors exactly how a user would create a project
example/
├── content/
│ ├── docs.site.json # Global site configuration
│ └── docs/
│ ├── meta.json # Sidebar navigation structure
│ ├── index.mdx # Home page
│ ├── getting-started.mdx
│ └── configuration.mdx
├── public/ # Static assets (logos, images)
├── package.json # Uses @objectdocs/cli from npm
└── README.md # This file
- Node.js 18+
- pnpm (recommended) or npm
- Navigate to the example directory:
cd example- Install dependencies:
pnpm installThis will install @objectdocs/cli from npm, which in turn will pull @objectdocs/site as a dependency.
Start the development server:
pnpm devThe site will be available at http://localhost:7777.
Build the project for production:
pnpm buildThis will generate the production build in the .next directory.
Start the production server:
pnpm startRun the validation script to check your project setup:
bash validate.shThis will verify:
- ✅ Package.json configuration
- ✅ Content structure
- ✅ MDX frontmatter
- ✅ Dependencies
- ✅ Vercel configuration
- ✅ Git ignore settings
- Install Vercel CLI:
npm i -g vercel- Deploy from the example directory:
cd example
vercel- Push this example to your GitHub repository
- Import the project in Vercel
- Set the Root Directory to
example - Vercel will auto-detect Next.js settings
No special configuration is needed. Vercel will automatically:
- Detect the Next.js framework
- Use
pnpm build(viaobjectdocs build) as the build command - Use the
.nextdirectory as the output
Use this checklist to validate the example works correctly:
-
pnpm installcompletes without errors -
pnpm devstarts the development server - All pages load correctly in the browser
- Navigation works (sidebar, header links)
-
pnpm buildcompletes successfully -
pnpm startserves the production build - Deployment to Vercel succeeds
- Deployed site is fully functional
Solution: Make sure you're using the published version of @objectdocs/cli from npm, not a workspace reference.
Possible causes:
- Using
workspace:*reference instead of npm version - Missing or incorrect
package.jsonscripts - Node.js version incompatibility
Solution:
- Check that
package.jsonuses"@objectdocs/cli": "^0.2.11"(or latest version) - Ensure build script is
"build": "objectdocs build" - Verify Node.js version is 18+
Solution:
- Verify all pages listed in
meta.jsonhave corresponding.mdxfiles - Check that file names match exactly (case-sensitive)
- Ensure frontmatter includes both
titleanddescription
When a new version of @objectdocs/cli is published:
pnpm up @objectdocs/cli- Create a new
.mdxfile incontent/docs/ - Add the page slug to
content/docs/meta.json - Include proper frontmatter in the MDX file
Edit content/docs.site.json to change:
- Site name
- Logo images
- Navigation links
- Build output type
This example is part of the ObjectDocs project. If you find issues or have improvements:
- Test your changes in this example first
- Ensure deployment still works
- Submit a PR with clear description
MIT - Same as the main ObjectDocs project