Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy to Vercel

on:
push:
branches:
- main
- master
paths:
- 'apps/docs/**'
pull_request:
branches:
- main
- master
paths:
- 'apps/docs/**'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build docs
run: pnpm --filter docs build

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
working-directory: ./apps/docs
vercel-args: '--prod'
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')

- name: Deploy Preview to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
working-directory: ./apps/docs
if: github.event_name == 'pull_request'
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/.idea
/dist
/node_modules
/public
/resources/img

/package-lock.json
pnpm-lock.yaml
38 changes: 38 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Dependencies
node_modules
.pnp
.pnp.js

# Testing
coverage

# Next.js
.next/
out/

# Production
build/
dist/

# Misc
.DS_Store
*.tsbuildinfo

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Vercel
.vercel

# Other packages in monorepo
packages/
plugins/
!apps/docs/
8 changes: 8 additions & 0 deletions apps/docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "next/core-web-vitals",
"rules": {
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "off",
"@next/next/no-img-element": "off"
}
}
38 changes: 38 additions & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

package-lock.json
17 changes: 17 additions & 0 deletions apps/docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Creative Commons Attribution-NonCommercial 4.0 International
CC BY-NC 4.0

By using this work, you agree to the following terms:

You are free to:
- **Share** — copy and redistribute the material in any medium or format
- **Adapt** — remix, transform, and build upon the material

Under the following conditions:
- **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
- **NonCommercial** — You may not use the material for **commercial purposes**.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Full license text available at:
[creativecommons.org](https://creativecommons.org/licenses/by-nc/4.0/legalcode)
87 changes: 87 additions & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Magic Docs

Magic Docs by Once UI is a simple, modern, MDX-based documentation system built with Next.js. It automatically generates navigation based on the MDX files in the content directory. It comes with a built-in roadmap and changelog.

View the demo [here](https://docs.once-ui.com).

![Magic Docs](public/images/cover.jpg)

## Getting started

**1. Clone the repository**
```
git clone https://github.com/once-ui-system/magic-docs.git
```

**2. Install dependencies**
```
npm install
```

**3. Run dev server**
```
npm run dev
```

**4. Edit config**
```
src/resources/once-ui.config.js
```

**5. Create documentation pages**
```
Add new .mdx files to src/content/
```

Read the full documentation [here](https://docs.once-ui.com/magic-docs/quick-start).

## Features

### Once UI
- All tokens, components & features of [Once UI](https://once-ui.com) available through NPM

### SEO
- Automatic open-graph and X image generation with next/og
- Automatic schema and metadata generation based on the content file

### Pages
- Roadmap: when enabled, task progress is displayed in the homepage
- Changelog: when enabled, last changes are displayed in the homepage

### Design
- Responsive layout optimized for all screen sizes
- Timeless design without heavy animations and motion
- Endless customization options through [Once UI](https://docs.once-ui.com/once-ui/contexts/themeProvider)
- Light and dark mode support with system preference detection

### Navigation
- Organized documentation structure with nested categories
- Searchable content with command palette (Cmd+K / Ctrl+K)
- Automatically generated, responsive sidebar

Magic Docs was built with [Once UI](https://once-ui.com) for [Next.js](https://nextjs.org). It requires Node.js v18.17+.

## Creators

Lorant One: [Threads](https://www.threads.net/@lorant.one) / [LinkedIn](https://www.linkedin.com/in/lorant-one/)

## Get involved

- Join the Design Engineers Club on [Discord](https://discord.com/invite/5EyAQ4eNdS) and share your project with us!
- Deployed your docs? Share it on the [Once UI Hub](https://once-ui.com/hub) too! We feature our favorite apps on our landing page.

## Magic Docs

This project is built with [Magic Docs](https://once-ui.com/products/magic-docs). Build your own documentation with Magic Docs for free!

## License

Distributed under the CC BY-NC 4.0 License.
- Attribution is required.
- Commercial usage is not allowed.
- You can extend the license to [Dopler CC](https://dopler.app/license) by purchasing a [Once UI Pro](https://once-ui.com/pricing) license.

See `LICENSE.txt` for more information.

## Deploy with Vercel
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fonce-ui-system%2Fmagic-docs&project-name=magic-docs&repository-name=magic-docs&redirect-url=https%3A%2F%2Fgithub.com%2Fonce-ui-system%2Fmagic-docs&demo-title=Magic%20Docs&demo-description=Showcase%20your%20designers%20or%20developer%20portfolio&demo-url=https%3A%2F%2Fdemo.magic-docs.com&demo-image=%2F%2Fraw.githubusercontent.com%2Fonce-ui-system%2Fmagic-docs%2Fmain%2Fpublic%2Fimages%2Fcover.jpg)
30 changes: 30 additions & 0 deletions apps/docs/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": { "recommended": true }
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
64 changes: 64 additions & 0 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/** @type {import('next').NextConfig} */
import withMDX from '@next/mdx'

const withMDXConfig = withMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
},
})

const nextConfig = {
sassOptions: {
compiler: "modern",
silenceDeprecations: ["legacy-js-api"],
},
pageExtensions: ["ts", "tsx", "md", "mdx"],
transpilePackages: ["next-mdx-remote"],
output: 'standalone',
experimental: {
serverMinification: true,
serverActions: {
bodySizeLimit: '2mb',
},
// Optimize package imports for react-icons
optimizePackageImports: ['react-icons'],
},
// Configure image optimization
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
// Reduce webpack cache size
webpack: (config, { dev, isServer }) => {
// Only enable source maps in development
if (!dev) {
config.devtool = false;
}

// Optimize bundle size
config.optimization = {
...config.optimization,
moduleIds: 'deterministic',
};

// Disable persistent caching in production to reduce size
if (!dev) {
config.cache = false;
}

return config;
},
// Disable webpack cache in production
generateBuildId: async () => {
return `build-${Date.now()}`;
},
};

export default withMDXConfig(nextConfig);
Loading
Loading