Compare commits
144 Commits
8a9a8d6b14
...
renovate/n
Author | SHA1 | Date | |
---|---|---|---|
be4fbfa51d | |||
11fb50af9a | |||
76d1430ecb | |||
22848bcec4 | |||
d2f948c8fa | |||
05aff4bbfb | |||
74b1a4dbcc | |||
8ad7b589ce | |||
ff20cb7bc9 | |||
1c345127b4 | |||
71e54b8d72 | |||
13a8bbad1d | |||
ec212902e9 | |||
6786ed6075 | |||
c881f58cf4 | |||
586204dcba | |||
da56f99ce6 | |||
57d2b1bf6a | |||
831ccd073c | |||
c5269a587b | |||
71ce57d205 | |||
d57107cfc1 | |||
68a3eb4218 | |||
514f140527 | |||
4bac50b676 | |||
884b86daa9 | |||
64365916bd | |||
77c0640ec0 | |||
96c80eb18c | |||
0cde9f5635 | |||
5e35dae02f | |||
f321376990 | |||
86b86d4d68 | |||
35c629a339 | |||
da0d5adcb9 | |||
2214387010 | |||
667ce69be8 | |||
57f4ed53f6 | |||
deb884a1f0 | |||
0e5d878e30 | |||
b266cbcadb | |||
91bca2b6b1 | |||
a741662251 | |||
34f0493c51 | |||
b538b6fcb3 | |||
9d18d975d0 | |||
43049bc229 | |||
19ca17b43a | |||
572046f418 | |||
24af473dd3 | |||
8a57c57ec4 | |||
50a5e7745f | |||
675e4d9ecd | |||
83c214af7d | |||
bfa6af5749 | |||
6ab157504c | |||
bb98ea5e46 | |||
2d104a54b5 | |||
3b0ff29bc8 | |||
4ade72a0ee | |||
6021b44a13 | |||
eb92e8c0c5 | |||
d98305908c | |||
ae5ef99e3a | |||
2f592183e4 | |||
74291a258c | |||
df8cd6a046 | |||
079fbbf154 | |||
ba443629e6 | |||
2c07a69b90 | |||
0de551f1de | |||
2488ef0125 | |||
aa2e764262 | |||
1202219e98 | |||
112597084c | |||
4f64404ffa | |||
c39b53c721 | |||
bd2e343601 | |||
85ee2b2549 | |||
154551aeaf | |||
7b10c3508a | |||
61c96629a1 | |||
8644075a09 | |||
81bfa75eec | |||
de0dd4e36a | |||
f9d7a63738 | |||
0ef6f8288f | |||
2f23e4dadb | |||
5cf5fac8f4 | |||
8e143db354 | |||
1237c9706e | |||
1add0b4cfe | |||
6920d6d9b0 | |||
27e92660f1 | |||
743e5ba410 | |||
8039b1c807 | |||
9ef84ba63a | |||
56e5ae6629 | |||
4443131516 | |||
365d7589b1 | |||
23cc189e53 | |||
3098d12e8a | |||
0943104cc8 | |||
3beaba806a | |||
1788e7f184 | |||
71d32d72ef | |||
28f61a3099 | |||
f61e3541fb | |||
fb7891d913 | |||
d9ede224cf | |||
fc9334b20b | |||
c4cbd7ec8b | |||
a4ef3e74dc | |||
dbb988f2b5 | |||
b2aff4902d | |||
6f578b39f9 | |||
de519ecb6c | |||
3049e545e9 | |||
1f1c01a287 | |||
92885b8af6 | |||
44320db760 | |||
1f2a28aa65 | |||
f9566315eb | |||
63bed07015 | |||
4b84d926d4 | |||
8191a28986 | |||
8c30b50d0c | |||
389b2c96ba | |||
5a08b0c971 | |||
b3fd066633 | |||
5c987473a5 | |||
c3d2612f9a | |||
130cc1ef0d | |||
aebefd114a | |||
34d3e08149 | |||
ccd3540804 | |||
b9b871224b | |||
17a22d7a4c | |||
8db2cf3ece | |||
e45648e038 | |||
55144da943 | |||
5065f780f2 | |||
28d8b96ebe | |||
baf62aa2a5 |
61
.drone.yml
61
.drone.yml
@@ -4,9 +4,17 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# Needs a full git clone
|
||||||
|
- name: fetch
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- git fetch --tags
|
||||||
|
|
||||||
# Frontend
|
# Frontend
|
||||||
- name: web_build
|
- name: web_build
|
||||||
image: node:23
|
image: node:24
|
||||||
|
depends_on:
|
||||||
|
- fetch
|
||||||
volumes:
|
volumes:
|
||||||
- name: web_app
|
- name: web_app
|
||||||
path: /tmp/web_build
|
path: /tmp/web_build
|
||||||
@@ -20,6 +28,8 @@ steps:
|
|||||||
# Backend
|
# Backend
|
||||||
- name: backend_fetch_deps
|
- name: backend_fetch_deps
|
||||||
image: rust
|
image: rust
|
||||||
|
depends_on:
|
||||||
|
- fetch
|
||||||
volumes:
|
volumes:
|
||||||
- name: rust_registry
|
- name: rust_registry
|
||||||
path: /usr/local/cargo/registry
|
path: /usr/local/cargo/registry
|
||||||
@@ -54,6 +64,9 @@ steps:
|
|||||||
|
|
||||||
- name: backend_build
|
- name: backend_build
|
||||||
image: rust
|
image: rust
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
volumes:
|
volumes:
|
||||||
- name: rust_registry
|
- name: rust_registry
|
||||||
path: /usr/local/cargo/registry
|
path: /usr/local/cargo/registry
|
||||||
@@ -72,12 +85,58 @@ steps:
|
|||||||
- ls -lah target/release/moneymgr_backend target/release/examples/api_curl
|
- ls -lah target/release/moneymgr_backend target/release/examples/api_curl
|
||||||
- cp target/release/moneymgr_backend target/release/examples/api_curl /tmp/release
|
- cp target/release/moneymgr_backend target/release/examples/api_curl /tmp/release
|
||||||
|
|
||||||
|
# Mobile app code quality
|
||||||
|
- name: mobile_app_code_quality
|
||||||
|
image: ghcr.io/cirruslabs/flutter:latest
|
||||||
|
depends_on:
|
||||||
|
- fetch
|
||||||
|
commands:
|
||||||
|
- echo "Build version:" $(git describe --tags --abbrev=0)
|
||||||
|
- echo "Build number:" $(git rev-list --count $(git describe --tags --abbrev=0))
|
||||||
|
- cd moneymgr_mobile
|
||||||
|
- flutter --disable-analytics
|
||||||
|
- flutter pub get --enforce-lockfile
|
||||||
|
- dart run build_runner build
|
||||||
|
- flutter analyze
|
||||||
|
|
||||||
|
# Mobile app build
|
||||||
|
- name: mobile_app_build
|
||||||
|
image: ghcr.io/cirruslabs/flutter:latest
|
||||||
|
depends_on:
|
||||||
|
- backend_build # prevent synchronous backend & frontend build
|
||||||
|
- mobile_app_code_quality
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
environment:
|
||||||
|
JKS_KEYSTORE:
|
||||||
|
from_secret: JKS_KEYSTORE
|
||||||
|
JKS_KEYSTORE_PASSWORD:
|
||||||
|
from_secret: JKS_KEYSTORE_PASSWORD
|
||||||
|
volumes:
|
||||||
|
- name: release
|
||||||
|
path: /tmp/release
|
||||||
|
commands:
|
||||||
|
- cd moneymgr_mobile
|
||||||
|
- flutter --disable-analytics
|
||||||
|
- bash android/ci_write_keystore.sh
|
||||||
|
- flutter pub get --enforce-lockfile
|
||||||
|
- dart run build_runner build
|
||||||
|
- flutter build apk
|
||||||
|
--release
|
||||||
|
--flavor publish
|
||||||
|
--build-name $(git describe --tags --abbrev=0)
|
||||||
|
--split-per-abi
|
||||||
|
--target-platform android-arm64
|
||||||
|
--build-number $(git rev-list --count $(git describe --tags --abbrev=0))
|
||||||
|
- cp build/app/outputs/flutter-apk/app-arm64-v8a-publish-release.apk /tmp/release/moneymgr_mobile_arm64-v8a.apk
|
||||||
|
|
||||||
# Release
|
# Release
|
||||||
- name: gitea_release
|
- name: gitea_release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend_build
|
- backend_build
|
||||||
|
- mobile_app_build
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
65
moneymgr_backend/Cargo.lock
generated
65
moneymgr_backend/Cargo.lock
generated
@@ -36,9 +36,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-files"
|
name = "actix-files"
|
||||||
version = "0.6.6"
|
version = "0.6.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0773d59061dedb49a8aed04c67291b9d8cf2fe0b60130a381aab53c6dd86e9be"
|
checksum = "6c0d87f10d70e2948ad40e8edea79c8e77c6c66e0250a4c1f09b690465199576"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-http",
|
"actix-http",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
@@ -46,7 +46,7 @@ dependencies = [
|
|||||||
"actix-web",
|
"actix-web",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytes",
|
"bytes",
|
||||||
"derive_more 0.99.20",
|
"derive_more 2.0.1",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"http-range",
|
"http-range",
|
||||||
"log",
|
"log",
|
||||||
@@ -87,7 +87,7 @@ dependencies = [
|
|||||||
"mime",
|
"mime",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rand 0.9.1",
|
"rand 0.9.2",
|
||||||
"sha1",
|
"sha1",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -364,12 +364,6 @@ dependencies = [
|
|||||||
"alloc-no-stdlib",
|
"alloc-no-stdlib",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "android-tzdata"
|
|
||||||
version = "0.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "android_system_properties"
|
name = "android_system_properties"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
@@ -431,9 +425,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.98"
|
version = "1.0.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arbitrary"
|
name = "arbitrary"
|
||||||
@@ -700,16 +694,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.41"
|
version = "0.4.42"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
|
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android-tzdata",
|
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"windows-link",
|
"windows-link 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -724,9 +717,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.41"
|
version = "4.5.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
|
checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@@ -734,9 +727,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.41"
|
version = "4.5.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
|
checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -746,9 +739,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.41"
|
version = "4.5.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
|
checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -2157,9 +2150,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.27"
|
version = "0.4.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lzma-rs"
|
name = "lzma-rs"
|
||||||
@@ -2298,7 +2291,7 @@ dependencies = [
|
|||||||
"light-openid",
|
"light-openid",
|
||||||
"log",
|
"log",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
"rand 0.9.1",
|
"rand 0.9.2",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"rust-s3",
|
"rust-s3",
|
||||||
"rust_xlsxwriter",
|
"rust_xlsxwriter",
|
||||||
@@ -2741,9 +2734,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.9.1"
|
version = "0.9.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rand_chacha 0.9.0",
|
"rand_chacha 0.9.0",
|
||||||
"rand_core 0.9.3",
|
"rand_core 0.9.3",
|
||||||
@@ -3232,9 +3225,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.140"
|
version = "1.0.142"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -3994,7 +3987,7 @@ checksum = "46ec44dc15085cea82cf9c78f85a9114c463a369786585ad2882d1ff0b0acf40"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-implement",
|
"windows-implement",
|
||||||
"windows-interface",
|
"windows-interface",
|
||||||
"windows-link",
|
"windows-link 0.1.1",
|
||||||
"windows-result",
|
"windows-result",
|
||||||
"windows-strings 0.4.1",
|
"windows-strings 0.4.1",
|
||||||
]
|
]
|
||||||
@@ -4027,6 +4020,12 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-registry"
|
name = "windows-registry"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -4044,7 +4043,7 @@ version = "0.3.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b895b5356fc36103d0f64dd1e94dfa7ac5633f1c9dd6e80fe9ec4adef69e09d"
|
checksum = "4b895b5356fc36103d0f64dd1e94dfa7ac5633f1c9dd6e80fe9ec4adef69e09d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link",
|
"windows-link 0.1.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4053,7 +4052,7 @@ version = "0.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"
|
checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link",
|
"windows-link 0.1.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4062,7 +4061,7 @@ version = "0.4.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a7ab927b2637c19b3dbe0965e75d8f2d30bdd697a1516191cad2ec4df8fb28a"
|
checksum = "2a7ab927b2637c19b3dbe0965e75d8f2d30bdd697a1516191cad2ec4df8fb28a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link",
|
"windows-link 0.1.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@@ -5,26 +5,26 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
log = "0.4.27"
|
log = "0.4.28"
|
||||||
diesel = { version = "2.2.12", features = ["postgres", "r2d2"] }
|
diesel = { version = "2.2.12", features = ["postgres", "r2d2"] }
|
||||||
diesel_migrations = "2.2.0"
|
diesel_migrations = "2.2.0"
|
||||||
clap = { version = "4.5.41", features = ["env", "derive"] }
|
clap = { version = "4.5.48", features = ["env", "derive"] }
|
||||||
actix-web = "4.11.0"
|
actix-web = "4.11.0"
|
||||||
actix-cors = "0.7.1"
|
actix-cors = "0.7.1"
|
||||||
actix-multipart = "0.7.2"
|
actix-multipart = "0.7.2"
|
||||||
actix-remote-ip = "0.1.0"
|
actix-remote-ip = "0.1.0"
|
||||||
actix-session = { version = "0.10.1", features = ["redis-session"] }
|
actix-session = { version = "0.10.1", features = ["redis-session"] }
|
||||||
actix-files = "0.6.6"
|
actix-files = "0.6.8"
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
anyhow = "1.0.98"
|
anyhow = "1.0.100"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
rust-s3 = "0.36.0-beta.2"
|
rust-s3 = "0.36.0-beta.2"
|
||||||
thiserror = "2.0.12"
|
thiserror = "2.0.12"
|
||||||
tokio = "1.45.1"
|
tokio = "1.45.1"
|
||||||
futures-util = "0.3.31"
|
futures-util = "0.3.31"
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.142"
|
||||||
light-openid = "1.0.4"
|
light-openid = "1.0.4"
|
||||||
rand = "0.9.1"
|
rand = "0.9.2"
|
||||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||||
lazy-regex = "3.4.1"
|
lazy-regex = "3.4.1"
|
||||||
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
|
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
|
||||||
@@ -33,7 +33,7 @@ rust-embed = { version = "8.7.2" }
|
|||||||
sha2 = "0.11.0-rc.0"
|
sha2 = "0.11.0-rc.0"
|
||||||
base16ct = "0.2.0"
|
base16ct = "0.2.0"
|
||||||
httpdate = "1.0.3"
|
httpdate = "1.0.3"
|
||||||
chrono = "0.4.41"
|
chrono = "0.4.42"
|
||||||
tempfile = "3.20.0"
|
tempfile = "3.20.0"
|
||||||
zip = "3.0.0"
|
zip = "3.0.0"
|
||||||
rust_xlsxwriter = "0.87.0"
|
rust_xlsxwriter = "0.87.0"
|
@@ -29,7 +29,7 @@ pub struct AppConfig {
|
|||||||
/// Unsecure : for development, bypass authentication, using the account with the given
|
/// Unsecure : for development, bypass authentication, using the account with the given
|
||||||
/// email address by default
|
/// email address by default
|
||||||
#[clap(long, env)]
|
#[clap(long, env)]
|
||||||
pub unsecure_auto_login_email: Option<String>,
|
unsecure_auto_login_email: Option<String>,
|
||||||
|
|
||||||
/// PostgreSQL database host
|
/// PostgreSQL database host
|
||||||
#[clap(long, env, default_value = "localhost")]
|
#[clap(long, env, default_value = "localhost")]
|
||||||
@@ -126,6 +126,14 @@ pub struct AppConfig {
|
|||||||
/// Redis password
|
/// Redis password
|
||||||
#[clap(long, env, default_value = "secretredis")]
|
#[clap(long, env, default_value = "secretredis")]
|
||||||
redis_password: String,
|
redis_password: String,
|
||||||
|
|
||||||
|
/// Application download URL
|
||||||
|
#[clap(
|
||||||
|
long,
|
||||||
|
env,
|
||||||
|
default_value = "https://gitea.communiquons.org/pierre/MoneyMgr/releases/download/latest/moneymgr_mobile_arm64-v8a.apk"
|
||||||
|
)]
|
||||||
|
pub apk_download_url: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
@@ -140,9 +148,17 @@ impl AppConfig {
|
|||||||
&ARGS
|
&ARGS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get auto login email (if not empty)
|
||||||
|
pub fn unsecure_auto_login_email(&self) -> Option<&str> {
|
||||||
|
match self.unsecure_auto_login_email.as_deref() {
|
||||||
|
None | Some("") => None,
|
||||||
|
s => s,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Check if auth is disabled
|
/// Check if auth is disabled
|
||||||
pub fn is_auth_disabled(&self) -> bool {
|
pub fn is_auth_disabled(&self) -> bool {
|
||||||
self.unsecure_auto_login_email.is_some()
|
self.unsecure_auto_login_email().is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get auth cookie domain
|
/// Get auth cookie domain
|
||||||
|
@@ -70,6 +70,7 @@ impl Default for ServerConstraints {
|
|||||||
struct ServerConfig {
|
struct ServerConfig {
|
||||||
auth_disabled: bool,
|
auth_disabled: bool,
|
||||||
oidc_provider_name: &'static str,
|
oidc_provider_name: &'static str,
|
||||||
|
apk_download_url: &'static str,
|
||||||
accounts_types: &'static [AccountTypeDesc],
|
accounts_types: &'static [AccountTypeDesc],
|
||||||
constraints: ServerConstraints,
|
constraints: ServerConstraints,
|
||||||
}
|
}
|
||||||
@@ -79,6 +80,7 @@ impl Default for ServerConfig {
|
|||||||
Self {
|
Self {
|
||||||
auth_disabled: AppConfig::get().is_auth_disabled(),
|
auth_disabled: AppConfig::get().is_auth_disabled(),
|
||||||
oidc_provider_name: AppConfig::get().openid_provider().name,
|
oidc_provider_name: AppConfig::get().openid_provider().name,
|
||||||
|
apk_download_url: AppConfig::get().apk_download_url.as_str(),
|
||||||
constraints: Default::default(),
|
constraints: Default::default(),
|
||||||
accounts_types: &ACCOUNT_TYPES,
|
accounts_types: &ACCOUNT_TYPES,
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ impl FromRequest for AuthExtractor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
// Check for authentication using OpenID
|
// Check for authentication using API token
|
||||||
if let Some(token) = req.headers().get(constants::API_TOKEN_HEADER) {
|
if let Some(token) = req.headers().get(constants::API_TOKEN_HEADER) {
|
||||||
let Ok(jwt_token) = token.to_str() else {
|
let Ok(jwt_token) = token.to_str() else {
|
||||||
return Err(actix_web::error::ErrorBadRequest(
|
return Err(actix_web::error::ErrorBadRequest(
|
||||||
@@ -182,7 +182,7 @@ impl FromRequest for AuthExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if login is hard-coded as program argument
|
// Check if login is hard-coded as program argument
|
||||||
if let Some(email) = &AppConfig::get().unsecure_auto_login_email {
|
if let Some(email) = &AppConfig::get().unsecure_auto_login_email() {
|
||||||
let user = users_service::get_user_by_email(email).map_err(|e| {
|
let user = users_service::get_user_by_email(email).map_err(|e| {
|
||||||
log::error!("Failed to retrieve dev user: {e}");
|
log::error!("Failed to retrieve dev user: {e}");
|
||||||
ErrorPreconditionFailed("Unable to retrieve dev user!")
|
ErrorPreconditionFailed("Unable to retrieve dev user!")
|
||||||
|
@@ -38,7 +38,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
db_connection::initialize_conn().expect("Failed to connect to PostgresSQL database!");
|
db_connection::initialize_conn().expect("Failed to connect to PostgresSQL database!");
|
||||||
|
|
||||||
// Auto create default account, if requested
|
// Auto create default account, if requested
|
||||||
if let Some(mail) = &AppConfig::get().unsecure_auto_login_email {
|
if let Some(mail) = &AppConfig::get().unsecure_auto_login_email() {
|
||||||
users_service::create_or_update_user(mail, "Anonymous")
|
users_service::create_or_update_user(mail, "Anonymous")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create default account!");
|
.expect("Failed to create default account!");
|
||||||
|
2
moneymgr_mobile/android/.gitignore
vendored
2
moneymgr_mobile/android/.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
publish_key.properties
|
||||||
|
|
||||||
gradle-wrapper.jar
|
gradle-wrapper.jar
|
||||||
/.gradle
|
/.gradle
|
||||||
/captures/
|
/captures/
|
||||||
|
8
moneymgr_mobile/android/README.md
Normal file
8
moneymgr_mobile/android/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Android version of application
|
||||||
|
|
||||||
|
Generate keystore:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
keytool -genkey -v -keystore ./keystore.jks -keyalg RSA \
|
||||||
|
-keysize 2048 -validity 20000 -alias moneymgr
|
||||||
|
```
|
@@ -1,3 +1,6 @@
|
|||||||
|
import java.util.Properties
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("kotlin-android")
|
id("kotlin-android")
|
||||||
@@ -5,6 +8,12 @@ plugins {
|
|||||||
id("dev.flutter.flutter-gradle-plugin")
|
id("dev.flutter.flutter-gradle-plugin")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val keystoreProperties = Properties()
|
||||||
|
val keystorePropertiesFile = rootProject.file("publish_key.properties")
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "org.communiquons.moneymgr"
|
namespace = "org.communiquons.moneymgr"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
@@ -21,7 +30,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
||||||
applicationId = "org.communiquons.moneymgr"
|
applicationId = "org.communiquons.moneymgr"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||||
@@ -31,15 +39,36 @@ android {
|
|||||||
versionName = flutter.versionName
|
versionName = flutter.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
create("publish") {
|
||||||
|
keyAlias = keystoreProperties["keyAlias"] as String
|
||||||
|
keyPassword = keystoreProperties["keyPassword"] as String
|
||||||
|
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||||
|
storePassword = keystoreProperties["storePassword"] as String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
// signingConfig = signingConfigs.getByName("debug")
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flavorDimensions += "default"
|
||||||
|
productFlavors {
|
||||||
|
create("development") {
|
||||||
|
dimension = "default"
|
||||||
|
applicationIdSuffix = ".debug"
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
}
|
}
|
||||||
|
create("publish") {
|
||||||
|
dimension = "default"
|
||||||
|
signingConfig = signingConfigs.getByName("publish")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
flutter {
|
flutter {
|
||||||
source = "../.."
|
source = "../.."
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- The INTERNET permission is required for development. Specifically,
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
the Flutter tool needs it to communicate with the running application
|
the Flutter tool needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
@@ -6,5 +7,8 @@
|
|||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<!-- In debug mode, unsecure traffic is permitted -->
|
<!-- In debug mode, unsecure traffic is permitted -->
|
||||||
<application android:usesCleartextTraffic="true" />
|
<application
|
||||||
|
android:label="MoneyMgr Debug"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
tools:replace="android:label" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="false"
|
||||||
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
|
android:fullBackupContent="false" />
|
||||||
|
</manifest>
|
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<data-extraction-rules>
|
||||||
|
<cloud-backup>
|
||||||
|
<exclude domain="root" />
|
||||||
|
<exclude domain="file" />
|
||||||
|
<exclude domain="database" />
|
||||||
|
<exclude domain="sharedpref" />
|
||||||
|
<exclude domain="external" />
|
||||||
|
</cloud-backup>
|
||||||
|
<device-transfer>
|
||||||
|
<exclude domain="root" />
|
||||||
|
<exclude domain="file" />
|
||||||
|
<exclude domain="database" />
|
||||||
|
<exclude domain="sharedpref" />
|
||||||
|
<exclude domain="external" />
|
||||||
|
</device-transfer>
|
||||||
|
</data-extraction-rules>
|
23
moneymgr_mobile/android/ci_write_keystore.sh
Normal file
23
moneymgr_mobile/android/ci_write_keystore.sh
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(temp=$( realpath "$0" ) && dirname "$temp")"
|
||||||
|
|
||||||
|
KEYSTORE_PATH="$SCRIPT_DIR/keystore.jks"
|
||||||
|
PROPERTIES_PATH="$SCRIPT_DIR/publish_key.properties"
|
||||||
|
|
||||||
|
echo Keystore path : $KEYSTORE_PATH
|
||||||
|
echo Properties path : $PROPERTIES_PATH
|
||||||
|
|
||||||
|
[ ! -n "$JKS_KEYSTORE" ] && echo 'Missing JKS_KEYSTORE variable!'&& exit 1
|
||||||
|
[ ! -n "$JKS_KEYSTORE_PASSWORD" ] && echo 'Missing JKS_KEYSTORE_PASSWORD variable!' && exit 1
|
||||||
|
|
||||||
|
# Write keystore
|
||||||
|
echo $JKS_KEYSTORE | base64 -d > "$KEYSTORE_PATH"
|
||||||
|
|
||||||
|
# Write keystore config
|
||||||
|
cat > "$PROPERTIES_PATH" <<_EOF
|
||||||
|
storePassword=$JKS_KEYSTORE_PASSWORD
|
||||||
|
keyPassword=$JKS_KEYSTORE_PASSWORD
|
||||||
|
keyAlias=moneymgr
|
||||||
|
storeFile=$KEYSTORE_PATH
|
||||||
|
_EOF
|
4
moneymgr_mobile/android/publish_key.properties.sample
Normal file
4
moneymgr_mobile/android/publish_key.properties.sample
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
storePassword=<password-from-previous-step>
|
||||||
|
keyPassword=<password-from-previous-step>
|
||||||
|
keyAlias=upload
|
||||||
|
storeFile=<keystore-file-location>
|
@@ -1,45 +1,31 @@
|
|||||||
import 'dart:io';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
||||||
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/storage/prefs.dart';
|
||||||
|
import 'package:moneymgr_mobile/utils/ocr_utils.dart';
|
||||||
|
import 'package:moneymgr_mobile/utils/pdf_utils.dart';
|
||||||
import 'package:moneymgr_mobile/widgets/expense_editor.dart';
|
import 'package:moneymgr_mobile/widgets/expense_editor.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:scanbot_sdk/scanbot_sdk.dart';
|
|
||||||
import 'package:scanbot_sdk/scanbot_sdk_ui_v2.dart' hide IconButton, EdgeInsets;
|
|
||||||
|
|
||||||
part 'scan_screen.g.dart';
|
part 'scan_screen.g.dart';
|
||||||
|
|
||||||
/// Scan a document & return generated PDF as byte file
|
/// Scan a document & return generated PDF as byte file
|
||||||
@riverpod
|
@riverpod
|
||||||
Future<Uint8List?> _scanDocument(Ref ref) async {
|
Future<(Uint8List?, BaseExpenseInfo?)> _scanDocument(Ref ref) async {
|
||||||
var configuration = DocumentScanningFlow(
|
final prefs = ref.watch(prefsProvider).requireValue;
|
||||||
appearance: DocumentFlowAppearanceConfiguration(
|
|
||||||
statusBarMode: StatusBarMode.DARK,
|
|
||||||
),
|
|
||||||
cleanScanningSession: true,
|
|
||||||
outputSettings: DocumentScannerOutputSettings(pagesScanLimit: 1),
|
|
||||||
screens: DocumentScannerScreens(
|
|
||||||
review: ReviewScreenConfiguration(enabled: false),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
var documentResult = await ScanbotSdkUiV2.startDocumentScanner(configuration);
|
|
||||||
|
|
||||||
if (documentResult.status != OperationStatus.OK) {
|
final pdf = await scanDocAsPDF();
|
||||||
throw Exception("Scanner failed with status ${documentResult.status}");
|
final img = await renderPdf(pdfBytes: pdf);
|
||||||
}
|
final amount = await extractInfoFromBill(
|
||||||
|
imgBuff: img,
|
||||||
// Convert result to PDF
|
extractDates: !prefs.disableExtractDates(),
|
||||||
var result = await ScanbotSdk.document.createPDFForDocument(
|
|
||||||
PDFFromDocumentParams(
|
|
||||||
documentID: documentResult.data!.uuid,
|
|
||||||
pdfConfiguration: PdfConfiguration(),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
final pdfPath = result.pdfFileUri.replaceFirst("file://", "");
|
return (pdf, amount);
|
||||||
return File(pdfPath).readAsBytes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ScanScreen extends HookConsumerWidget {
|
class ScanScreen extends HookConsumerWidget {
|
||||||
@@ -52,8 +38,8 @@ class ScanScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
restartScan() async {
|
restartScan() async {
|
||||||
try {
|
try {
|
||||||
final val = ref.refresh(_scanDocumentProvider);
|
ref.invalidate(_scanDocumentProvider);
|
||||||
Logger.root.info("Load again startup result: $val");
|
Logger.root.info("Load again startup");
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logger.root.shout("Failed to try again startup loading! $e $s");
|
Logger.root.shout("Failed to try again startup loading! $e $s");
|
||||||
}
|
}
|
||||||
@@ -62,21 +48,24 @@ class ScanScreen extends HookConsumerWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: switch (scanDocProvider) {
|
child: switch (scanDocProvider) {
|
||||||
AsyncData(:final value) when value != null => ExpenseEditor(
|
AsyncData(:final value) when value.$1 != null => ExpenseEditor(
|
||||||
file: value,
|
file: value.$1!,
|
||||||
|
initialData: value.$2,
|
||||||
onFinished: (expense) async {
|
onFinished: (expense) async {
|
||||||
await expenses.add(
|
await expenses.add(
|
||||||
info: expense,
|
info: expense,
|
||||||
fileContent: value,
|
fileContent: value.$1!,
|
||||||
fileMimeType: "application/pdf",
|
fileMimeType: "application/pdf",
|
||||||
);
|
);
|
||||||
restartScan();
|
if (context.mounted) {
|
||||||
|
context.pushReplacement(scansPage);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onRescan: restartScan,
|
onRescan: restartScan,
|
||||||
),
|
),
|
||||||
|
|
||||||
// No data
|
// No data
|
||||||
AsyncData(:final value) when value == null => ScanErrorScreen(
|
AsyncData(:final value) when value.$1 == null => ScanErrorScreen(
|
||||||
message: "No document scanned!",
|
message: "No document scanned!",
|
||||||
onTryAgain: restartScan,
|
onTryAgain: restartScan,
|
||||||
),
|
),
|
||||||
|
@@ -48,6 +48,12 @@ class _ExpensesList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (list.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text("There is no entry waiting for upload (yet)"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemBuilder: (context, entryNum) {
|
itemBuilder: (context, entryNum) {
|
||||||
final expense = list[entryNum];
|
final expense = list[entryNum];
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:moneymgr_mobile/providers/settings.dart';
|
import 'package:moneymgr_mobile/providers/settings.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/storage/prefs.dart';
|
||||||
import 'package:moneymgr_mobile/utils/extensions.dart';
|
import 'package:moneymgr_mobile/utils/extensions.dart';
|
||||||
|
|
||||||
class SettingsScreen extends ConsumerWidget {
|
class SettingsScreen extends ConsumerWidget {
|
||||||
@@ -8,6 +9,7 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final prefs = ref.watch(prefsProvider).requireValue;
|
||||||
final themeMode = ref.watch(currentThemeModeProvider);
|
final themeMode = ref.watch(currentThemeModeProvider);
|
||||||
|
|
||||||
void onTapThemeMode() =>
|
void onTapThemeMode() =>
|
||||||
@@ -15,6 +17,16 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
|
|
||||||
void onTapLicenses() => context.showAppLicensePage();
|
void onTapLicenses() => context.showAppLicensePage();
|
||||||
|
|
||||||
|
handleToggleStartScreen(v) async {
|
||||||
|
await prefs.setStartOnScansListScreen(v);
|
||||||
|
ref.invalidate(prefsProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleToggleDisableExtractDate(v) async {
|
||||||
|
await prefs.setDisableExtractDates(v);
|
||||||
|
ref.invalidate(prefsProvider);
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('Settings')),
|
appBar: AppBar(title: const Text('Settings')),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
@@ -25,6 +37,22 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
trailing: Text(themeMode.label),
|
trailing: Text(themeMode.label),
|
||||||
onTap: onTapThemeMode,
|
onTap: onTapThemeMode,
|
||||||
),
|
),
|
||||||
|
SwitchListTile(
|
||||||
|
value: prefs.startOnScansListScreen(),
|
||||||
|
onChanged: handleToggleStartScreen,
|
||||||
|
title: Text("Start on scans screen"),
|
||||||
|
subtitle: Text(
|
||||||
|
"Do not start camera automatically on application startup",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SwitchListTile(
|
||||||
|
value: prefs.disableExtractDates(),
|
||||||
|
onChanged: handleToggleDisableExtractDate,
|
||||||
|
title: Text("Do not extract dates"),
|
||||||
|
subtitle: Text(
|
||||||
|
"Do not attempt to extract dates from scanned expenses",
|
||||||
|
),
|
||||||
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.info_outline),
|
leading: const Icon(Icons.info_outline),
|
||||||
|
27
moneymgr_mobile/lib/services/api/inbox_api.dart
Normal file
27
moneymgr_mobile/lib/services/api/inbox_api.dart
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|
||||||
|
import 'api_client.dart';
|
||||||
|
|
||||||
|
part 'inbox_api.freezed.dart';
|
||||||
|
part 'inbox_api.g.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class UpdateInboxEntryRequest with _$UpdateInboxEntryRequest {
|
||||||
|
const factory UpdateInboxEntryRequest({
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
required int file_id,
|
||||||
|
required int time,
|
||||||
|
required String? label,
|
||||||
|
required double? amount,
|
||||||
|
}) = _UpdateInboxEntryRequest;
|
||||||
|
|
||||||
|
factory UpdateInboxEntryRequest.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$UpdateInboxEntryRequestFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
extension InboxApi on ApiClient {
|
||||||
|
/// Create a new inbox entry
|
||||||
|
Future<void> createInboxEntry(UpdateInboxEntryRequest entry) async {
|
||||||
|
await execute("/inbox", method: "POST", data: entry.toJson());
|
||||||
|
}
|
||||||
|
}
|
@@ -11,6 +11,7 @@ import 'package:moneymgr_mobile/routes/scan_details/scan_details.dart';
|
|||||||
import 'package:moneymgr_mobile/routes/scans_list/scans_list_screen.dart';
|
import 'package:moneymgr_mobile/routes/scans_list/scans_list_screen.dart';
|
||||||
import 'package:moneymgr_mobile/routes/settings/settings_screen.dart';
|
import 'package:moneymgr_mobile/routes/settings/settings_screen.dart';
|
||||||
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/storage/prefs.dart';
|
||||||
import 'package:moneymgr_mobile/widgets/load_startup_data.dart';
|
import 'package:moneymgr_mobile/widgets/load_startup_data.dart';
|
||||||
import 'package:moneymgr_mobile/widgets/scaffold_with_navigation.dart';
|
import 'package:moneymgr_mobile/widgets/scaffold_with_navigation.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
@@ -29,6 +30,8 @@ GoRouter router(Ref ref) {
|
|||||||
authStateNotifier.value = value;
|
authStateNotifier.value = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final prefs = ref.read(prefsProvider).requireValue;
|
||||||
|
|
||||||
// This is the only place you need to define your navigation items. The items
|
// This is the only place you need to define your navigation items. The items
|
||||||
// will be propagated automatically to the router and the navigation bar/rail
|
// will be propagated automatically to the router and the navigation bar/rail
|
||||||
// of the scaffold.
|
// of the scaffold.
|
||||||
@@ -70,22 +73,22 @@ GoRouter router(Ref ref) {
|
|||||||
|
|
||||||
final router = GoRouter(
|
final router = GoRouter(
|
||||||
debugLogDiagnostics: true,
|
debugLogDiagnostics: true,
|
||||||
initialLocation: navigationItems.first.path,
|
initialLocation: prefs.startOnScansListScreen() ? scansPage : capturePage,
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(path: homePage, builder: (_, __) => const Scaffold()),
|
GoRoute(path: homePage, builder: (_, _) => const Scaffold()),
|
||||||
GoRoute(path: authPage, builder: (_, __) => const LoginScreen()),
|
GoRoute(path: authPage, builder: (_, _) => const LoginScreen()),
|
||||||
GoRoute(path: qrAuthPath, builder: (_, __) => const QrAuthScreen()),
|
GoRoute(path: qrAuthPath, builder: (_, _) => const QrAuthScreen()),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: manualAuthPage,
|
path: manualAuthPage,
|
||||||
builder: (_, __) => const ManualAuthScreen(),
|
builder: (_, _) => const ManualAuthScreen(),
|
||||||
),
|
),
|
||||||
GoRoute(path: settingsPage, builder: (_, __) => const SettingsScreen()),
|
GoRoute(path: settingsPage, builder: (_, _) => const SettingsScreen()),
|
||||||
|
|
||||||
// Configuration for the bottom navigation bar routes. The routes themselves
|
// Configuration for the bottom navigation bar routes. The routes themselves
|
||||||
// should be defined in [navigationItems]. Modification to this [ShellRoute]
|
// should be defined in [navigationItems]. Modification to this [ShellRoute]
|
||||||
// config is rarely needed.
|
// config is rarely needed.
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
builder: (_, __, child) => child,
|
builder: (_, _, child) => child,
|
||||||
routes: [
|
routes: [
|
||||||
for (final (index, item) in navigationItems.indexed)
|
for (final (index, item) in navigationItems.indexed)
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
@@ -15,6 +15,22 @@ Future<SharedPreferencesWithCache> prefs(Ref ref) =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
extension MoneyMgrSharedPreferences on SharedPreferencesWithCache {
|
extension MoneyMgrSharedPreferences on SharedPreferencesWithCache {
|
||||||
|
bool startOnScansListScreen() {
|
||||||
|
return getBool("startOnScansListScreen") ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setStartOnScansListScreen(bool start) async {
|
||||||
|
await setBool("startOnScansListScreen", start);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool disableExtractDates() {
|
||||||
|
return getBool("disableExtractDates") ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setDisableExtractDates(bool disable) async {
|
||||||
|
await setBool("disableExtractDates", disable);
|
||||||
|
}
|
||||||
|
|
||||||
ServerConfig? serverConfig() {
|
ServerConfig? serverConfig() {
|
||||||
final json = getString("serverConfig");
|
final json = getString("serverConfig");
|
||||||
if (json != null) return ServerConfig.fromJson(jsonDecode(json));
|
if (json != null) return ServerConfig.fromJson(jsonDecode(json));
|
||||||
|
86
moneymgr_mobile/lib/utils/ocr_utils.dart
Normal file
86
moneymgr_mobile/lib/utils/ocr_utils.dart
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
||||||
|
|
||||||
|
/// Attempt to extract information from invoice image
|
||||||
|
Future<BaseExpenseInfo?> extractInfoFromBill({
|
||||||
|
required Uint8List imgBuff,
|
||||||
|
required bool extractDates,
|
||||||
|
}) async {
|
||||||
|
final decodedImage = await decodeImageFromList(imgBuff);
|
||||||
|
|
||||||
|
final byteData = await decodedImage.toByteData(
|
||||||
|
format: ui.ImageByteFormat.rawRgba,
|
||||||
|
);
|
||||||
|
|
||||||
|
final image = InputImage.fromBitmap(
|
||||||
|
bitmap: byteData!.buffer.asUint8List(),
|
||||||
|
width: decodedImage.width,
|
||||||
|
height: decodedImage.height,
|
||||||
|
);
|
||||||
|
|
||||||
|
final textRecognizer = TextRecognizer(script: TextRecognitionScript.latin);
|
||||||
|
final extractionResult = await textRecognizer.processImage(image);
|
||||||
|
|
||||||
|
Logger.root.fine("Expense text: ${extractionResult.text}");
|
||||||
|
|
||||||
|
// Check for highestCost amount on invoice
|
||||||
|
final costRegexp = RegExp(
|
||||||
|
r'([0-9]+([ ]*(\\.|,)[ ]*[0-9]{1,2}){0,1})([ \\t\\n]*(EUR|eur|€)|E)',
|
||||||
|
multiLine: true,
|
||||||
|
caseSensitive: false,
|
||||||
|
);
|
||||||
|
var highestCost = 0.0;
|
||||||
|
for (final match in costRegexp.allMatches(extractionResult.text)) {
|
||||||
|
if (match.groupCount == 0) continue;
|
||||||
|
|
||||||
|
// Process only numeric value
|
||||||
|
final value = (match.group(1) ?? "").replaceAll(",", ".");
|
||||||
|
highestCost = max(highestCost, double.tryParse(value) ?? 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for highestCost amount on invoice
|
||||||
|
final dateRegexp = RegExp(
|
||||||
|
r'([0-3][0-9])(\/|-)([0-1][0-9])(\/|-)((20|)[0-9]{2})',
|
||||||
|
multiLine: false,
|
||||||
|
caseSensitive: false,
|
||||||
|
);
|
||||||
|
final currDate = DateTime.now();
|
||||||
|
DateTime? newest;
|
||||||
|
for (final match in dateRegexp.allMatches(extractionResult.text)) {
|
||||||
|
if (match.groupCount < 6) continue;
|
||||||
|
|
||||||
|
int year = int.tryParse(match.group(5)!) ?? currDate.year;
|
||||||
|
|
||||||
|
try {
|
||||||
|
final date = DateTime(
|
||||||
|
year > 99 ? year : (2000 + year),
|
||||||
|
int.tryParse(match.group(3)!) ?? currDate.month,
|
||||||
|
int.tryParse(match.group(1)!) ?? currDate.day,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (newest == null) {
|
||||||
|
newest = date;
|
||||||
|
} else {
|
||||||
|
newest = DateTime.fromMillisecondsSinceEpoch(
|
||||||
|
max(newest.millisecondsSinceEpoch, date.millisecondsSinceEpoch),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e, s) {
|
||||||
|
Logger.root.warning("Failed to parse date! $e$s");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return BaseExpenseInfo(
|
||||||
|
label: null,
|
||||||
|
cost: highestCost,
|
||||||
|
time: extractDates && (newest?.isBefore(currDate) ?? false)
|
||||||
|
? newest!
|
||||||
|
: currDate,
|
||||||
|
);
|
||||||
|
}
|
@@ -6,14 +6,40 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:pdf_image_renderer/pdf_image_renderer.dart';
|
import 'package:pdf_image_renderer/pdf_image_renderer.dart';
|
||||||
|
import 'package:scanbot_sdk/scanbot_sdk.dart';
|
||||||
|
import 'package:scanbot_sdk/scanbot_sdk_ui_v2.dart' hide IconButton, EdgeInsets;
|
||||||
|
|
||||||
|
/// Scan document as PDF
|
||||||
|
Future<Uint8List> scanDocAsPDF() async {
|
||||||
|
var configuration = DocumentScanningFlow(
|
||||||
|
appearance: DocumentFlowAppearanceConfiguration(
|
||||||
|
statusBarMode: StatusBarMode.DARK,
|
||||||
|
),
|
||||||
|
cleanScanningSession: true,
|
||||||
|
outputSettings: DocumentScannerOutputSettings(pagesScanLimit: 1),
|
||||||
|
screens: DocumentScannerScreens(
|
||||||
|
review: ReviewScreenConfiguration(enabled: false),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
var documentResult = await ScanbotSdkUiV2.startDocumentScanner(configuration);
|
||||||
|
|
||||||
|
if (documentResult.status != OperationStatus.OK) {
|
||||||
|
throw Exception("Scanner failed with status ${documentResult.status}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert result to PDF
|
||||||
|
var result = await ScanbotSdk.document.createPDFForDocument(
|
||||||
|
PDFFromDocumentParams(
|
||||||
|
documentID: documentResult.data!.uuid,
|
||||||
|
pdfConfiguration: PdfConfiguration(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final pdfPath = result.pdfFileUri.replaceFirst("file://", "");
|
||||||
|
return File(pdfPath).readAsBytes();
|
||||||
|
}
|
||||||
|
|
||||||
/// Render PDF to image bits
|
/// Render PDF to image bits
|
||||||
Future<Uint8List> renderPdf(
|
Future<Uint8List> renderPdf({String? path, Uint8List? pdfBytes}) async {
|
||||||
{
|
|
||||||
String? path,
|
|
||||||
Uint8List? pdfBytes,
|
|
||||||
}) async {
|
|
||||||
assert(path != null || pdfBytes != null);
|
assert(path != null || pdfBytes != null);
|
||||||
|
|
||||||
// Create temporary file if required
|
// Create temporary file if required
|
||||||
|
@@ -40,6 +40,20 @@ class ExpenseEditor extends HookConsumerWidget {
|
|||||||
|
|
||||||
final (:pending, :snapshot, :hasError) = useAsyncTask();
|
final (:pending, :snapshot, :hasError) = useAsyncTask();
|
||||||
|
|
||||||
|
// Force refresh of field if required
|
||||||
|
final previousData = useState<BaseExpenseInfo?>(null);
|
||||||
|
if (initialData != previousData.value) {
|
||||||
|
previousData.value = initialData;
|
||||||
|
labelController.text = initialData?.label ?? "";
|
||||||
|
costController.text = initialData?.cost.toString() ?? "";
|
||||||
|
timeController.value = initialData?.time ?? DateTime.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear cost value
|
||||||
|
handleClearCost() {
|
||||||
|
costController.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
// Pick a new date
|
// Pick a new date
|
||||||
handlePickDate() async {
|
handlePickDate() async {
|
||||||
final date = await showDatePicker(
|
final date = await showDatePicker(
|
||||||
@@ -65,6 +79,11 @@ class ExpenseEditor extends HookConsumerWidget {
|
|||||||
time: timeController.value,
|
time: timeController.value,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Reset screen after a scan
|
||||||
|
await pending.value;
|
||||||
|
labelController.text = "";
|
||||||
|
costController.text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel operation
|
// Cancel operation
|
||||||
@@ -89,6 +108,19 @@ class ExpenseEditor extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open invoice in full screen
|
||||||
|
handleFullScreenInvoice() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (c) => Scaffold(
|
||||||
|
appBar: AppBar(title: Text("Expense")),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: PDFViewer(pdfBytes: file, fit: BoxFit.fitWidth),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("Expense info"),
|
title: Text("Expense info"),
|
||||||
@@ -120,8 +152,11 @@ class ExpenseEditor extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
// Expense preview
|
// Expense preview
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: handleFullScreenInvoice,
|
||||||
child: PDFViewer(pdfBytes: file, fit: BoxFit.contain),
|
child: PDFViewer(pdfBytes: file, fit: BoxFit.contain),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
|
|
||||||
@@ -132,7 +167,13 @@ class ExpenseEditor extends HookConsumerWidget {
|
|||||||
decimal: true,
|
decimal: true,
|
||||||
signed: false,
|
signed: false,
|
||||||
),
|
),
|
||||||
decoration: const InputDecoration(labelText: 'Cost'),
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Cost',
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
onPressed: handleClearCost,
|
||||||
|
icon: const Icon(Icons.clear),
|
||||||
|
),
|
||||||
|
),
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:moneymgr_mobile/services/api/api_client.dart';
|
import 'package:moneymgr_mobile/services/api/api_client.dart';
|
||||||
import 'package:moneymgr_mobile/services/api/files_api.dart';
|
import 'package:moneymgr_mobile/services/api/files_api.dart';
|
||||||
|
import 'package:moneymgr_mobile/services/api/inbox_api.dart';
|
||||||
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
import 'package:moneymgr_mobile/services/storage/expenses.dart';
|
||||||
import 'package:moneymgr_mobile/utils/extensions.dart';
|
import 'package:moneymgr_mobile/utils/extensions.dart';
|
||||||
import 'package:moneymgr_mobile/utils/hooks.dart';
|
import 'package:moneymgr_mobile/utils/hooks.dart';
|
||||||
@@ -27,9 +28,21 @@ Future<void> _performSynchronization(Ref ref) async {
|
|||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO continue
|
// Then, create the inbox entry
|
||||||
break;
|
await apiService.createInboxEntry(
|
||||||
|
UpdateInboxEntryRequest(
|
||||||
|
file_id: file.id,
|
||||||
|
time: exp.time,
|
||||||
|
label: exp.label,
|
||||||
|
amount: -1 * exp.cost,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Lastly delete the local expense
|
||||||
|
ref.watch(expensesProvider).requireValue.deleteExpense(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ref.invalidate(expensesProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SynchronizeButton extends HookConsumerWidget {
|
class SynchronizeButton extends HookConsumerWidget {
|
||||||
|
@@ -141,10 +141,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: built_value
|
name: built_value
|
||||||
sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27"
|
sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.10.1"
|
version: "8.11.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -370,10 +370,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
flutter_native_splash:
|
flutter_native_splash:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -452,18 +452,18 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: freezed
|
name: freezed
|
||||||
sha256: "6022db4c7bfa626841b2a10f34dd1e1b68e8f8f9650db6112dcdeeca45ca793c"
|
sha256: "2d399f823b8849663744d2a9ddcce01c49268fb4170d0442a655bf6a2f47be22"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.6"
|
version: "3.1.0"
|
||||||
freezed_annotation:
|
freezed_annotation:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: freezed_annotation
|
name: freezed_annotation
|
||||||
sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b
|
sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.1.0"
|
||||||
frontend_server_client:
|
frontend_server_client:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -484,10 +484,26 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: go_router
|
name: go_router
|
||||||
sha256: ac294be30ba841830cfa146e5a3b22bb09f8dc5a0fdd9ca9332b04b0bde99ebf
|
sha256: c489908a54ce2131f1d1b7cc631af9c1a06fac5ca7c449e959192089f9489431
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "15.2.4"
|
version: "16.0.0"
|
||||||
|
google_mlkit_commons:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_mlkit_commons
|
||||||
|
sha256: "8f40fbac10685cad4715d11e6a0d86837d9ad7168684dfcad29610282a88e67a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.11.0"
|
||||||
|
google_mlkit_text_recognition:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: google_mlkit_text_recognition
|
||||||
|
sha256: "96173ad4dd7fd06c660e22ac3f9e9f1798a517fe7e48bee68eeec83853224224"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.15.0"
|
||||||
graphs:
|
graphs:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -604,10 +620,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.1"
|
version: "6.0.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -921,10 +937,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_helper
|
name: source_helper
|
||||||
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
|
sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.5"
|
version: "1.3.6"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@@ -49,10 +49,10 @@ dependencies:
|
|||||||
riverpod_annotation: ^2.6.1
|
riverpod_annotation: ^2.6.1
|
||||||
|
|
||||||
# Implement React hooks in Flutter
|
# Implement React hooks in Flutter
|
||||||
flutter_hooks: ^0.21.2
|
flutter_hooks: ^0.21.3+1
|
||||||
|
|
||||||
# Router
|
# Router
|
||||||
go_router: ^15.2.4
|
go_router: ^16.0.0
|
||||||
|
|
||||||
# Flutter extras widgets for columns and rows
|
# Flutter extras widgets for columns and rows
|
||||||
flextras: ^1.0.0
|
flextras: ^1.0.0
|
||||||
@@ -84,7 +84,7 @@ dependencies:
|
|||||||
# Document scanner
|
# Document scanner
|
||||||
# flutter_doc_scanner: ^0.0.16 # no bundled support yet
|
# flutter_doc_scanner: ^0.0.16 # no bundled support yet
|
||||||
# https://developers.google.com/ml-kit/tips/installation-paths
|
# https://developers.google.com/ml-kit/tips/installation-paths
|
||||||
scanbot_sdk: ^7.0.0
|
scanbot_sdk: ^7.0.1
|
||||||
|
|
||||||
# Get documents path
|
# Get documents path
|
||||||
path_provider: ^2.1.5
|
path_provider: ^2.1.5
|
||||||
@@ -93,6 +93,9 @@ dependencies:
|
|||||||
# PDF renderer
|
# PDF renderer
|
||||||
pdf_image_renderer: ^1.0.1
|
pdf_image_renderer: ^1.0.1
|
||||||
|
|
||||||
|
# Text extraction
|
||||||
|
google_mlkit_text_recognition: ^0.15.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@@ -102,13 +105,13 @@ dev_dependencies:
|
|||||||
# activated in the `analysis_options.yaml` file located at the root of your
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
# Manage app icon
|
# Manage app icon
|
||||||
flutter_launcher_icons: ^0.14.4
|
flutter_launcher_icons: ^0.14.4
|
||||||
|
|
||||||
# Generate source code
|
# Generate source code
|
||||||
build_runner: ^2.5.4
|
build_runner: ^2.6.1
|
||||||
|
|
||||||
# Riverpod code generation
|
# Riverpod code generation
|
||||||
riverpod_generator: ^2.6.5
|
riverpod_generator: ^2.6.5
|
||||||
@@ -127,6 +130,9 @@ dev_dependencies:
|
|||||||
# The following section is specific to Flutter packages.
|
# The following section is specific to Flutter packages.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
|
# Default Android flavor
|
||||||
|
default-flavor: development
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
|
2867
moneymgr_web/package-lock.json
generated
2867
moneymgr_web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,38 +12,38 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@emotion/styled": "^11.14.1",
|
"@emotion/styled": "^11.14.1",
|
||||||
"@fontsource/roboto": "^5.2.6",
|
"@fontsource/roboto": "^5.2.8",
|
||||||
"@jsonjoy.com/base64": "^1.1.2",
|
"@jsonjoy.com/base64": "^1.1.2",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
"@mdi/react": "^1.6.1",
|
"@mdi/react": "^1.6.1",
|
||||||
"@mui/icons-material": "^7.1.2",
|
"@mui/icons-material": "^7.1.2",
|
||||||
"@mui/material": "^7.1.2",
|
"@mui/material": "^7.1.2",
|
||||||
"@mui/x-charts": "^8.8.0",
|
"@mui/x-charts": "^8.10.2",
|
||||||
"@mui/x-data-grid": "^8.8.0",
|
"@mui/x-data-grid": "^8.9.2",
|
||||||
"@mui/x-date-pickers": "^8.7.0",
|
"@mui/x-date-pickers": "^8.9.2",
|
||||||
"date-and-time": "^3.6.0",
|
"date-and-time": "^3.6.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.18",
|
||||||
"filesize": "^10.1.6",
|
"filesize": "^10.1.6",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "^4.2.0",
|
||||||
"react": "^19.1.0",
|
"react": "^19.2.0",
|
||||||
"react-dom": "^19.1.0",
|
"react-dom": "^19.2.0",
|
||||||
"react-router": "^7.6.3",
|
"react-router": "^7.6.3",
|
||||||
"react-router-dom": "^7.6.3",
|
"react-router-dom": "^7.6.3",
|
||||||
"ts-pattern": "^5.7.1"
|
"ts-pattern": "^5.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.31.0",
|
"@eslint/js": "^9.33.0",
|
||||||
"@types/react": "^19.1.8",
|
"@types/react": "^19.2.0",
|
||||||
"@types/react-dom": "^19.1.6",
|
"@types/react-dom": "^19.2.0",
|
||||||
"@vitejs/plugin-react": "^4.6.0",
|
"@vitejs/plugin-react": "^4.7.0",
|
||||||
"eslint": "^9.26.0",
|
"eslint": "^9.32.0",
|
||||||
"eslint-plugin-react-dom": "^1.49.0",
|
"eslint-plugin-react-dom": "^1.52.4",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-react-refresh": "^00.4.20",
|
"eslint-plugin-react-refresh": "^00.4.20",
|
||||||
"eslint-plugin-react-x": "^1.52.3",
|
"eslint-plugin-react-x": "^1.52.9",
|
||||||
"globals": "^16.2.0",
|
"globals": "^16.3.0",
|
||||||
"typescript": "~5.8.3",
|
"typescript": "~5.8.3",
|
||||||
"typescript-eslint": "^8.32.1",
|
"typescript-eslint": "^8.32.1",
|
||||||
"vite": "^6.3.5"
|
"vite": "^6.3.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ import { APIClient } from "./ApiClient";
|
|||||||
export interface ServerConfig {
|
export interface ServerConfig {
|
||||||
auth_disabled: boolean;
|
auth_disabled: boolean;
|
||||||
oidc_provider_name: string;
|
oidc_provider_name: string;
|
||||||
|
apk_download_url: string;
|
||||||
accounts_types: AccountType[];
|
accounts_types: AccountType[];
|
||||||
constraints: ServerConstraints;
|
constraints: ServerConstraints;
|
||||||
}
|
}
|
||||||
|
@@ -280,6 +280,8 @@ function CreatedToken(p: { token: TokenWithSecret }): React.ReactElement {
|
|||||||
The API token was successfully created. Please note the following
|
The API token was successfully created. Please note the following
|
||||||
information as they won't be available next.
|
information as they won't be available next.
|
||||||
<br />
|
<br />
|
||||||
|
API URL : <CopyTextChip text={APIClient.ActualBackendURL()} />
|
||||||
|
<br />
|
||||||
Token ID: <CopyTextChip text={p.token.id.toString()} />
|
Token ID: <CopyTextChip text={p.token.id.toString()} />
|
||||||
<br />
|
<br />
|
||||||
Token value: <CopyTextChip text={p.token.token} />
|
Token value: <CopyTextChip text={p.token.token} />
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { mdiApi, mdiCash } from "@mdi/js";
|
import { mdiApi, mdiCash } from "@mdi/js";
|
||||||
import Icon from "@mdi/react";
|
import Icon from "@mdi/react";
|
||||||
|
import AndroidIcon from "@mui/icons-material/Android";
|
||||||
import CloudDownloadIcon from "@mui/icons-material/CloudDownload";
|
import CloudDownloadIcon from "@mui/icons-material/CloudDownload";
|
||||||
import LogoutIcon from "@mui/icons-material/Logout";
|
import LogoutIcon from "@mui/icons-material/Logout";
|
||||||
import SettingsIcon from "@mui/icons-material/Settings";
|
import SettingsIcon from "@mui/icons-material/Settings";
|
||||||
@@ -10,6 +11,7 @@ import MenuItem from "@mui/material/MenuItem";
|
|||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { ServerApi } from "../api/ServerApi";
|
||||||
import { useAuthInfo } from "./BaseAuthenticatedPage";
|
import { useAuthInfo } from "./BaseAuthenticatedPage";
|
||||||
import { DarkThemeButton } from "./DarkThemeButtonWidget";
|
import { DarkThemeButton } from "./DarkThemeButtonWidget";
|
||||||
import { PublicModeButton } from "./PublicModeButtonWidget";
|
import { PublicModeButton } from "./PublicModeButtonWidget";
|
||||||
@@ -100,6 +102,18 @@ export function MoneyWebAppBar(p: {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
|
|
||||||
|
{/* APK download */}
|
||||||
|
<RouterLink to={ServerApi.Config.apk_download_url}>
|
||||||
|
<MenuItem>
|
||||||
|
<ListItemIcon>
|
||||||
|
<AndroidIcon />
|
||||||
|
</ListItemIcon>
|
||||||
|
<ListItemText secondary="Scan expenses from your smartphone">
|
||||||
|
Mobile Application
|
||||||
|
</ListItemText>
|
||||||
|
</MenuItem>
|
||||||
|
</RouterLink>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{/* Sign out */}
|
{/* Sign out */}
|
||||||
|
Reference in New Issue
Block a user