@argus-vrt/web 0.1.0 → 0.2.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.
Files changed (51) hide show
  1. package/README.md +100 -107
  2. package/dist-cli/index.js +568 -0
  3. package/package.json +27 -14
  4. package/.cta.json +0 -15
  5. package/DEPLOYMENT.md +0 -154
  6. package/Dockerfile +0 -51
  7. package/docker-compose.prod.yml +0 -38
  8. package/docker-compose.yml +0 -15
  9. package/drizzle/0000_slim_makkari.sql +0 -61
  10. package/drizzle/meta/0000_snapshot.json +0 -452
  11. package/drizzle/meta/_journal.json +0 -13
  12. package/drizzle.config.ts +0 -10
  13. package/public/favicon.ico +0 -0
  14. package/public/logo-argus.svg +0 -8
  15. package/public/logo-variants/logo-argus-a.svg +0 -9
  16. package/public/logo-variants/logo-argus-modern.svg +0 -11
  17. package/public/logo-variants/logo-argus-peacock.svg +0 -8
  18. package/public/logo192.png +0 -0
  19. package/public/logo512.png +0 -0
  20. package/public/manifest.json +0 -25
  21. package/public/robots.txt +0 -3
  22. package/public/tanstack-circle-logo.png +0 -0
  23. package/public/tanstack-word-logo-white.svg +0 -1
  24. package/scripts/backfill-kind.ts +0 -148
  25. package/src/api-plugin.ts +0 -169
  26. package/src/components/image/ImageCompare.tsx +0 -188
  27. package/src/components/story/StoryFlatList.tsx +0 -67
  28. package/src/components/story/StoryGroupedTree.tsx +0 -273
  29. package/src/components/story/StoryTree.tsx +0 -185
  30. package/src/components/ui/Drawer.tsx +0 -110
  31. package/src/components/ui/SearchInput.tsx +0 -95
  32. package/src/components/ui/StatusBadge.tsx +0 -59
  33. package/src/components/ui/ViewModeToggle.tsx +0 -39
  34. package/src/db/index.ts +0 -27
  35. package/src/db/schema.ts +0 -151
  36. package/src/hooks/useDebounce.ts +0 -23
  37. package/src/hooks/useStoryTree.ts +0 -205
  38. package/src/lib/utils.ts +0 -55
  39. package/src/logo.svg +0 -12
  40. package/src/routeTree.gen.ts +0 -177
  41. package/src/router.tsx +0 -17
  42. package/src/routes/__root.tsx +0 -174
  43. package/src/routes/branches/$name.tsx +0 -171
  44. package/src/routes/branches/index.tsx +0 -104
  45. package/src/routes/index.tsx +0 -178
  46. package/src/routes/tests/$id.tsx +0 -417
  47. package/src/routes/tests/index.tsx +0 -128
  48. package/src/routes/upload.tsx +0 -108
  49. package/src/styles.css +0 -213
  50. package/tsconfig.json +0 -28
  51. package/vite.config.ts +0 -30
package/README.md CHANGED
@@ -1,157 +1,150 @@
1
1
  # @argus-vrt/web
2
2
 
3
- **Web dashboard for reviewing visual regression test results.**
3
+ **CLI tool for deploying and managing the Argus web dashboard.**
4
4
 
