> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayekun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NodeForgeCMS Quickstart: Your First Instance in 10 Minutes

> Run NodeForgeCMS on your local machine in under 10 minutes. Covers cloning, environment setup, database init, and your first admin login.

This guide gets you from zero to a fully running NodeForgeCMS instance on your local machine. By the end you'll have the backend server, frontend, and admin dashboard all running — ready for you to log in and start building.

<Steps>
  <Step title="Check Prerequisites">
    Before you begin, make sure the following are installed and running on your machine:

    * **Node.js 20.x** — NodeForgeCMS requires Node 20 or later.
    * **MySQL 8.x** — The primary data store for all CMS content and configuration.
    * **Redis 7** — Used for session caching and performance optimization.
    * **pnpm** — The package manager used across both the server and admin packages.

    Confirm your versions before continuing to avoid setup issues.
  </Step>

  <Step title="Clone the Repository and Install Dependencies">
    Clone the NodeForgeCMS repository, then install dependencies for both the `server/` and `admin/` packages separately.

    ```bash theme={null}
    git clone https://github.com/your-org/node-forge-cms.git
    cd node-forge-cms
    ```

    Install server dependencies:

    ```bash theme={null}
    cd server
    pnpm install
    ```

    Install admin panel dependencies:

    ```bash theme={null}
    cd ../admin
    pnpm install
    ```
  </Step>

  <Step title="Configure Environment Variables">
    Create a `.env` file in the `server/` directory. You can copy the provided example file and fill in your values:

    ```bash theme={null}
    cp server/.env.example server/.env
    ```

    Edit `server/.env` with your local configuration:

    ```ini server/.env theme={null}
    DATABASE_USERNAME=root
    DATABASE_PASSWORD=your_password
    DATABASE_HOST=127.0.0.1
    DATABASE_PORT=3306
    DATABASE_DB=node_forge_cms

    JWT_SECRET=your_secret_key

    REDIS_HOST=127.0.0.1
    REDIS_PORT=6379
    REDIS_DB=5

    SERVER_HOST=http://127.0.0.1:3000
    IMG_HOST=http://127.0.0.1:3000

    FORM_USER_EMAIL=
    FORM_USER_EMAIL_PASSWORD=
    USER_EMAIL_SERVICE=QQ
    ```

    Replace `your_password` and `your_secret_key` with your own values. The email fields are optional for local development.
  </Step>

  <Step title="Initialize the Database">
    Create the `node_forge_cms` database in MySQL, then import the bundled SQL schema and seed file:

    ```bash theme={null}
    mysql -u root -p -e "CREATE DATABASE node_forge_cms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
    mysql -u root -p node_forge_cms < server/sql/node_forge_cms.sql
    ```

    This creates all required tables and inserts default configuration data, including the initial admin user.
  </Step>

  <Step title="Start the Development Server">
    From the project root, start the Nuxt4 backend and frontend server:

    ```bash theme={null}
    cd server && pnpm dev
    ```

    The server will start at **[http://localhost:3000](http://localhost:3000)**. You can visit this URL to see the public-facing site frontend.
  </Step>

  <Step title="Start the Admin Panel">
    Open a second terminal and start the admin panel:

    ```bash theme={null}
    cd admin && pnpm dev
    ```

    The admin dashboard will be available at **[http://localhost:4000](http://localhost:4000)**.

    Log in with the default credentials:

    | Field    | Value      |
    | -------- | ---------- |
    | Username | `admin`    |
    | Password | `admin123` |

    <Warning>
      Change the default admin password immediately after your first login. Do not use `admin123` in any environment beyond initial local development.
    </Warning>
  </Step>
</Steps>

<Tip>
  This quickstart uses development mode for both packages. For production deployment — including PM2 process management, production builds, and shared vs. separate domain configurations — see the [full Installation Guide](/installation).
</Tip>
