|
1 | 1 | # VxCentralScan Backend
|
2 | 2 |
|
3 |
| -Backend server for VxCentralScan. |
4 |
| - |
5 |
| -## Setup |
6 |
| - |
7 |
| -Follow the instructions in the [VxSuite README](../../../README.md) to get set |
8 |
| -up, then start up the VxCentralScan (`apps/central-scan`) frontend. You |
9 |
| -generally should not need to run this service directly. Instead, run like so: |
10 |
| - |
11 |
| -```sh |
12 |
| -cd apps/central-scan/frontend |
13 |
| -pnpm start |
14 |
| -``` |
15 |
| - |
16 |
| -The commands to run the service below assume you'll be running them in a |
17 |
| -frontend, not this service directly. |
18 |
| - |
19 |
| -## Mock Scanning |
20 |
| - |
21 |
| -```sh |
22 |
| -# single batch with single sheet |
23 |
| -MOCK_SCANNER_FILES=front.jpeg,back.jpeg pnpm start |
24 |
| - |
25 |
| -# single batch with multiple sheets |
26 |
| -MOCK_SCANNER_FILES=front-01.jpeg,back-01.jpeg,front-02.jpeg,back-02.jpeg pnpm start |
27 |
| - |
28 |
| -# multiple batches with one sheet each (note ",," batch separator) |
29 |
| -MOCK_SCANNER_FILES=front-01.jpeg,back-01.jpeg,,front-02.jpeg,back-02.jpeg pnpm start |
30 |
| - |
31 |
| -# use a manifest file |
32 |
| -cat <<EOS > manifest |
33 |
| -# first batch (this is a comment) |
34 |
| -front-01.jpeg |
35 |
| -back-01.jpeg |
36 |
| -
|
37 |
| -# second batch |
38 |
| -front-02.jpeg |
39 |
| -back-02.jpeg |
40 |
| -EOS |
41 |
| -MOCK_SCANNER_FILES=@manifest pnpm start |
42 |
| - |
43 |
| -# scanning from an election backup file |
44 |
| -./bin/extract-backup /path/to/election-backup.zip |
45 |
| -MOCK_SCANNER_FILES=@/path/to/election-backup/manifest pnpm start |
46 |
| -``` |
47 |
| - |
48 |
| -If you are seeing unhandled promise rejection errors you may have an issue with |
49 |
| -where your image files are located, try moving them into the local scope of the |
50 |
| -app. |
51 |
| - |
52 |
| -### Testing Adjudication |
53 |
| - |
54 |
| -To force `requires_adjudication` of ballots, run this in |
55 |
| -`apps/central-scan/backend`: |
56 |
| - |
57 |
| -``` |
58 |
| -sqlite3 dev-workspace/ballots.db 'update sheets set requires_adjudication = 1;' |
59 |
| -``` |
60 |
| - |
61 |
| -## Switching Workspaces |
62 |
| - |
63 |
| -By default a `ballots.db` file and a `ballot-images` directory will be created |
64 |
| -in a `dev-workspace` folder inside `apps/central-scan/backend` when running this |
65 |
| -service. To choose another location, set `SCAN_WORKSPACE` to the path to another |
66 |
| -folder: |
67 |
| - |
68 |
| -```sh |
69 |
| -SCAN_WORKSPACE=/path/to/workspace pnpm start |
70 |
| -``` |
71 |
| - |
72 |
| -## Testing |
73 |
| - |
74 |
| -```sh |
75 |
| -pnpm test |
76 |
| -``` |
| 3 | +This backend is used by the [VxCentralScan frontend](../frontend) and isn't |
| 4 | +intended to be run on its own. The best way to develop on the backend is by |
| 5 | +running the frontend. |
0 commit comments