@dytsou/intern-corner-scheduler 1.2.13 → 1.3.1
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 +38 -42
- package/index.html +6 -1
- package/package.json +23 -20
- package/scripts/create-nojekyll.js +2 -2
- package/src/App.css +846 -233
- package/src/App.jsx +113 -17
- package/src/components/ErrorMessage.jsx +3 -2
- package/src/components/GenerationLoadingScreen.jsx +48 -0
- package/src/components/Header.jsx +23 -5
- package/src/components/LoadingSpinner.jsx +11 -0
- package/src/components/PairInput.jsx +21 -7
- package/src/components/PairStatus.jsx +8 -2
- package/src/components/ScheduleForm.jsx +182 -113
- package/src/components/TableAssignments.jsx +7 -1
- package/src/index.css +153 -26
- package/src/services/cpSatScheduler.js +551 -0
- package/src/services/schedulerClient.js +96 -0
- package/vite.config.js +18 -0
- package/src/config.js +0 -21
- package/src/services/api.js +0 -31
package/README.md
CHANGED
|
@@ -32,11 +32,11 @@ make install
|
|
|
32
32
|
|
|
33
33
|
## Run
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Docker development stack (web UI + separate API)
|
|
36
36
|
```bash
|
|
37
|
-
make run # builds and starts
|
|
37
|
+
make run # builds and starts the web UI and the separate API in Docker
|
|
38
38
|
# web UI: http://localhost:${WEB_PORT:-5173}
|
|
39
|
-
# API: http://localhost:${API_PORT:-8000}
|
|
39
|
+
# API: http://localhost:${API_PORT:-8000} (not used by browser scheduling)
|
|
40
40
|
make run-down # stop the Docker containers
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -60,43 +60,41 @@ cd python && python3 main.py < input.txt
|
|
|
60
60
|
|
|
61
61
|
## Web Interface
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
###
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- Edit `src/config.js` and set `BACKEND_URL` to your backend address
|
|
99
|
-
- For production builds, update the URL before running `make build`
|
|
63
|
+
The React + Vite frontend solves schedules in the user's browser with OR-Tools CP-SAT compiled to WebAssembly. Cloudflare Pages serves static files; it does not run the Python API or receive schedule inputs.
|
|
64
|
+
|
|
65
|
+
### Run the Frontend Locally
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pnpm install --frozen-lockfile
|
|
69
|
+
pnpm dev
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
To build and preview the production files locally:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pnpm build
|
|
76
|
+
pnpm preview
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The production output is written to `docs/`. The `public/_headers` file adds the COOP and COEP response headers needed for browser isolation.
|
|
80
|
+
|
|
81
|
+
### Cloudflare Pages Settings
|
|
82
|
+
|
|
83
|
+
Connect the repository to Cloudflare Pages with these build settings:
|
|
84
|
+
|
|
85
|
+
| Setting | Value |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| Build command | `pnpm run build:cloudflare` |
|
|
88
|
+
| Build output directory | `docs` |
|
|
89
|
+
| `NODE_VERSION` | `22` |
|
|
90
|
+
| `PNPM_VERSION` | `10.20.0` |
|
|
91
|
+
| `SKIP_DEPENDENCY_INSTALL` | `1` |
|
|
92
|
+
|
|
93
|
+
The build command installs locked dependencies and generates `docs/` in one step. `SKIP_DEPENDENCY_INSTALL=1` prevents Pages from running a second dependency install. Keep the Pages project static: no Pages Functions or Worker API are needed for browser scheduling.
|
|
94
|
+
|
|
95
|
+
### Python API and CLI
|
|
96
|
+
|
|
97
|
+
The Python CLI, FastAPI service, and Docker setup remain available as separate tools. Start the API locally with `make serve-backend`; its documentation is available at `http://localhost:8000/docs`. The browser frontend does not need a backend URL or API server.
|
|
100
98
|
|
|
101
99
|
## API Documentation
|
|
102
100
|
|
|
@@ -169,5 +167,3 @@ Returns the health status of the API.
|
|
|
169
167
|
## License
|
|
170
168
|
|
|
171
169
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
172
|
-
|
|
173
|
-
|
package/index.html
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<meta
|
|
8
|
+
name="description"
|
|
9
|
+
content="Build thoughtful round-table seating plans with an OR-Tools solver running in your browser."
|
|
10
|
+
/>
|
|
11
|
+
<meta name="theme-color" content="#f4f6ff" />
|
|
7
12
|
<title>Round-Table Scheduler</title>
|
|
8
13
|
</head>
|
|
9
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dytsou/intern-corner-scheduler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Round-table Scheduler (CP-SAT) - Python CLI and web interface using OR-Tools CP-SAT to generate round-table seating across rounds with fixed hosts, balanced tables, and pair-wise constraints",
|
|
6
6
|
"author": "dytsou",
|
|
@@ -25,21 +25,14 @@
|
|
|
25
25
|
"README.md",
|
|
26
26
|
"LICENSE"
|
|
27
27
|
],
|
|
28
|
-
"packageManager": "pnpm@10.20.0",
|
|
29
|
-
"scripts": {
|
|
30
|
-
"dev": "vite",
|
|
31
|
-
"build": "vite build && node scripts/create-nojekyll.js",
|
|
32
|
-
"preview": "vite preview",
|
|
33
|
-
"lint": "eslint . --ext js,jsx --ignore-pattern 'docs/**' --report-unused-disable-directives --max-warnings 0",
|
|
34
|
-
"format": "prettier --write \"src/**/*.{js,jsx,json,css}\" \"scripts/**/*.js\" \"*.{js,json,html}\"",
|
|
35
|
-
"format:check": "prettier --check \"src/**/*.{js,jsx,json,css}\" \"scripts/**/*.js\" \"*.{js,json,html}\"",
|
|
36
|
-
"publish:npmjs": "npm publish --access public --registry https://registry.npmjs.org"
|
|
37
|
-
},
|
|
38
28
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"react
|
|
29
|
+
"or-tools-wasm": "0.9.1",
|
|
30
|
+
"react": "19.3.0",
|
|
31
|
+
"react-dom": "19.3.0"
|
|
41
32
|
},
|
|
42
33
|
"devDependencies": {
|
|
34
|
+
"@eslint/js": "^9.39.5",
|
|
35
|
+
"@playwright/test": "^1.63.0",
|
|
43
36
|
"@types/react": "^19.2.6",
|
|
44
37
|
"@types/react-dom": "^19.2.3",
|
|
45
38
|
"@vitejs/plugin-react": "^6.0.5",
|
|
@@ -48,17 +41,27 @@
|
|
|
48
41
|
"eslint-plugin-react": "^7.37.5",
|
|
49
42
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
50
43
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
44
|
+
"globals": "^14.0.0",
|
|
51
45
|
"prettier": "^3.7.4",
|
|
46
|
+
"protobufjs": "7.6.6",
|
|
52
47
|
"vite": "^8.2.1"
|
|
53
48
|
},
|
|
54
|
-
"pnpm": {
|
|
55
|
-
"overrides": {
|
|
56
|
-
"@babel/core": "7.29.6",
|
|
57
|
-
"brace-expansion@1": "1.1.18"
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
49
|
"publishConfig": {
|
|
61
50
|
"access": "public",
|
|
62
51
|
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "vite",
|
|
55
|
+
"build": "vite build && node scripts/create-nojekyll.js",
|
|
56
|
+
"build:cloudflare": "pnpm install --frozen-lockfile && pnpm build",
|
|
57
|
+
"preview": "vite preview",
|
|
58
|
+
"deploy:preview": "pnpm build && pnpm dlx wrangler pages deploy ./docs --branch preview",
|
|
59
|
+
"deploy:production": "pnpm build && pnpm dlx wrangler pages deploy ./docs --branch main",
|
|
60
|
+
"test": "node --test tests/web-scheduler.test.js",
|
|
61
|
+
"test:browser": "playwright test",
|
|
62
|
+
"lint": "eslint . --ext js,jsx --ignore-pattern 'docs/**' --report-unused-disable-directives --max-warnings 0",
|
|
63
|
+
"format": "prettier --write \"src/**/*.{js,jsx,json,css}\" \"scripts/**/*.js\" \"*.{js,json,html}\"",
|
|
64
|
+
"format:check": "prettier --check \"src/**/*.{js,jsx,json,css}\" \"scripts/**/*.js\" \"*.{js,json,html}\"",
|
|
65
|
+
"publish:npmjs": "npm publish --access public --registry https://registry.npmjs.org"
|
|
63
66
|
}
|
|
64
|
-
}
|
|
67
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writeFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
1
|
+
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
3
|
|
|
4
4
|
// Create .nojekyll file in docs directory for GitHub Pages
|
|
5
5
|
const nojekyllPath = join(process.cwd(), 'docs', '.nojekyll');
|