datasqwers 0.0.0-stage → 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ali
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,201 @@
1
- # Temporary Holding Version
1
+ # Datasqwers
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
+ Responsive dashboards in the browser that refresh immediately as you select filters. Click any
4
+ value in a filter box and every chart, KPI, table and filter box updates almost instantly. Values
5
+ show as **indigo** (selected), **plain** (possible), **light indigo** (alternatives) or **faded**
6
+ (excluded), so you always see what your selection includes and what it rules out.
7
+
8
+ You don't build dashboards by dragging things around. You tell Claude what you want, and Claude
9
+ writes the dashboard for you.
10
+
11
+ Your tables are threaded together on their shared fields, like pieces on a skewer: pull on one
12
+ and the rest move with it.
13
+
14
+ ## What it needs: four ingredients
15
+
16
+ 1. **Connection**: how to reach your data (a database, or CSV/Excel/Parquet files)
17
+ 2. **Queries**: which tables or views to pull (ideally clean, analytics-ready views)
18
+ 3. **Links**: which fields connect those tables (e.g. `CustomerID`)
19
+ 4. **UI**: what you want to see: filters, KPIs, charts, tables
20
+
21
+ You only provide #1. Then tell Claude what you want to see, and Claude fills in #2–#4.
22
+
23
+ ## What you need on your computer
24
+
25
+ - A **Mac or Windows** computer (Linux works too).
26
+ - **Node.js** 20 or later (free; step 1 below).
27
+ - **Claude Code** (step 2 below). It needs a paid Claude plan (Pro, Max, Team or Enterprise) or an
28
+ Anthropic API account.
29
+ - **Your data**, when you're ready for it. You can start with the built-in example and no data at
30
+ all.
31
+
32
+ ## 1. Install Node.js (once)
33
+
34
+ Download the **LTS** installer from [nodejs.org](https://nodejs.org/en/download) and run it.
35
+ Or, if you use a package manager:
36
+
37
+ | Mac (Homebrew) | Windows (PowerShell or Command Prompt) |
38
+ |---|---|
39
+ | `brew install node` | `winget install OpenJS.NodeJS.LTS` |
40
+
41
+ Then open a **new** terminal window and check that it worked:
42
+
43
+ ```bash
44
+ node --version
45
+ ```
46
+
47
+ It should print `v20` or higher. On a Mac the terminal is the **Terminal** app; on Windows, use
48
+ **PowerShell** or **Command Prompt** from the Start menu.
49
+
50
+ ## 2. Install Claude Code (once)
51
+
52
+ Either install the **Claude desktop app** ([download](https://claude.ai/download)) and use its
53
+ **Code** tab, or install Claude Code in the terminal:
54
+
55
+ **Mac:**
56
+
57
+ ```bash
58
+ curl -fsSL https://claude.ai/install.sh | bash
59
+ ```
60
+
61
+ **Windows (PowerShell):**
62
+
63
+ ```powershell
64
+ irm https://claude.ai/install.ps1 | iex
65
+ ```
66
+
67
+ Then run `claude` once and sign in. More options and help:
68
+ [Claude Code setup](https://code.claude.com/docs/en/setup).
69
+
70
+ ## 3. Make a folder for your dashboards
71
+
72
+ Any empty folder works. In the desktop app, create it in Finder or File Explorer and choose it
73
+ when you start a session. In the terminal:
74
+
75
+ **Mac:**
76
+
77
+ ```bash
78
+ mkdir ~/dashboards && cd ~/dashboards && claude
79
+ ```
80
+
81
+ **Windows (PowerShell):**
82
+
83
+ ```powershell
84
+ mkdir $HOME\dashboards; cd $HOME\dashboards; claude
85
+ ```
86
+
87
+ ## 4. Tell Claude to set it up
88
+
89
+ Paste this to Claude:
90
+
91
+ > Set up Datasqwers in this folder: run `npx datasqwers@latest init --example`, then read
92
+ > DATASQWERS.md and follow it from now on. Pull the example data, start the dashboard server in
93
+ > the background, and give me the link.
94
+
95
+ Claude creates the project, builds a sample shop dashboard from made-up data, and gives you a link
96
+ such as http://localhost:5173. Open it and click around: select a region, a year or a customer,
97
+ and watch everything update.
98
+
99
+ From now on, Claude reads `DATASQWERS.md` whenever you work in this folder, so it knows how to
100
+ build and change your dashboards.
101
+
102
+ ## 5. Use your own data
103
+
104
+ **From a database.** Connection details go in a file called `.env` in the folder, and nowhere
105
+ else. Don't paste passwords into the chat. Open the file:
106
+
107
+ | Mac | Windows |
108
+ |---|---|
109
+ | `open -e .env` | `notepad .env` |
110
+
111
+ and add one line, giving the connection a name you'll use with Claude:
112
+
113
+ ```
114
+ SALES_DB=postgresql://user:password@host:5432/dbname
115
+ ```
116
+
117
+ MySQL (`mysql://user:password@host:3306/db`), SQLite (`sqlite:C:/path/to/file.db` or
118
+ `sqlite:/Users/me/file.db`) and DuckDB (`duckdb:path`) work too. Use forward slashes in paths,
119
+ even on Windows.
120
+
121
+ **From files.** Put your CSV, Excel or Parquet files in the folder (or tell Claude where they
122
+ are). No `.env` entry is needed.
123
+
124
+ **Then ask for what you want to see**, for example:
125
+
126
+ > Build a sales dashboard from SALES_DB. Use the views in the `analytics` schema. I want filters
127
+ > for year, region, product category and customer; KPIs for revenue, margin and order count;
128
+ > revenue by month vs budget; top products; and a top-customers table.
129
+
130
+ or
131
+
132
+ > Build a dashboard from orders.csv and customers.xlsx. They share the customer ID. Show sales
133
+ > by month and by region, and the top 20 customers.
134
+
135
+ Claude looks at your data, writes the data model and the dashboard, pulls the data, and checks
136
+ that everything links up correctly. To change anything ("move the region filter to the top",
137
+ "add a margin % column", "split revenue by channel"), just ask. The page updates as soon as the
138
+ files change.
139
+
140
+ ## Everyday use
141
+
142
+ Claude runs these for you, but you can also run them yourself in the folder:
143
+
144
+ ```bash
145
+ npx datasqwers dev
146
+ ```
147
+
148
+ This opens the dashboards at http://localhost:5173 (or the next free port); add `?d=<name>` to the
149
+ address to pick one. Stop it with Ctrl+C.
150
+
151
+ ```bash
152
+ npx datasqwers refresh sales
153
+ ```
154
+
155
+ This pulls fresh data for the `sales` model, and the open page reloads by itself. Your database is
156
+ only queried during a refresh; all clicking and filtering happens in the browser.
157
+
158
+ ## Troubleshooting
159
+
160
+ - **`node` or `npx` is "not recognized" or "not found".** Open a new terminal window after
161
+ installing Node.js. On Windows, if it still fails, restart the computer.
162
+ - **Windows: "running scripts is disabled on this system".** PowerShell is blocking `npx`. Type
163
+ `npx.cmd` instead of `npx` (e.g. `npx.cmd datasqwers dev`), or use Command Prompt.
164
+ - **Mac: I can't see `.env` in Finder.** Files starting with a dot are hidden. Press
165
+ Cmd+Shift+. to show them, or open it with `open -e .env` as above.
166
+ - **The first refresh is slow, or fails without internet.** The first time it reads from
167
+ Postgres, MySQL, SQLite or Excel, Datasqwers downloads a small driver. After that it's cached.
168
+ - **A card on the dashboard shows an error.** Ask Claude to fix it: the message tells it what's
169
+ wrong. The **Data model** tab shows how your tables link and any warnings.
170
+
171
+ ## Good to know
172
+
173
+ - **Selecting values.** Click selects one value; ctrl/⌘-click adds more. Drag down a filter
174
+ box or across a chart to select a range. Back, Forward, History (jump to any earlier
175
+ selection) and Clear all are at the top right.
176
+ - **Size.** It runs comfortably up to a few million rows in the browser. For more, Claude can
177
+ summarise the data in the queries (e.g. daily totals instead of every order line).
178
+ - **Where things live:** `models/` (data models), `dashboards/` (layouts), `.env`
179
+ (connections), `data/` (pulled data), `DATASQWERS.md` (the guide Claude follows).
180
+ - **Sharing.** `npx datasqwers build` makes a static website in `dist/`. Anyone who can open it
181
+ can also download the data in it, so don't put it on a public server.
182
+ - **Updating.** Run `npx datasqwers@latest init` again to get the newest guide for Claude.
183
+
184
+ ## Developing Datasqwers itself
185
+
186
+ Clone this repo and run `npm install`. The repo is also a project folder: `npm run dev` serves
187
+ its `dashboards/` with hot reload of the app code, and `npm run refresh -- <model>` stands in for
188
+ `npx datasqwers refresh`. `npm run build` builds the package (`dist/app` and `dist/cli`); to try
189
+ it as a user would, run `npm pack` and then `npx /path/to/datasqwers-<version>.tgz init` in
190
+ another folder.
191
+
192
+ To try it on a larger demo database (needs Docker):
193
+
194
+ ```bash
195
+ npm run demo:db
196
+ npm run refresh -- demo
197
+ npm run dev
198
+ ```
199
+
200
+ `demo:db` starts a demo Postgres in Docker (1M sales lines, 20k customers). Remove it later with
201
+ `docker rm -f datasqwers-demo-pg`.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/cli/datasqwers.js';