5
- A self-hosted dashboard that pairs with [@argus-vrt/cli](https://www.npmjs.com/package/@argus-vrt/cli) to give your team a visual review interface for screenshot diffs — similar to Chromatic, but self-hosted.
5
+ The Argus web dashboard is a self-hosted review interface for visual regression test results — similar to Chromatic, but self-hosted. This package provides an interactive CLI to set up and manage the dashboard via Docker.
6
6
 
7
- ## Features
7
+ ## Quick Start
8
8
 
9
- - **Test Overview** - Dashboard showing all test runs with status badges
10
- - **Image Comparison** - Four view modes:
11
- - Side by Side - Compare baseline and current screenshots
12
- - Diff Only - View the difference image
13
- - Overlay - See diff highlights overlaid on current screenshot with adjustable opacity
14
- - Current Only - View just the current screenshot
15
- - **Story Browser** - Three organization modes:
16
- - Flat list - Simple alphabetical list
17
- - Tree view - Grouped by component name
18
- - Grouped view - Organized by directory structure
19
- - **Search** - Typeahead search with Cmd/Ctrl+K keyboard shortcut
20
- - **Filtering** - Filter stories by status (all, changed, new, passed)
21
- - **Mobile Responsive** - Drawer-based navigation on mobile devices
22
- - **Dark Mode** - Full dark mode support
9
+ ```bash
10
+ # Run the interactive setup wizard
11
+ npx @argus-vrt/web init
23
12
 
24
- ## Deployment
13
+ # Start the dashboard
14
+ npx @argus-vrt/web start
25
15
 
26
- ### Quick Start with Docker
16
+ # Open http://localhost:3000
17
+ ```
27
18
 
28
- ```bash
29
- # Clone the repo
30
- git clone https://github.com/maxcwolf/argus.git
31
- cd argus/packages/web
19
+ The `init` wizard generates a `docker-compose.yml`, `.env`, and optionally `nginx.conf` in an `./argus/` directory.
32
20
 
33
- # Start the dashboard and database
34
- docker compose -f docker-compose.prod.yml up -d
21
+ ## Prerequisites
35
22
 
36
- # Run database migrations (first time only)
37
- docker compose -f docker-compose.prod.yml exec web npx drizzle-kit push
38
- ```
23
+ - [Docker](https://docs.docker.com/get-docker/) installed and running
24
+ - Node.js >= 20 (for running the CLI via npx)
25
+ - A [GitHub OAuth App](https://github.com/settings/developers) for authentication
39
26
 
40
- The dashboard will be available at `http://localhost:3000`.
27
+ ## Authentication
41
28
 
42
- ### Configuration
29
+ Argus requires GitHub OAuth for login. All browser routes are protected — unauthenticated users are redirected to GitHub to sign in.
43
30
 
44
- Create a `.env` file to customize settings:
31
+ The `/api/upload` endpoint used by CI/CD is authenticated separately via API key (`Authorization: Bearer <key>` header), so pipelines don't need GitHub credentials.
45
32
 
46
- ```bash
47
- PORT=3000
48
- DB_PASSWORD=your-secure-password
33
+ ### Setting Up GitHub OAuth
49
34
 
50
- # Path to screenshots directory (for image serving)
51
- SCREENSHOTS_PATH=/path/to/your/screenshots
52
- ```
35
+ 1. Go to [GitHub Developer Settings](https://github.com/settings/developers) **New OAuth App**
36
+ 2. Set the **Authorization callback URL** to `https://your-domain.com/auth/github/callback` (or `http://localhost:3000/auth/github/callback` for local development)
37
+ 3. Save the **Client ID** and generate a **Client Secret**
38
+ 4. Provide these values when running `npx @argus-vrt/web init`
53
39
 
54
- ### Environment Variables
40
+ ## Commands
55
41
 
56
- | Variable | Default | Description |
57
- |----------|---------|-------------|
58
- | `PORT` | `3000` | Server port |
59
- | `DATABASE_URL` | (auto) | PostgreSQL connection string |
60
- | `DB_PASSWORD` | `argus` | Database password |
61
- | `SCREENSHOTS_PATH` | `./screenshots` | Path to mount for image serving |
42
+ ### `npx @argus-vrt/web init`
62
43
 
63
- See [DEPLOYMENT.md](./DEPLOYMENT.md) for full production deployment instructions including Nginx reverse proxy with HTTPS, image serving options, and database backup/restore.
44
+ Interactive setup wizard. Prompts for:
64
45
 
65
- ## Connecting the CLI
46
+ - **PostgreSQL** include a container (recommended) or use an external instance
47
+ - **Port** — default 3000
48
+ - **Domain** — custom domain or localhost
49
+ - **HTTPS** — Let's Encrypt, custom certificate, or none
50
+ - **Reverse proxy** — include an Nginx container or manage yourself
51
+ - **Screenshots path** — where uploaded screenshots are stored
52
+ - **GitHub Client ID** — from your GitHub OAuth App
53
+ - **GitHub Client Secret** — from your GitHub OAuth App
54
+ - **API key** — for CI/CD uploads (auto-generated by default)
66
55
 
67
- Once the dashboard is running, point your CLI at it by adding `apiUrl` to your project's `.argus.json`:
56
+ A **session secret** is auto-generated and does not require input.
68
57
 
69
- ```json
70
- {
71
- "apiUrl": "http://localhost:3000"
72
- }
73
- ```
58
+ Generates configuration files into `./argus/` (or `--dir <path>`).
74
59
 
75
- Then upload results after running tests:
60
+ ### `npx @argus-vrt/web start`
61
+
62
+ Start Argus containers (`docker compose up -d`).
63
+
64
+ ### `npx @argus-vrt/web stop`
65
+
66
+ Stop Argus containers (`docker compose down`).
67
+
68
+ ### `npx @argus-vrt/web logs`
69
+
70
+ Stream container logs (`docker compose logs -f`).
76
71
 
77
72
  ```bash
78
- npx argus test
73
+ npx @argus-vrt/web logs --service web # only web container
74
+ npx @argus-vrt/web logs --service db # only database
79
75
  ```
80
76
 
81
- ## Tech Stack
77
+ ### `npx @argus-vrt/web status`
82
78
 
83
- - **Framework**: [TanStack Start](https://tanstack.com/start) with React 19
84
- - **Routing**: [TanStack Router](https://tanstack.com/router) (file-based)
85
- - **Database**: PostgreSQL with [Drizzle ORM](https://orm.drizzle.team/)
86
- - **Styling**: [Tailwind CSS v4](https://tailwindcss.com/) with design tokens
87
- - **Fonts**: Inter (body), Space Grotesk (headings), JetBrains Mono (code)
79
+ Show container status and run a health check on the web dashboard.
88
80
 
89
- ---
81
+ ### `npx @argus-vrt/web upgrade`
90
82
 
91
- ## Development
83
+ Pull the latest Docker images and restart containers.
92
84
 
93
- ### Prerequisites
85
+ ### `npx @argus-vrt/web setup-ssl <domain>`
94
86
 
95
- - Node.js >= 20
96
- - Yarn >= 4
97
- - Docker (for PostgreSQL)
87
+ Obtain a Let's Encrypt SSL certificate for your domain. Requires the Nginx and Certbot containers (select Let's Encrypt during `init`).
98
88
 
99
- ### Setup
89
+ ```bash
90
+ npx @argus-vrt/web setup-ssl argus.yourcompany.com
91
+ ```
100
92
 
101
- From the repository root:
93
+ ## Options
102
94
 
103
- ```bash
104
- # Install all dependencies
105
- yarn install
95
+ All management commands (`start`, `stop`, `logs`, `status`, `upgrade`, `setup-ssl`) accept:
96
+
97
+ | Flag | Description |
98
+ |------|-------------|
99
+ | `-d, --dir <path>` | Path to the Argus directory (default: `./argus`) |
106
100
 
107
- # Start PostgreSQL (from this directory)
108
- cd packages/web
109
- docker compose up -d
101
+ ## Connecting the CLI
102
+
103
+ Once the dashboard is running, point the testing CLI at it by adding `apiUrl` and `apiKey` to your project's `.argus.json`:
104
+
105
+ ```json
106
+ {
107
+ "apiUrl": "http://localhost:3000",
108
+ "apiKey": "your-api-key-from-init"
109
+ }
110
+ ```
110
111
 
111
- # Push database schema
112
- yarn workspace @argus-vrt/web db:push
112
+ Then upload results after running tests:
113
113
 
114
- # Start dev server at http://localhost:3000
115
- yarn workspace @argus-vrt/web dev
114
+ ```bash
115
+ npx argus test
116
116
  ```
117
117
 
118
- Or if you're already in `packages/web`:
118
+ Or upload manually with a header:
119
119
 
120
120
  ```bash
121
- docker compose up -d
122
- yarn db:push
123
- yarn dev
121
+ curl -X POST https://your-domain.com/api/upload \
122
+ -H "Authorization: Bearer your-api-key" \
123
+ -H "Content-Type: application/json" \
124
+ -d '{"branch":"main","commitHash":"abc123","stories":[...]}'
124
125
  ```
125
126
 
126
- ### Scripts
127
+ ## Environment Variables
128
+
129
+ The generated `.env` file includes:
130
+
131
+ | Variable | Default | Description |
132
+ |----------|---------|-------------|
133
+ | `PORT` | `3000` | Server port |
134
+ | `DATABASE_URL` | (auto) | PostgreSQL connection string (external DB only) |
135
+ | `DB_PASSWORD` | `argus` | Database password (container DB only) |
136
+ | `SCREENSHOTS_PATH` | `./argus-data/images` | Path to screenshots directory |
137
+ | `GITHUB_CLIENT_ID` | — | GitHub OAuth App client ID |
138
+ | `GITHUB_CLIENT_SECRET` | — | GitHub OAuth App client secret |
139
+ | `SESSION_SECRET` | (auto-generated) | Encryption key for session cookies |
140
+ | `ARGUS_API_KEY` | (auto-generated) | API key for CI/CD upload authentication |
127
141
 
128
- | Script | Description |
129
- |--------|-------------|
130
- | `yarn dev` | Start development server on port 3000 |
131
- | `yarn build` | Build for production |
132
- | `yarn preview` | Preview production build |
133
- | `yarn test` | Run tests with Vitest |
134
- | `yarn db:generate` | Generate Drizzle migrations |
135
- | `yarn db:push` | Push schema changes to database |
136
- | `yarn db:studio` | Open Drizzle Studio |
142
+ ## Docker Image
137
143
 
138
- ### Project Structure
144
+ The web dashboard is distributed as a Docker image on GitHub Container Registry:
139
145
 
140
146
  ```
141
- src/
142
- ├── components/
143
- │ ├── image/ # Image comparison components
144
- │ ├── story/ # Story list/tree components
145
- │ └── ui/ # Shared UI components
146
- ├── hooks/ # React hooks
147
- ├── lib/ # Utilities
148
- ├── routes/ # File-based routes
149
- │ ├── __root.tsx # Root layout
150
- │ ├── index.tsx # Dashboard home
151
- │ ├── tests/ # Test detail pages
152
- │ └── branches/ # Branch pages
153
- ├── db/ # Database schema
154
- └── styles.css # Global styles & design tokens
147
+ ghcr.io/maxcwolf/argus-web:latest
155
148
  ```
156
149
 
157
150
  ## License