From fde9690a4eaf048bb95de880ffff7e69f4cb73b4 Mon Sep 17 00:00:00 2001 From: Mohit Jeswani <2022.mohit.jeswani@ves.ac.in> Date: Thu, 21 May 2026 03:18:06 +0530 Subject: [PATCH] feat: add devcontainer for documentation development Signed-off-by: Mohit Jeswani <2022.mohit.jeswani@ves.ac.in> --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..be7e7a8be --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "Kmesh Website Development", + "image": "mcr.microsoft.com/devcontainers/javascript-node:20", + + // Install dependencies using yarn to match the project's lockfile + "postCreateCommand": "yarn install --frozen-lockfile", + + // Forward Docusaurus dev server port + "forwardPorts": [3000], + "portsAttributes": { + "3000": { + "label": "Docusaurus Dev Server", + "onAutoForward": "openBrowser" + } + }, + + // VS Code extensions and settings for documentation development + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "streetsidesoftware.code-spell-checker", + "yzhang.markdown-all-in-one", + "dbaeumer.vscode-eslint" + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "bash" + } + } + } +} diff --git a/README.md b/README.md index f3e3b414a..31019c187 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,41 @@ updates: --- +## Development Environment + +You can start developing with zero manual setup using either **GitHub Codespaces** or **VS Code Dev Containers**. + +### Option 1: GitHub Codespaces (Recommended) + +Click the button below to open the project in a ready-to-code cloud environment: + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/kmesh-net/website) + +Once the Codespace is ready, start the dev server: + +```bash +npm start +# or +yarn start +``` + +### Option 2: VS Code Dev Containers (Local) + +1. Install [Docker](https://www.docker.com/products/docker-desktop) and the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for VS Code. +2. Clone the repository and open it in VS Code. +3. When prompted, click **"Reopen in Container"** — or run the command **Dev Containers: Reopen in Container** from the Command Palette. +4. Dependencies are installed automatically. Start the dev server: + + ```bash + npm start + # or + yarn start + ``` + +Both options provide a pre-configured environment with Node.js 20 and recommended VS Code extensions for documentation development. + +--- + ## How to Install The Kmesh website is built using **Docusaurus** with React. Follow these steps to install and run it: