@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.
- package/README.md +100 -107
- package/dist-cli/index.js +568 -0
- package/package.json +27 -14
- package/.cta.json +0 -15
- package/DEPLOYMENT.md +0 -154
- package/Dockerfile +0 -51
- package/docker-compose.prod.yml +0 -38
- package/docker-compose.yml +0 -15
- package/drizzle/0000_slim_makkari.sql +0 -61
- package/drizzle/meta/0000_snapshot.json +0 -452
- package/drizzle/meta/_journal.json +0 -13
- package/drizzle.config.ts +0 -10
- package/public/favicon.ico +0 -0
- package/public/logo-argus.svg +0 -8
- package/public/logo-variants/logo-argus-a.svg +0 -9
- package/public/logo-variants/logo-argus-modern.svg +0 -11
- package/public/logo-variants/logo-argus-peacock.svg +0 -8
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/tanstack-circle-logo.png +0 -0
- package/public/tanstack-word-logo-white.svg +0 -1
- package/scripts/backfill-kind.ts +0 -148
- package/src/api-plugin.ts +0 -169
- package/src/components/image/ImageCompare.tsx +0 -188
- package/src/components/story/StoryFlatList.tsx +0 -67
- package/src/components/story/StoryGroupedTree.tsx +0 -273
- package/src/components/story/StoryTree.tsx +0 -185
- package/src/components/ui/Drawer.tsx +0 -110
- package/src/components/ui/SearchInput.tsx +0 -95
- package/src/components/ui/StatusBadge.tsx +0 -59
- package/src/components/ui/ViewModeToggle.tsx +0 -39
- package/src/db/index.ts +0 -27
- package/src/db/schema.ts +0 -151
- package/src/hooks/useDebounce.ts +0 -23
- package/src/hooks/useStoryTree.ts +0 -205
- package/src/lib/utils.ts +0 -55
- package/src/logo.svg +0 -12
- package/src/routeTree.gen.ts +0 -177
- package/src/router.tsx +0 -17
- package/src/routes/__root.tsx +0 -174
- package/src/routes/branches/$name.tsx +0 -171
- package/src/routes/branches/index.tsx +0 -104
- package/src/routes/index.tsx +0 -178
- package/src/routes/tests/$id.tsx +0 -417
- package/src/routes/tests/index.tsx +0 -128
- package/src/routes/upload.tsx +0 -108
- package/src/styles.css +0 -213
- package/tsconfig.json +0 -28
- package/vite.config.ts +0 -30
package/README.md
CHANGED
|
@@ -1,157 +1,150 @@
|
|
|
1
1
|
# @argus-vrt/web
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**CLI tool for deploying and managing the Argus web dashboard.**
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
##
|
|
7
|
+
## Quick Start
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
13
|
+
# Start the dashboard
|
|
14
|
+
npx @argus-vrt/web start
|
|
25
15
|
|
|
26
|
-
|
|
16
|
+
# Open http://localhost:3000
|
|
17
|
+
```
|
|
27
18
|
|
|
28
|
-
|
|
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
|
-
|
|
34
|
-
docker compose -f docker-compose.prod.yml up -d
|
|
21
|
+
## Prerequisites
|
|
35
22
|
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
27
|
+
## Authentication
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
Argus requires GitHub OAuth for login. All browser routes are protected — unauthenticated users are redirected to GitHub to sign in.
|
|
43
30
|
|
|
44
|
-
|
|
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
|
-
|
|
47
|
-
PORT=3000
|
|
48
|
-
DB_PASSWORD=your-secure-password
|
|
33
|
+
### Setting Up GitHub OAuth
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
40
|
+
## Commands
|
|
55
41
|
|
|
56
|
-
|
|
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
|
-
|
|
44
|
+
Interactive setup wizard. Prompts for:
|
|
64
45
|
|
|
65
|
-
|
|
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
|
-
|
|
56
|
+
A **session secret** is auto-generated and does not require input.
|
|
68
57
|
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
"apiUrl": "http://localhost:3000"
|
|
72
|
-
}
|
|
73
|
-
```
|
|
58
|
+
Generates configuration files into `./argus/` (or `--dir <path>`).
|
|
74
59
|
|
|
75
|
-
|
|
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
|
|
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
|
-
|
|
77
|
+
### `npx @argus-vrt/web status`
|
|
82
78
|
|
|
83
|
-
|
|
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
|
-
|
|
83
|
+
Pull the latest Docker images and restart containers.
|
|
92
84
|
|
|
93
|
-
###
|
|
85
|
+
### `npx @argus-vrt/web setup-ssl <domain>`
|
|
94
86
|
|
|
95
|
-
|
|
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
|
-
|
|
89
|
+
```bash
|
|
90
|
+
npx @argus-vrt/web setup-ssl argus.yourcompany.com
|
|
91
|
+
```
|
|
100
92
|
|
|
101
|
-
|
|
93
|
+
## Options
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
112
|
-
yarn workspace @argus-vrt/web db:push
|
|
112
|
+
Then upload results after running tests:
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
```bash
|
|
115
|
+
npx argus test
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
Or
|
|
118
|
+
Or upload manually with a header:
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
144
|
+
The web dashboard is distributed as a Docker image on GitHub Container Registry:
|
|
139
145
|
|
|
140
146
|
```
|
|
141
|
-
|
|
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
|