This website is built using Docusaurus, a modern static website generator.
yarnyarn startThis command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
yarn buildThis command generates static content into the build directory and can be served using any static contents hosting service.
Using SSH:
USE_SSH=true yarn deployThis repository contains the source for the MonaDocs documentation website, built with Docusaurus v3.
Quick start
- Install dependencies (Node >= 20 recommended):
yarn- Start development server (hot reload):
yarn start- Build production site:
yarn build- Preview the built site locally:
yarn serveDeployment
- Deploy to GitHub Pages using SSH:
USE_SSH=true yarn deploy- Deploy with a username (no SSH):
GIT_USER=<YourGitHubUsername> yarn deployRepository layout — files you will touch most
docusaurus.config.js— main site configuration (navbar/footer, presets, GitHub pages settings).sidebars.js— programmatic sidebar generator for docs. Keep it in sync when adding folders or custom ordering.docs/— Markdown / MDX documentation. Subfolders may contain_category_.jsonto override category labels.blog/— blog posts (MD/MDX) and metadata (blog/authors.yml,blog/tags.yml).src/components/— custom React components used by pages and MDX (examples:HomepageFeatures,Portfolio,TechStack,Repositories).src/css/custom.cssandsrc/components/*/styles.module.css— global and component styles.static/— static files (images, assets) that are copied to the final build.
Important project conventions and gotchas
- Node runtime: Docusaurus config runs in Node — do not reference
window/documentor browser-only APIs at top-level of config or sidebars. - Client-only browser APIs (localStorage, navigator.clipboard) must be used in client-side effects (
useEffect) or guarded withtypeof window !== 'undefined'to avoid SSG build errors. - Docs folder indexing: prefer a single
index.mdorindex.mdxper folder — having both can create duplicate sidebar entries.sidebars.jscontains extra deduplication logic but prefer one canonical index file. - Tech doc links: the project maps certain technology names to docs slugs (see
src/components/Portfolio/index.jsTECH_SLUGS) — when adding tech pages, add corresponding slugs to avoid broken-link checks.
Caching and runtime patterns
- The
Repositoriescomponent uses client-side GitHub API requests with an in-browser cache (localStorage) and TTL to avoid hitting unauthenticated rate limits. Look for cache keys likemona_repos_cache_v1and persisted preferences likemona_repos_source. - When adding features that fetch external APIs, implement caching and graceful fallback for CI/build environments.
Developer workflows & validation
- Local development:
yarn start(dev server, port 3000 by default). - Production validation:
yarn buildthenyarn serveto preview the static output. - Troubleshooting common build errors:
localStorage is not definedduringyarn build— caused by reading browser APIs during SSR. Move access intouseEffector guard withtypeof window !== 'undefined'.- Duplicate sidebar entries — check for both
index.mdandindex.mdxin the same folder. - Broken link checks — update
TECH_SLUGSor create the missing docs pages.
Testing
- There are no automated unit tests in this repo by default. Quick validation is done by building (
yarn build) and visually inspectingbuild/or runningyarn serve.
Making changes
- To add a new doc: create
docs/<section>/your-doc.mdor.mdx. Use_category_.jsonwhen you need a custom label/description. - To add a homepage component, edit or add files under
src/components/and import them fromsrc/pages/index.jsor from MDX files. - For visual changes, build and preview the production output and include screenshots in PRs when helpful.
Contact / ownership
- Project owner/maintainer: Marcelo (GitHub:
marcelo-m7). For quick questions, open an issue or a PR with the proposed change.
If you'd like, I can add repository-specific checklists (pre-merge build steps, code owners) or an example Playwright script to capture UI screenshots during PR validation.
This README is generated from repository conventions and recent code patterns. If anything above is outdated or you want more detail for a section (build matrix, CI, or developer scripts), tell me which area to expand and I'll update it.