OWOX Docs
This is the source code for the monorepo documentation site based on the Astro + Starlight project.
ποΈ Project Structure
Section titled βποΈ Project StructureβInside the OWOX Docs project (apps/docs
from the monorepo root), youβll find the following folders and files:
.βββ public/βββ scripts/β βββ env-config.js # Environment configuration scriptβ βββ sync-docs.js # Content and assets synchronization scriptβ βββ utils.js # Utils functions scriptβββ src/β βββ content.config.ts # Starlight content configurationβββ astro.config.mjsβββ package.jsonβββ tsconfig.json
βοΈ How it works
Section titled ββοΈ How it worksβUnlike a standard Starlight project, all documentation content is dynamically synced from the entire monorepo. The content is copied to the src/content/docs/
directory, and images are copied to src/assets/
during the development and build processes. You can also manually trigger the content update process by running the sync command.
The Starlight framework then looks for .md
or .mdx
files in the content directory. Each file is exposed as a route based on its file name.
Images are located in src/assets/
and can be embedded in Markdown using a relative link.
Static assets, such as favicons, can be placed in the public/
directory. These are not dynamically synced.
π Scripts
Section titled βπ ScriptsβThe scripts/
directory contains scripts for synchronizing documentation content and configuring the environment.
βΉοΈ For information about required environment variables for production, see β οΈ Environment Variables.
π§ Commands
Section titled βπ§ CommandsβYou can run commands from different directories in the monorepo.
π Commands from the monorepo root
Section titled βπ Commands from the monorepo rootβThese commands are run from the monorepo root in a terminal:
Command | Action |
---|---|
npm install | Installs all monorepo dependencies |
npm run dev:docs | Starts the local dev server at localhost:4321 |
npm run build:docs | Builds your production site to ./apps/docs/dist/ |
π Commands from the project root (/apps/docs
)
Section titled βπ Commands from the project root (/apps/docs)βThese commands are run from the project root in a terminal:
Command | Action |
---|---|
npm install | Installs project dependencies |
npm run sync | Copies content (.md files) and images to ./src/ |
npm run dev | Starts the local dev server at localhost:4321 |
npm run build | Builds your production site to ./dist/ |
npm run preview | Previews your build locally before deploying |
npm run astro ... | Runs CLI commands like astro add , astro check |
npm run astro -- --help | Gets help using the Astro CLI |
β οΈ Environment Variables
Section titled ββ οΈ Environment VariablesβBefore deploying to production, make sure to set all required environment variables.
These variables are processed by the env-config.mjs
script.