# DesignX

AI-powered product design pipeline — from brief to working app.

DesignX is a local-first design tool that runs entirely on your machine. It uses your GitHub Copilot subscription to guide you through a structured design process: research, personas, journey maps, feature trees, data models, and generated code — all in one place.

## Requirements

- Node.js 18 or later
- An active [GitHub Copilot](https://github.com/features/copilot) subscription

## Getting started

```bash
npx @studioindia/designx
```

That's it. DesignX starts a local server on port 3000 and opens the UI in your default browser. All your data is stored in `~/DesignX/` on your own machine — nothing is sent to any external server.

On first launch, click **Connect GitHub Copilot** and follow the Device Flow prompt to authenticate with your GitHub account.

## Options

```
designx [options]

  --port <port>       Port to listen on            (default: 3000)
  --data-dir <path>   Where to store project data  (default: ~/DesignX)
  --no-open           Do not open browser automatically
  --version, -v       Print version
  --help,    -h       Print help
```

## Examples

```bash
# Default
npx @studioindia/designx

# Custom port
npx @studioindia/designx --port 8080

# Custom data directory
npx @studioindia/designx --data-dir ~/Documents/my-designx

# Headless (no browser auto-open)
npx @studioindia/designx --no-open
```

## Data directory layout

```
~/DesignX/
├── data/
│   ├── kb-jobs.json
│   └── agent-runs.json
└── projects/
    └── {project-slug}/
        ├── project.json
        ├── conversation.json
        ├── artifacts.json
        ├── session.json
        ├── uploads/        ← knowledge base files
        └── built-app/      ← exported generated code
```

## How authentication works

DesignX uses [GitHub Device Flow](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#device-flow) — the same flow used by the GitHub CLI. You are redirected to `github.com/login/device`, enter a short code, and authorize the app with your own GitHub account. No passwords are stored by DesignX. Your access token lives only in your local `~/DesignX/` directory.

## Updates

DesignX checks for new versions on startup. When an update is available, a banner appears in the UI with a **Relaunch to update** button — click it and DesignX restarts with the latest version automatically.

To update manually:

```bash
npx @studioindia/designx@latest
```

## License

MIT
