# Use and adapt qchat

Use the documented interfaces and source layout for **qchat**. The sections below retain the README’s examples and configuration details.

## Diagnostic Commands

- `npm run install:ci`: perform the one locked dependency install
- `npm run dev`: start the Vite/Vinext development server
- `npm run build`: build the deployable Sites artifact
- `npm run start`: preview the built Worker locally with D1/R2 support
- `npm run db:generate`: generate Drizzle migrations after schema changes

When using the Sites plugin, follow its skill instructions for installation, builds, and publishing. These npm commands remain available for standalone use.

The portable build runs Vinext directly without a host `timeout` command. The managed-linux build uses `scripts/build-verified.sh` and its existing `SITES_BUILD_TIMEOUT` setting.

## Commands in the root manifest

The captured [package.json](https://github.com/qentrah/qchat/blob/HEAD/package.json) declares the following scripts. Run them from the directory containing that manifest.

| Command | Script |
| --- | --- |
| `npm run dev` | `node scripts/run-framework.mjs dev` |
| `npm run build` | `npm run build:packages && node scripts/run-framework.mjs build` |
| `npm run build:packages` | `npm run build --workspaces --if-present` |
| `npm run test` | `vitest run` |
| `npm run typecheck` | `tsc --noEmit` |
| `npm run start` | `node --import ./scripts/sites-env.mjs ./node_modules/wrangler/bin/wrangler.js dev --config dist/server/wrangler.json --local --persist-to .wrangler/state --ip 127.0.0.1 --inspector-port 0` |
| `npm run lint` | `eslint . --ignore-pattern dist --ignore-pattern .next` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-qchat/quick-start-guide).
2. Compare required configuration and dependency versions with the README.
3. Check the linked issue tracker for the same error. Include the command, runtime version, and relevant error when reporting a problem; omit credentials.

## Source and help

- [GitHub repository](https://github.com/qentrah/qchat)
- [Original README](https://github.com/qentrah/qchat/blob/main/README.md)
- [Issues and existing reports](https://github.com/qentrah/qchat/issues)

The catalog identifies the license as **MIT**. Read the repository license before redistributing source or assets.