@finopsbricks/tally-sync 0.0.0-stage → 0.1.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 (125) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-build-manifest.json +66 -0
  3. package/.next/app-path-routes-manifest.json +7 -0
  4. package/.next/build-manifest.json +33 -0
  5. package/.next/export-marker.json +6 -0
  6. package/.next/images-manifest.json +58 -0
  7. package/.next/next-minimal-server.js.nft.json +1 -0
  8. package/.next/next-server.js.nft.json +1 -0
  9. package/.next/package.json +1 -0
  10. package/.next/prerender-manifest.json +11 -0
  11. package/.next/react-loadable-manifest.json +1 -0
  12. package/.next/required-server-files.json +322 -0
  13. package/.next/routes-manifest.json +80 -0
  14. package/.next/server/app/_not-found/page.js +2 -0
  15. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  17. package/.next/server/app/companies/[guid]/page.js +2 -0
  18. package/.next/server/app/companies/[guid]/page.js.nft.json +1 -0
  19. package/.next/server/app/companies/[guid]/page_client-reference-manifest.js +1 -0
  20. package/.next/server/app/companies/[guid]/tables/[table]/page.js +2 -0
  21. package/.next/server/app/companies/[guid]/tables/[table]/page.js.nft.json +1 -0
  22. package/.next/server/app/companies/[guid]/tables/[table]/page_client-reference-manifest.js +1 -0
  23. package/.next/server/app/companies/[guid]/vouchers/[voucher_guid]/page.js +2 -0
  24. package/.next/server/app/companies/[guid]/vouchers/[voucher_guid]/page.js.nft.json +1 -0
  25. package/.next/server/app/companies/[guid]/vouchers/[voucher_guid]/page_client-reference-manifest.js +1 -0
  26. package/.next/server/app/page.js +2 -0
  27. package/.next/server/app/page.js.nft.json +1 -0
  28. package/.next/server/app/page_client-reference-manifest.js +1 -0
  29. package/.next/server/app-paths-manifest.json +7 -0
  30. package/.next/server/chunks/230.js +32 -0
  31. package/.next/server/chunks/611.js +6 -0
  32. package/.next/server/chunks/706.js +1 -0
  33. package/.next/server/chunks/748.js +1 -0
  34. package/.next/server/functions-config-manifest.json +4 -0
  35. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  36. package/.next/server/middleware-build-manifest.js +1 -0
  37. package/.next/server/middleware-manifest.json +6 -0
  38. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  39. package/.next/server/next-font-manifest.js +1 -0
  40. package/.next/server/next-font-manifest.json +1 -0
  41. package/.next/server/pages/500.html +1 -0
  42. package/.next/server/pages/_app.js +1 -0
  43. package/.next/server/pages/_app.js.nft.json +1 -0
  44. package/.next/server/pages/_document.js +1 -0
  45. package/.next/server/pages/_document.js.nft.json +1 -0
  46. package/.next/server/pages/_error.js +19 -0
  47. package/.next/server/pages/_error.js.nft.json +1 -0
  48. package/.next/server/pages-manifest.json +5 -0
  49. package/.next/server/server-reference-manifest.js +1 -0
  50. package/.next/server/server-reference-manifest.json +1 -0
  51. package/.next/server/webpack-runtime.js +1 -0
  52. package/.next/static/V0rxN1KuyEM0zJoOJVDoX/_buildManifest.js +1 -0
  53. package/.next/static/V0rxN1KuyEM0zJoOJVDoX/_ssgManifest.js +1 -0
  54. package/.next/static/chunks/122-df645619bf29fc6e.js +1 -0
  55. package/.next/static/chunks/255-73938ce8a8eac1ad.js +1 -0
  56. package/.next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
  57. package/.next/static/chunks/510-5993a923674db2de.js +1 -0
  58. package/.next/static/chunks/658-dfe2290e75772c42.js +1 -0
  59. package/.next/static/chunks/788-e10fcb5f53c6428d.js +1 -0
  60. package/.next/static/chunks/9ad0e60a-ad37bddef782d7c2.js +1 -0
  61. package/.next/static/chunks/app/_not-found/page-f187ad254cc1b0eb.js +1 -0
  62. package/.next/static/chunks/app/companies/[guid]/page-042071b4790e1a86.js +1 -0
  63. package/.next/static/chunks/app/companies/[guid]/tables/[table]/page-a46008185adae0f8.js +1 -0
  64. package/.next/static/chunks/app/companies/[guid]/vouchers/[voucher_guid]/page-1b17cd59db180e1f.js +1 -0
  65. package/.next/static/chunks/app/layout-d46ad692723a97e0.js +1 -0
  66. package/.next/static/chunks/app/not-found-61f58c9ef91de921.js +1 -0
  67. package/.next/static/chunks/app/page-042071b4790e1a86.js +1 -0
  68. package/.next/static/chunks/framework-acd67e14855de5a2.js +1 -0
  69. package/.next/static/chunks/main-6f56cad8fb2c15f2.js +1 -0
  70. package/.next/static/chunks/main-app-f136a4b0e7f8f69b.js +1 -0
  71. package/.next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
  72. package/.next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
  73. package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  74. package/.next/static/chunks/webpack-4354c1f6ffe64d9d.js +1 -0
  75. package/.next/static/css/a8e56a10001bee9f.css +1 -0
  76. package/CHANGELOG.md +16 -0
  77. package/LICENSE +201 -0
  78. package/NOTICE +40 -0
  79. package/README.md +109 -2
  80. package/bin/tally-sync.js +12 -0
  81. package/ecosystem.config.cjs +12 -0
  82. package/next.config.mjs +7 -0
  83. package/package.json +58 -4
  84. package/src/app/companies/[guid]/page.jsx +261 -0
  85. package/src/app/companies/[guid]/tables/[table]/page.jsx +116 -0
  86. package/src/app/companies/[guid]/vouchers/[voucher_guid]/page.jsx +156 -0
  87. package/src/app/globals.css +3 -0
  88. package/src/app/layout.jsx +29 -0
  89. package/src/app/not-found.jsx +22 -0
  90. package/src/app/page.jsx +172 -0
  91. package/src/cli/_helpers.js +71 -0
  92. package/src/cli/index.js +56 -0
  93. package/src/cli/paths.js +26 -0
  94. package/src/cli/probe.js +61 -0
  95. package/src/cli/sync.js +84 -0
  96. package/src/cli/web.js +32 -0
  97. package/src/components/AppShell.jsx +17 -0
  98. package/src/components/AppSidebar.jsx +81 -0
  99. package/src/components/MainContainer.jsx +12 -0
  100. package/src/components/RowsTable.jsx +111 -0
  101. package/src/components/Section.jsx +16 -0
  102. package/src/mirror/agentDb.js +131 -0
  103. package/src/mirror/companyDb.js +54 -0
  104. package/src/mirror/schema.js +49 -0
  105. package/src/mirror/sqlite.js +41 -0
  106. package/src/probe/probeFile.js +54 -0
  107. package/src/probe/runProbe.js +118 -0
  108. package/src/sync/checkPull.js +61 -0
  109. package/src/sync/pullCompany.js +54 -0
  110. package/src/sync/runSyncPass.js +50 -0
  111. package/src/sync/syncCompany.js +75 -0
  112. package/src/sync/tieOut.js +93 -0
  113. package/src/tally/dates.js +23 -0
  114. package/src/tally/definitions.js +22 -0
  115. package/src/tally/definitions.yaml +370 -0
  116. package/src/tally/gateway.js +77 -0
  117. package/src/tally/http.js +92 -0
  118. package/src/tally/requests.js +133 -0
  119. package/src/tally/tallyErrors.js +25 -0
  120. package/src/tally/xml.js +329 -0
  121. package/src/utils/config.js +46 -0
  122. package/src/utils/debugLog.js +23 -0
  123. package/src/web/format.js +160 -0
  124. package/src/web/mirror.js +132 -0
  125. package/src/web/status.js +80 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 FinOpsBricks
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,40 @@
1
+ tally-sync
2
+ Copyright 2026 FinOpsBricks
3
+
4
+ This product includes software developed at FinOpsBricks.
5
+
6
+ ----------------------------------------------------------------------------
7
+
8
+ This product includes material from Tally Database Loader
9
+ (https://github.com/dhananjay1405/tally-database-loader), MIT licence,
10
+ Copyright (c) 2021 Dhananjay Gokhale:
11
+
12
+ - src/tally/definitions.yaml is a trimmed, otherwise unchanged copy of its
13
+ tally-export-config.yaml.
14
+ - The request building and answer parsing in src/tally/xml.js and
15
+ src/tally/http.js follow its tally.mts.
16
+
17
+ This product's Tally client also follows tally-to-duckdb
18
+ (https://github.com/Rajesh3400/tally-to-duckdb), MIT licence,
19
+ Copyright (c) 2026 Rajesh D: the date-window filter, the window planning and
20
+ the answer checks.
21
+
22
+ MIT licence text for both:
23
+
24
+ Permission is hereby granted, free of charge, to any person obtaining a copy
25
+ of this software and associated documentation files (the "Software"), to deal
26
+ in the Software without restriction, including without limitation the rights
27
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
+ copies of the Software, and to permit persons to whom the Software is
29
+ furnished to do so, subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all
32
+ copies or substantial portions of the Software.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,110 @@
1
- # Temporary Holding Version
1
+ # tally-sync
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@finopsbricks/tally-sync` is a local agent for FinOpsBricks that runs on the Windows PC next to TallyPrime. It mirrors every loaded Tally company into local SQLite, shows the data and its sync health in a local web UI, and posts approved entries back to Tally. It is the only FinOpsBricks software that talks to Tally.
4
+
5
+ **Status: early.** `tally-sync probe` checks how your Tally answers, `tally-sync sync` mirrors your companies into SQLite, and `tally-sync web` shows them in your browser. All of them only read from Tally.
6
+
7
+ ## Install
8
+
9
+ Needs Node.js 22.13 or later.
10
+
11
+ ```
12
+ npm install -g @finopsbricks/tally-sync
13
+ ```
14
+
15
+ ## Let Tally answer requests
16
+
17
+ In TallyPrime: **F1 (Help) → Settings → Connectivity → Client/Server configuration**. Set *TallyPrime acts as* to **Server** (or **Both**) and the port to **9000**. Load the companies you want to read.
18
+
19
+ ## Probe Tally
20
+
21
+ ```
22
+ tally-sync probe
23
+ ```
24
+
25
+ It asks Tally a fixed set of read-only questions:
26
+
27
+ - which companies are loaded;
28
+ - for each one: its ID, dates and change counters;
29
+ - every master table (groups, ledgers, voucher types, cost centres, opening bills);
30
+ - voucher counts per day;
31
+ - the last week of vouchers, with their ledger lines and bill, bank and cost-centre allocations.
32
+
33
+ It prints one line per step and saves every question and answer to one file, in `%USERPROFILE%\.fob\tally-sync\probes\` on Windows (`~/.fob/tally-sync/probes/` elsewhere).
34
+
35
+ **The file contains data from your Tally books.** Read it before you share it.
36
+
37
+ Options:
38
+
39
+ | Option | Does |
40
+ |---|---|
41
+ | `--company "<name>"` | Probe only this company (its exact name in Tally) |
42
+ | `--host`, `--port` | Where Tally listens (default `localhost:9000`) |
43
+ | `--out <dir>` | Where to save the probe file |
44
+ | `--debug` | Also log every exchange to `<config dir>/logs/` |
45
+ | `--config-dir <dir>` | Config, data and logs directory (default `~/.fob/tally-sync`) |
46
+
47
+ ## Sync
48
+
49
+ ```
50
+ tally-sync sync --once
51
+ ```
52
+
53
+ Mirrors every loaded company into its own SQLite file in `~/.fob/tally-sync/data/` (one file per company, named by its Tally ID), then checks every ledger's balance against Tally's own closing balance. Without `--once` it keeps running and syncs every 5 minutes, skipping companies Tally reports no change for.
54
+
55
+ | Option | Does |
56
+ |---|---|
57
+ | `--once` | One pass, then exit |
58
+ | `--company "<name>"` | Sync only this company |
59
+ | `--force` | Sync even when Tally reports no change |
60
+ | `--debug` | Log every exchange with Tally to `<config dir>/logs/` |
61
+
62
+ A sync that fails its checks (counts that don't add up, vouchers pulled twice, lines that don't balance) leaves the previous mirror as it was.
63
+
64
+ ## See it in the browser
65
+
66
+ ```
67
+ tally-sync web
68
+ ```
69
+
70
+ Open http://127.0.0.1:7780. The page is served on this PC only: other machines on the network can't reach it.
71
+
72
+ ## Keep it running with pm2
73
+
74
+ ```
75
+ npm install -g pm2
76
+ tally-sync paths
77
+ pm2 start "<pm2_file from tally-sync paths>"
78
+ pm2 save
79
+ ```
80
+
81
+ This starts two processes: `tally-sync` (syncs every 5 minutes) and `tally-sync-web` (the page). `pm2 logs tally-sync` shows what each sync did.
82
+
83
+ ## Config
84
+
85
+ Optional, in `~/.fob/tally-sync/config.yml`:
86
+
87
+ ```yaml
88
+ tally:
89
+ host: localhost
90
+ port: 9000
91
+ timeout_seconds: 1800
92
+ web:
93
+ port: 7780
94
+ sync:
95
+ interval_minutes: 5
96
+ batch_size: 5000 # most vouchers asked for in one request
97
+ ```
98
+
99
+ ## Develop
100
+
101
+ ```
102
+ npm install
103
+ npm test
104
+ ```
105
+
106
+ Tests run against a fake Tally (`tests/fakeTally/`). Design notes are in [`docs/architecture/`](docs/architecture/big-pieces.md); work in progress is in [`docs/wip/`](docs/wip/tally-sync-architecture.md).
107
+
108
+ ## Licence
109
+
110
+ Apache-2.0. Parts come from MIT-licensed open-source Tally projects; see [NOTICE](NOTICE).
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ // Node prints an ExperimentalWarning for its built-in SQLite on every start. It's expected
3
+ // here, so it's hidden; every other warning still prints.
4
+ const print_warning = process.listeners('warning');
5
+ process.removeAllListeners('warning');
6
+ process.on('warning', (warning) => {
7
+ if (warning.name === 'ExperimentalWarning' && /SQLite/.test(warning.message)) return;
8
+ for (const listener of print_warning) listener(warning);
9
+ });
10
+
11
+ const { run } = await import('../src/cli/index.js');
12
+ run(process.argv.slice(2));
@@ -0,0 +1,12 @@
1
+ // pm2 file for tally-sync: the sync loop and the local UI, as two processes.
2
+ // Start with: pm2 start "<this file>" (`tally-sync paths` prints its location)
3
+ const path = require('node:path');
4
+
5
+ const bin = path.join(__dirname, 'bin', 'tally-sync.js');
6
+
7
+ module.exports = {
8
+ apps: [
9
+ { name: 'tally-sync', script: bin, args: 'sync', interpreter: 'node', autorestart: true, max_restarts: 50, restart_delay: 10000 },
10
+ { name: 'tally-sync-web', script: bin, args: 'web', interpreter: 'node', autorestart: true, max_restarts: 50, restart_delay: 10000 },
11
+ ],
12
+ };
@@ -0,0 +1,7 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ transpilePackages: ['@fob/lib-ui'],
4
+ poweredByHeader: false,
5
+ };
6
+
7
+ export default nextConfig;
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@finopsbricks/tally-sync",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Local agent that mirrors TallyPrime companies into SQLite and shows them in a local web UI",
5
+ "type": "module",
6
+ "bin": {
7
+ "tally-sync": "./bin/tally-sync.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "src",
12
+ "ecosystem.config.cjs",
13
+ "next.config.mjs",
14
+ ".next",
15
+ "!.next/cache",
16
+ "!.next/trace",
17
+ "!.next/types",
18
+ "!.next/diagnostics",
19
+ "README.md",
20
+ "CHANGELOG.md",
21
+ "LICENSE",
22
+ "NOTICE"
23
+ ],
24
+ "engines": {
25
+ "node": ">=22.13"
26
+ },
27
+ "scripts": {
28
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
29
+ "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
30
+ "build": "NEXT_TELEMETRY_DISABLED=1 next build",
31
+ "dev:web": "TALLY_SYNC_DATA_DIR=${TALLY_SYNC_DATA_DIR:-$HOME/.fob/tally-sync/data} next dev --hostname 127.0.0.1 --port 7780",
32
+ "prepack": "npm run build",
33
+ "demo": "node scripts/demoData.js"
34
+ },
35
+ "dependencies": {
36
+ "js-yaml": "^4.1.0",
37
+ "next": "^15.5.29",
38
+ "react": "^19.1.0",
39
+ "react-dom": "^19.1.0",
40
+ "yargs": "^18.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@fob/lib-ui": "github:finopsbricks/lib-ui#v0.10.1",
44
+ "@jest/globals": "^30.0.0",
45
+ "@tailwindcss/postcss": "^4.3.5",
46
+ "jest": "^30.0.0",
47
+ "tailwindcss": "^4.3.5",
48
+ "tw-animate-css": "^1.4.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/finopsbricks/tally-sync.git"
56
+ },
57
+ "homepage": "https://github.com/finopsbricks/tally-sync#readme",
58
+ "bugs": "https://github.com/finopsbricks/tally-sync/issues",
59
+ "license": "Apache-2.0"
60
+ }