Skip to content

docs: update README how to build and run #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,79 @@ Stream data through multiple QRCodes

[Live demo](https://qrss.netlify.app/)

## Build & run

**1. Install Dependencies**

You need install [Node.js](https://nodejs.org) first.The project uses `pnpm` as its package manager. First, ensure you have `pnpm` installed:

```bash
npm install -g pnpm
```

Then, install the project dependencies:

```bash
pnpm install
```

**2. Build the Project**

Build the project using the command specified in the `package.json` and `netlify.toml`:

```bash
pnpm run build
```

This will generate the output in the `.output` directory.

Alternatively, if you want to run the development server to test changes:

```bash
pnpm run dev
```

**3. Serve the Project Locally**

if your target environment have `Node.js`, you can copy entire `.output` directory to where you want.You can preview this build using:

```bash
node .output/server/index.mjs
```

if your target environment don't have `Node.js`, you cat just host those static files.

```bash
cd .output/public
python -m http.server
```

You will usually encounter the following errors.

```
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
```

you need a custom web server, Run in the `.output/public` directory:

```python
# python custom_http_server.py
from http.server import SimpleHTTPRequestHandler, HTTPServer

class CustomHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.extensions_map.update({
".js": "application/javascript",
})
super().end_headers()

ADDR = '0.0.0.0'
PORT = 8000
with HTTPServer((ADDR, PORT), CustomHandler) as httpd:
print(f"Serving on http://{ADDR}:{PORT}")
httpd.serve_forever()
```

## Sub-packages

- [QiFi CLI](./packages/cli) - CLI for streaming QR code file transmission
Expand Down