hashquiz 0.0.0-stage → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,98 @@
1
+ # QuizV licensing
2
+
3
+ > **DRAFT — not yet reviewed by a lawyer.** The texts below describe the intended licensing model.
4
+ > They must be reviewed before the repository is made public.
5
+
6
+ QuizV is **fair-code open-core**. The repository contains code under three licenses.
7
+ See [`docs/LICENSING.md`](docs/LICENSING.md) for a plain-language FAQ.
8
+
9
+ | Tier | License | Applies to |
10
+ |------|---------|------------|
11
+ | Format & tooling | [MIT](packages/parser/LICENSE) | `packages/parser/` (the `.quizv.md` format), `.claude/plugins/quizv/` (Claude skills and commands), and any future MCP server package marked MIT |
12
+ | Product | **QuizV Sustainable Use License** (below) | Everything else, unless stated otherwise: `packages/core`, `packages/server`, `packages/transport-*`, `packages/ui`, `packages/theme-default`, `apps/host`, `apps/player`, `decks/`, `examples/` |
13
+ | Pro / Enterprise | [QuizV Enterprise License](LICENSE_EE.md) | `packages/ee/`, and any file whose name contains `.ee.` or whose path contains a `.ee` directory |
14
+
15
+ When a directory contains its own `LICENSE` file, that file takes precedence for its contents.
16
+
17
+ Versions of QuizV released before this change (up to and including v2.0.0) remain available under the MIT license.
18
+
19
+ ---
20
+
21
+ ## QuizV Sustainable Use License
22
+
23
+ Version 1.0 (draft)
24
+
25
+ Copyright (c) 2024-present Maxime Lenne
26
+
27
+ ### Acceptance
28
+
29
+ By using the software, you agree to all of the terms and conditions below.
30
+
31
+ ### Copyright license
32
+
33
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to
34
+ use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the
35
+ limitations below.
36
+
37
+ ### Limitations
38
+
39
+ 1. You may use or modify the software only:
40
+ - for your own internal business purposes;
41
+ - for personal or non-commercial purposes; or
42
+ - to host and run quiz sessions for your own audiences — including paid trainings, courses, workshops,
43
+ conferences and events that you or your organization deliver.
44
+ 2. You may not provide the software to third parties as a hosted or managed service, where those third parties
45
+ create, host or run their own quizzes or quiz sessions through your deployment of the software, whether or not
46
+ you charge for it.
47
+ 3. You may not sell, resell, rent, white-label or embed the software, or a derivative work of it, in a product or
48
+ service offered to third parties, except under a separate commercial agreement with the licensor.
49
+ 4. You may distribute the software or provide it to others only if you do so free of charge for non-commercial
50
+ purposes.
51
+ 5. You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the
52
+ software, and you may not move, change, disable, or circumvent the license key functionality.
53
+
54
+ ### Notices
55
+
56
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
57
+ If you modify the software, you must include in any modified copies a prominent notice stating that you have
58
+ modified the software.
59
+
60
+ ### Patents
61
+
62
+ The licensor grants you a license, under any patent claims the licensor can license or becomes able to license,
63
+ to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the
64
+ limitations and conditions in this license. This license does not cover any patent claims that you cause to be
65
+ infringed by modifications or additions to the software. If you or your company make any written claim that the
66
+ software infringes or contributes to infringement of any patent, your patent license for the software granted
67
+ under these terms ends immediately.
68
+
69
+ ### No other rights
70
+
71
+ These terms do not imply any licenses other than those expressly granted in these terms.
72
+
73
+ ### Termination
74
+
75
+ If you use the software in violation of these terms, such use is not licensed, and your license will automatically
76
+ terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this
77
+ license no later than 30 days after you receive that notice, your license will be reinstated retroactively.
78
+ However, if you violate these terms after such reinstatement, any additional violation of these terms will cause
79
+ your license to terminate automatically and permanently.
80
+
81
+ ### No liability
82
+
83
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not
84
+ be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind
85
+ of legal claim.
86
+
87
+ ### Definitions
88
+
89
+ - The **licensor** is the entity offering these terms.
90
+ - The **software** is the software the licensor makes available under these terms, including any portion of it.
91
+ - **You** refers to the individual or entity agreeing to these terms.
92
+ - **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
93
+ all organizations that have control over, are under the control of, or are under common control with that
94
+ organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
95
+ management and policies by vote, contract, or otherwise.
96
+ - **Your license** is the license granted to you for the software under these terms.
97
+ - **Use** means anything you do with the software requiring your license.
98
+ - **Trademark** means trademarks, service marks, and similar rights.
package/README.md CHANGED
@@ -1,3 +1,117 @@
1
- # Temporary Holding Version
1
+ # hashquiz
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Real-time multiplayer quiz (a Kahoot alternative) driven by Markdown decks.
4
+ This package ships the `hashquiz` CLI and the prebuilt host and player web apps,
5
+ so a repository only needs its decks.
6
+
7
+ Requires [Bun](https://bun.sh) 1.1 or later.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ bun add -d hashquiz@beta # prereleases until 1.0.0
13
+ ```
14
+
15
+ ## Decks repository layout
16
+
17
+ ```text
18
+ decks/
19
+ my-deck/
20
+ index.quizv.md
21
+ package.json
22
+ vercel.json
23
+ ```
24
+
25
+ Format reference: [deck format](https://github.com/WhiteWoodTech/hashquiz/blob/develop/docs/TECHNICAL_GUIDE.md).
26
+
27
+ ## Commands
28
+
29
+ ```bash
30
+ hashquiz check decks/my-deck/index.quizv.md # validate one deck
31
+ hashquiz dev decks/my-deck/index.quizv.md # local game: host :3031/host/, players :3032
32
+ hashquiz dev decks # same, a folder: solo decks folder, room deck = first deck by id
33
+ hashquiz build decks --out dist # static site with every deck under decks/
34
+ hashquiz supabase deploy --project <ref> # solo backend on a Supabase project
35
+ ```
36
+
37
+ `build` validates every `*.quizv.md` under the folder, copies the apps and
38
+ writes `host/decks.json` (host deck list), the same `decks.json` at the root
39
+ (player solo decks) and `quizv-config.js`. It reads the deployment settings
40
+ from the environment:
41
+
42
+ | Variable | Value |
43
+ | --- | --- |
44
+ | `HASHQUIZ_TRANSPORT` | `supabase` for a hosted game (default `local`) |
45
+ | `HASHQUIZ_SUPABASE_URL` | Supabase project URL |
46
+ | `HASHQUIZ_SUPABASE_ANON_KEY` | Supabase anon public key |
47
+ | `HASHQUIZ_SOLO_SCORING` | Solo run scoring: `browser` (default) or `edge` |
48
+ | `HASHQUIZ_PLAYER_URL` | Optional player URL for the host's solo links (default: same origin) |
49
+
50
+ The `QUIZV_*` and `VITE_*` names (`VITE_TRANSPORT`, …) are accepted too. The prebuilt apps carry no
51
+ settings of their own: whatever `quizv-config.js` says (including `local` and `browser`) is what they use.
52
+
53
+ Decks with `solo: true` in their frontmatter can also be played alone from
54
+ the player app. `hashquiz dev` serves solo on its own (port 3030): runs are stored in `.hashquiz/solo.db` of
55
+ the working directory (add `.hashquiz/` to `.gitignore`) and rescored by the server. The leaderboard exists only
56
+ on the machine running the server and the players must reach its port 3030, so it does not work for an https
57
+ static deploy (on an `https:` page the apps hide local solo). If `.hashquiz/solo.db` cannot be opened, the
58
+ server warns and runs rooms without solo. When a deck changes during a run, the score is not stored and the end
59
+ screen offers « Rejouer » with the new version. With `--decks <dir>` and a file, the solo decks come from that
60
+ folder. For a hosted site use the Supabase backend (see the hashquiz `docs/DEPLOY.md`).
61
+
62
+ ## Deploy the solo backend on Supabase
63
+
64
+ The package ships the Supabase project (`supabase/`: migrations, the `solo-submit` Edge Function and its
65
+ prebuilt core). After `hashquiz build`, deploy it with:
66
+
67
+ ```bash
68
+ HASHQUIZ_SITE_URL=https://<domain> hashquiz supabase deploy --project <project-ref> [--dry-run]
69
+ ```
70
+
71
+ It stages the project in a temp folder and runs `supabase link`, `supabase db push`,
72
+ `supabase functions deploy solo-submit` and `supabase secrets set HASHQUIZ_SITE_URL=…`, stopping at the first
73
+ failure. The function reads `<HASHQUIZ_SITE_URL>/decks.json` at runtime, so deck changes need no redeploy.
74
+ `--site-url <url>` overrides `HASHQUIZ_SITE_URL` (an http(s) URL). It needs the
75
+ [Supabase CLI](https://supabase.com/docs/guides/cli) on `PATH` (or `SUPABASE_BIN`), plus
76
+ `SUPABASE_ACCESS_TOKEN` and `SUPABASE_DB_PASSWORD` in the environment (CI secrets). `--dry-run` prints the
77
+ steps without running them. The command never changes `solo_settings`: switching to edge scoring means setting
78
+ `HASHQUIZ_SOLO_SCORING=edge` for `hashquiz build` **and** running
79
+ `update solo_settings set scoring_mode = 'edge'` once.
80
+
81
+ Typical CI of a decks repository (secrets `SUPABASE_ACCESS_TOKEN`, `SUPABASE_DB_PASSWORD`, `HASHQUIZ_SITE_URL`):
82
+
83
+ ```bash
84
+ hashquiz build decks --out dist
85
+ hashquiz supabase deploy --project <project-ref>
86
+ ```
87
+
88
+ ## Deploy on Vercel
89
+
90
+ `package.json`:
91
+
92
+ ```json
93
+ {
94
+ "scripts": { "build": "hashquiz build decks --out dist" },
95
+ "devDependencies": { "hashquiz": "^1.0.0-beta.2" }
96
+ }
97
+ ```
98
+
99
+ `vercel.json`:
100
+
101
+ ```json
102
+ {
103
+ "buildCommand": "bun run build",
104
+ "outputDirectory": "dist",
105
+ "framework": null,
106
+ "rewrites": [
107
+ { "source": "/host", "destination": "/host/index.html" },
108
+ { "source": "/host/(.*)", "destination": "/host/$1" },
109
+ { "source": "/((?!host/|host$).*)", "destination": "/$1" }
110
+ ]
111
+ }
112
+ ```
113
+
114
+ Set the three variables above in the Vercel project, then:
115
+
116
+ - `https://<domain>/` is the player join page
117
+ - `https://<domain>/host` is the host dashboard