@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 CHANGED
@@ -32,11 +32,11 @@ make install
32
32
 
33
33
  ## Run
34
34
 
35
- ### Web interface (frontend + backend via Docker)
35
+ ### Docker development stack (web UI + separate API)
36
36
  ```bash
37
- make run # builds and starts both the API and the web UI in Docker
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
- A modern React + Vite web interface is available for easier use. The frontend is built with React and deployed to GitHub Pages, and the backend runs in Docker on an Ubuntu workstation.
64
-
65
- ### Quick Start (Local Development)
66
-
67
- 1. **Install dependencies:**
68
- ```bash
69
- make install
70
- ```
71
- This will install both Python backend dependencies and Node.js frontend dependencies.
72
-
73
- **Note**: This project uses [pnpm](https://pnpm.io/) as the package manager. If you don't have pnpm installed, you can install it with:
74
- ```bash
75
- npm install -g pnpm
76
- ```
77
- Or follow the [pnpm installation guide](https://pnpm.io/installation).
78
-
79
- 2. **Configure environment variables (optional):**
80
- ```bash
81
- cp .env.example .env
82
- # Edit .env with your settings if needed
83
- ```
84
-
85
- 3. **Start the backend server:**
86
- ```bash
87
- make serve-backend
88
- ```
89
- The API will be available at `http://localhost:8000` (or the port specified in `.env`)
90
-
91
- 4. **Start the frontend development server:**
92
- ```bash
93
- make serve-frontend
94
- ```
95
- The frontend will be available at `http://localhost:5173` and will automatically reload on changes.
96
-
97
- 5. **Update backend URL (if needed):**
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="/vite.svg" />
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.2.13",
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
- "react": "^19.2.0",
40
- "react-dom": "^19.2.0"
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');