mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-04 06:51:45 -04:00
Compare commits
1033 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62821ed803 | ||
|
|
903d62ed57 | ||
|
|
adef626b34 | ||
|
|
11a933cc04 | ||
|
|
4b5ce99bb1 | ||
|
|
f8dff77cee | ||
|
|
0a9b08803e | ||
|
|
39a8568663 | ||
|
|
e1502440eb | ||
|
|
5834d032c3 | ||
|
|
0a28a2af61 | ||
|
|
259f56bd26 | ||
|
|
011ad66a3f | ||
|
|
281c72f88d | ||
|
|
1293523ebf | ||
|
|
67e5d34f39 | ||
|
|
8b3dec6116 | ||
|
|
3359f49f0a | ||
|
|
9715cae587 | ||
|
|
4b122bd907 | ||
|
|
edefa36c8a | ||
|
|
e40a352aed | ||
|
|
70267f0623 | ||
|
|
c19ed7f6d5 | ||
|
|
e2fb0f2ee8 | ||
|
|
f9e208a7e0 | ||
|
|
ee2b8a60a2 | ||
|
|
5651f17e96 | ||
|
|
9679b3722a | ||
|
|
6cb736a10d | ||
|
|
ac5c3b421d | ||
|
|
f01fad5fa6 | ||
|
|
110b727cbc | ||
|
|
1dba2debc5 | ||
|
|
8fec73341f | ||
|
|
33c76de397 | ||
|
|
d409eb1126 | ||
|
|
69d53591c8 | ||
|
|
4cf783f07f | ||
|
|
a971c121cc | ||
|
|
b4abfb6aa4 | ||
|
|
8f760081a5 | ||
|
|
c15934f210 | ||
|
|
c7e1bb4463 | ||
|
|
4ac97fc476 | ||
|
|
a5dda01ffd | ||
|
|
9db4937e54 | ||
|
|
3dc50a384e | ||
|
|
ccc48620b8 | ||
|
|
943c3960e1 | ||
|
|
9a84a67555 | ||
|
|
2241e3c7d3 | ||
|
|
03042dae96 | ||
|
|
3df9d067d6 | ||
|
|
c5f3e8b3c2 | ||
|
|
3a3e8c0e10 | ||
|
|
f010bf7eed | ||
|
|
b22d6a77b0 | ||
|
|
f91d9125e4 | ||
|
|
625eedef1e | ||
|
|
61dd33187a | ||
|
|
817640c7d0 | ||
|
|
aa15d5a6df | ||
|
|
60857007bd | ||
|
|
cfd0c5d846 | ||
|
|
71ec88d235 | ||
|
|
902ea583bd | ||
|
|
fb6b54fba0 | ||
|
|
9dfc56987c | ||
|
|
b982a02717 | ||
|
|
15a0d8ee16 | ||
|
|
9ca03132db | ||
|
|
f908ba3ea3 | ||
|
|
79ea09bd91 | ||
|
|
c743a4f1fe | ||
|
|
ccd1fc5c10 | ||
|
|
2f82a64dbe | ||
|
|
71c6eae9c4 | ||
|
|
28894a08cc | ||
|
|
41e366dcc4 | ||
|
|
6ee11a6b2d | ||
|
|
ab82c66f83 | ||
|
|
f94820f45e | ||
|
|
fe03e1ca68 | ||
|
|
44ee6951c9 | ||
|
|
40194f7204 | ||
|
|
40eefef9a2 | ||
|
|
d8ab44ebb5 | ||
|
|
f875539f2e | ||
|
|
d9c2d142cb | ||
|
|
51d5715f04 | ||
|
|
8ad81b1d50 | ||
|
|
6d4083d8a7 | ||
|
|
bb120afea2 | ||
|
|
cebcc20c26 | ||
|
|
0522e787cd | ||
|
|
81e01f1485 | ||
|
|
9b2b93d56f | ||
|
|
133b402e2b | ||
|
|
9a91eab13f | ||
|
|
5f6722b917 | ||
|
|
fdcd4d46ac | ||
|
|
27a72170b8 | ||
|
|
b3021e60ec | ||
|
|
6d8834bd87 | ||
|
|
ab8a9d95d8 | ||
|
|
563ee3f5df | ||
|
|
c3389a7fcf | ||
|
|
e824bbb533 | ||
|
|
7de0e351f3 | ||
|
|
2df5f55390 | ||
|
|
21038cc5ac | ||
|
|
d6749bcd41 | ||
|
|
005c9ccdef | ||
|
|
d47cb53e59 | ||
|
|
adfb3ca4f0 | ||
|
|
88b7e4edda | ||
|
|
e33b57f0fd | ||
|
|
777825b73f | ||
|
|
04ca9b6f9a | ||
|
|
7f3d3eeb9c | ||
|
|
75ac16d43c | ||
|
|
5f1120c718 | ||
|
|
806a0694c6 | ||
|
|
c506ae3242 | ||
|
|
444fa529fb | ||
|
|
62ced3eb04 | ||
|
|
31718f1c4d | ||
|
|
98ab8971b4 | ||
|
|
870c86f9af | ||
|
|
a4f6aabee9 | ||
|
|
5584ad0a10 | ||
|
|
6b4932b4c5 | ||
|
|
7f1cb0aaf3 | ||
|
|
d42a5a48e9 | ||
|
|
8a1b762c35 | ||
|
|
d2d1de41d2 | ||
|
|
d1366af2a0 | ||
|
|
cae4b15bbb | ||
|
|
e41bc64b0c | ||
|
|
3d03ebe487 | ||
|
|
1fcb431d1b | ||
|
|
4f321490af | ||
|
|
04c7469e68 | ||
|
|
98bc0a9309 | ||
|
|
6e537f4cdf | ||
|
|
b121d61852 | ||
|
|
6ba3c3ffbd | ||
|
|
67b3efad4c | ||
|
|
1282e468e3 | ||
|
|
67b2e78a63 | ||
|
|
213c56f945 | ||
|
|
ccde6e4f4b | ||
|
|
2c1c94d24c | ||
|
|
56edb51f36 | ||
|
|
b6ed2c7dd8 | ||
|
|
74c7c5c423 | ||
|
|
314d774bde | ||
|
|
d94091ae4e | ||
|
|
8bf3c4fcd7 | ||
|
|
4358c15432 | ||
|
|
fdf8d649fe | ||
|
|
a4e22ec4b1 | ||
|
|
783bc43547 | ||
|
|
2e6aec175a | ||
|
|
ee41aaa112 | ||
|
|
32e8a8b1b9 | ||
|
|
6b3def230b | ||
|
|
51c46db106 | ||
|
|
64c18179ac | ||
|
|
5ee0b39e07 | ||
|
|
6470319fd6 | ||
|
|
4ca3f3c8ee | ||
|
|
07e2d2d509 | ||
|
|
07d2a143a2 | ||
|
|
968845492f | ||
|
|
c2106b64f9 | ||
|
|
0d73d1d258 | ||
|
|
423d425950 | ||
|
|
7ab0093fec | ||
|
|
56d2757448 | ||
|
|
f5b6037367 | ||
|
|
2c4ce6c8d1 | ||
|
|
f9ccd3628a | ||
|
|
abef2b394e | ||
|
|
97ff6f1de9 | ||
|
|
7fad4435cb | ||
|
|
92a97209ca | ||
|
|
e7c3f083b4 | ||
|
|
7b5961f941 | ||
|
|
85d4b411b5 | ||
|
|
c9ec32aca7 | ||
|
|
13a3013a8e | ||
|
|
0dd3bac855 | ||
|
|
d7a716a5cb | ||
|
|
0bbc9cbe81 | ||
|
|
df766d8d1f | ||
|
|
20a150a228 | ||
|
|
010292a440 | ||
|
|
394dae18e9 | ||
|
|
f1676c52f0 | ||
|
|
05f6f3c79b | ||
|
|
9942b488ea | ||
|
|
5d83f4bf2d | ||
|
|
d9afd914ff | ||
|
|
990d8160f8 | ||
|
|
80c321b66f | ||
|
|
67b45f3e5c | ||
|
|
ca3cee5673 | ||
|
|
ae0d170244 | ||
|
|
9a31cfa938 | ||
|
|
cdbc9c305e | ||
|
|
cdbce13c49 | ||
|
|
0a41ebbcda | ||
|
|
476fe1602b | ||
|
|
2f482e9afc | ||
|
|
d59e6e0691 | ||
|
|
7ec6866f26 | ||
|
|
3686e7facf | ||
|
|
1aba1894ea | ||
|
|
14503c9b8f | ||
|
|
a315668d31 | ||
|
|
db9ea63210 | ||
|
|
51ecbd5b53 | ||
|
|
45ef0d9809 | ||
|
|
356702b50d | ||
|
|
e72ce5376c | ||
|
|
0d35f3fbd2 | ||
|
|
28c22c1eae | ||
|
|
7cf83f65c3 | ||
|
|
4c4f2e720d | ||
|
|
0fa562e6fd | ||
|
|
bcd0f778cf | ||
|
|
401ab9f706 | ||
|
|
8b09a81d5a | ||
|
|
86718cc406 | ||
|
|
ccb72364e1 | ||
|
|
bfd6a59d87 | ||
|
|
af4caa455a | ||
|
|
d511e4a75c | ||
|
|
8fd906223c | ||
|
|
deadb56aaa | ||
|
|
1ff867879c | ||
|
|
f3630dd868 | ||
|
|
39143525c3 | ||
|
|
e8dd1f8f8b | ||
|
|
28e5d2e3f2 | ||
|
|
21def91427 | ||
|
|
bc5d04c662 | ||
|
|
c736227448 | ||
|
|
168285cb64 | ||
|
|
3411f50d29 | ||
|
|
319c14b0e0 | ||
|
|
64c077396f | ||
|
|
65f0d448a1 | ||
|
|
2fdaa464dd | ||
|
|
f86a6a10ac | ||
|
|
08a2438e79 | ||
|
|
60cc47f7ca | ||
|
|
7e4f606492 | ||
|
|
8ff58534d9 | ||
|
|
a4bb184e95 | ||
|
|
940c1f5692 | ||
|
|
0430733b58 | ||
|
|
33136816af | ||
|
|
469a235799 | ||
|
|
2d71c827b3 | ||
|
|
17f9e72a9f | ||
|
|
120aeed56f | ||
|
|
8128c3b2d7 | ||
|
|
4581a33cae | ||
|
|
d43e2af3ae | ||
|
|
0283eb4d85 | ||
|
|
f483ae42a8 | ||
|
|
f974eba465 | ||
|
|
7d7969fe0f | ||
|
|
2a3d7e8362 | ||
|
|
a38c03c4e0 | ||
|
|
342a0c612a | ||
|
|
f1f9970407 | ||
|
|
c83a3e6315 | ||
|
|
fbc65e7e2a | ||
|
|
d9e9407cab | ||
|
|
d0881b76e0 | ||
|
|
61c867b49c | ||
|
|
87de30d257 | ||
|
|
817605417c | ||
|
|
65b018db2a | ||
|
|
addb52e3fa | ||
|
|
c3124ec7c3 | ||
|
|
b1caa6dfdc | ||
|
|
26f28d55d9 | ||
|
|
cb66688529 | ||
|
|
40c61f11be | ||
|
|
9b45c75a5b | ||
|
|
09425c1910 | ||
|
|
591798e98c | ||
|
|
acdd82a680 | ||
|
|
5719ac3209 | ||
|
|
2ac687b0c2 | ||
|
|
a86a249f05 | ||
|
|
e49a7b0bb4 | ||
|
|
e904a7949c | ||
|
|
080d8110df | ||
|
|
d90826e851 | ||
|
|
e495da692b | ||
|
|
52970ef93e | ||
|
|
8f641d117a | ||
|
|
d164ebc7da | ||
|
|
632cc5810d | ||
|
|
e565a6c77f | ||
|
|
c1fe700d7a | ||
|
|
06ee267804 | ||
|
|
aad722c723 | ||
|
|
aefc58b636 | ||
|
|
fdd96507b8 | ||
|
|
2ad87a5ec5 | ||
|
|
b94cdba5af | ||
|
|
725261335c | ||
|
|
5fb0051fc6 | ||
|
|
1247847739 | ||
|
|
18cb4e74d6 | ||
|
|
e07cb7fca9 | ||
|
|
dc54ed46f8 | ||
|
|
0415d86d71 | ||
|
|
b8b95be5ce | ||
|
|
46820f0986 | ||
|
|
dcc022ac7f | ||
|
|
9142f0d633 | ||
|
|
181c72befe | ||
|
|
99f3459978 | ||
|
|
75fbc9679c | ||
|
|
700b7774b1 | ||
|
|
d9f0a9b1ca | ||
|
|
70644ff26d | ||
|
|
bbefcc3bc8 | ||
|
|
09767dbae3 | ||
|
|
57eafa95ba | ||
|
|
f4f28a411e | ||
|
|
f6059ef5c7 | ||
|
|
e3fa4efa95 | ||
|
|
6884a91eb8 | ||
|
|
71ba018a42 | ||
|
|
10f5232ac3 | ||
|
|
78d707484d | ||
|
|
69db66fbbb | ||
|
|
99691cd7ee | ||
|
|
47cef359ca | ||
|
|
046105498f | ||
|
|
4d3ef5dd2a | ||
|
|
8bcd5623bf | ||
|
|
a29b4a3a8e | ||
|
|
dee0fb396b | ||
|
|
b5c707e07f | ||
|
|
8fe35bd1d7 | ||
|
|
6c864c35cd | ||
|
|
f00acf6af1 | ||
|
|
49e1599bc4 | ||
|
|
7311d4b724 | ||
|
|
fa44e348a2 | ||
|
|
8cba02741c | ||
|
|
48d04d5e72 | ||
|
|
7cac25c0e2 | ||
|
|
88b0fa0163 | ||
|
|
3fcef24cc9 | ||
|
|
d9fba6ce6b | ||
|
|
8bc2f0c40e | ||
|
|
21254695d5 | ||
|
|
f063f0a6f4 | ||
|
|
2d847cbcdb | ||
|
|
547e99f526 | ||
|
|
a9794cd2ee | ||
|
|
c651abd8ae | ||
|
|
15781475b6 | ||
|
|
26a28175fd | ||
|
|
aa3680934b | ||
|
|
0b36586ddf | ||
|
|
7b58acac0d | ||
|
|
27bf4eadf9 | ||
|
|
c8d4353888 | ||
|
|
4876ca2643 | ||
|
|
e06a382c94 | ||
|
|
d1a421ca15 | ||
|
|
cd3c8d89d0 | ||
|
|
1f943ccead | ||
|
|
753776fa9a | ||
|
|
9787a2446e | ||
|
|
4cb29d274b | ||
|
|
df55d63f99 | ||
|
|
236e2d48c5 | ||
|
|
30d45d834f | ||
|
|
edf30897f2 | ||
|
|
3d31ebb576 | ||
|
|
d3bac8bcc0 | ||
|
|
a360f80cdf | ||
|
|
0cc7549546 | ||
|
|
283d2743e0 | ||
|
|
b431fa11fa | ||
|
|
648e00867f | ||
|
|
552af7bb6b | ||
|
|
92980f7c79 | ||
|
|
09a563bf73 | ||
|
|
141fa12a20 | ||
|
|
6e0035d4f3 | ||
|
|
97bac4132c | ||
|
|
b23b0280cd | ||
|
|
7ac093a8d0 | ||
|
|
dfc524b957 | ||
|
|
65ba0d348b | ||
|
|
ed07031539 | ||
|
|
93f3690344 | ||
|
|
1341d1356a | ||
|
|
38dcf16c03 | ||
|
|
8696a42959 | ||
|
|
c6fc7db1e9 | ||
|
|
58540aca57 | ||
|
|
b7b75279c2 | ||
|
|
204a35d026 | ||
|
|
fb2841f198 | ||
|
|
5de055c977 | ||
|
|
084659ea3d | ||
|
|
c1a414afab | ||
|
|
a5747034d6 | ||
|
|
fda52fec97 | ||
|
|
e38ec79618 | ||
|
|
1ef125db12 | ||
|
|
b580b640bd | ||
|
|
214bddaca4 | ||
|
|
065d489869 | ||
|
|
46ffefbbb9 | ||
|
|
a19db3bca9 | ||
|
|
2c8d8d9989 | ||
|
|
d52943e31e | ||
|
|
3eababb742 | ||
|
|
8a954d3c20 | ||
|
|
8516901032 | ||
|
|
3f2d246fec | ||
|
|
58fdaa26ca | ||
|
|
7dc1a8790d | ||
|
|
70c9ec1d73 | ||
|
|
2bcbbc96ad | ||
|
|
527d36a159 | ||
|
|
2ce21247ee | ||
|
|
8ea6c406e0 | ||
|
|
e22f50ecd3 | ||
|
|
20dcd98fdf | ||
|
|
bc5708857a | ||
|
|
b9c045ebfb | ||
|
|
c69bd7018e | ||
|
|
078d149175 | ||
|
|
be9f0bd061 | ||
|
|
a4723563f5 | ||
|
|
1fdcd24f28 | ||
|
|
a43480db92 | ||
|
|
e85a072f1c | ||
|
|
bbfa2a4eab | ||
|
|
2f2db4ded8 | ||
|
|
7296a0d2cd | ||
|
|
08e02b6ac0 | ||
|
|
715811d7fd | ||
|
|
c7d6ae6995 | ||
|
|
b1d1396944 | ||
|
|
25a319710e | ||
|
|
796b13dd62 | ||
|
|
8197863ac5 | ||
|
|
89bd164d43 | ||
|
|
80d7061e5f | ||
|
|
c49bac3a09 | ||
|
|
06d53fe801 | ||
|
|
15ba529938 | ||
|
|
83054d0cd1 | ||
|
|
8da486adf2 | ||
|
|
32bc3847fa | ||
|
|
5d763c18c8 | ||
|
|
bd3920cfff | ||
|
|
06d94332b6 | ||
|
|
50614484d8 | ||
|
|
c29d3d8c92 | ||
|
|
26f46af375 | ||
|
|
32b1491dd0 | ||
|
|
51b8a6c80a | ||
|
|
0f63d6d3a0 | ||
|
|
4771b08773 | ||
|
|
9b880101fd | ||
|
|
594806d6e8 | ||
|
|
e9afd4db2f | ||
|
|
b23efe4089 | ||
|
|
e33be41a93 | ||
|
|
33b09df872 | ||
|
|
e9050d0aa0 | ||
|
|
baeb2a33fe | ||
|
|
4ad89acdc7 | ||
|
|
7d87af8f5c | ||
|
|
65c0e84e2a | ||
|
|
7b15d85871 | ||
|
|
ad8ec0f4fd | ||
|
|
2d05d83dd0 | ||
|
|
bd45066b13 | ||
|
|
8ee4274054 | ||
|
|
83a7ed4d6b | ||
|
|
07dbd86ac6 | ||
|
|
0e671d2cc0 | ||
|
|
2d6d3c04ce | ||
|
|
b0148963c7 | ||
|
|
13356950f3 | ||
|
|
629bcb30a7 | ||
|
|
03721fff1c | ||
|
|
2a6911ae3d | ||
|
|
164eddecab | ||
|
|
9eacb38eb9 | ||
|
|
20f5cfb9a7 | ||
|
|
6c6c1cc90a | ||
|
|
a32c099cc1 | ||
|
|
fe2f832e83 | ||
|
|
868746cc23 | ||
|
|
3be7a54284 | ||
|
|
635e1ec8e2 | ||
|
|
a638a35a76 | ||
|
|
8cc33d3418 | ||
|
|
9947f7b967 | ||
|
|
daf5350f41 | ||
|
|
020b9ddb8d | ||
|
|
23aff9497a | ||
|
|
3c119396f3 | ||
|
|
f7c7c47ac0 | ||
|
|
dbe2369bbe | ||
|
|
4e8033d221 | ||
|
|
97a0f87cbd | ||
|
|
bfa2713d43 | ||
|
|
fe5e109751 | ||
|
|
8cc96030b1 | ||
|
|
a2b172ad58 | ||
|
|
e756225d8b | ||
|
|
dd803b604f | ||
|
|
b5c961c8ee | ||
|
|
47cd9d227e | ||
|
|
e2be3aafcd | ||
|
|
015fe76c44 | ||
|
|
44666aec03 | ||
|
|
6a265e4f35 | ||
|
|
12c7316524 | ||
|
|
dcf9741d69 | ||
|
|
63dd1fdd50 | ||
|
|
5aa166bbfd | ||
|
|
34cbf7093e | ||
|
|
159d58949e | ||
|
|
fcf802b7e3 | ||
|
|
92ff6dadb0 | ||
|
|
05fa2f9883 | ||
|
|
71bb8fd784 | ||
|
|
16ffd6dfab | ||
|
|
2661d15910 | ||
|
|
394102bb93 | ||
|
|
3585b12dfd | ||
|
|
423d87d5f1 | ||
|
|
13b13b1104 | ||
|
|
a77e7b96b7 | ||
|
|
d7213c255c | ||
|
|
ddeb1dcdb7 | ||
|
|
221cfa3528 | ||
|
|
d6f6348ff1 | ||
|
|
0c6afdc98e | ||
|
|
02a2148b3f | ||
|
|
36a02268d8 | ||
|
|
450f07f505 | ||
|
|
777eba9fed | ||
|
|
eaa8fa57d1 | ||
|
|
200bf479e1 | ||
|
|
331f409af9 | ||
|
|
ce875a5e63 | ||
|
|
638013f835 | ||
|
|
1de87cbfec | ||
|
|
7f3428b36a | ||
|
|
35595ded47 | ||
|
|
35e9264017 | ||
|
|
02d33c8f83 | ||
|
|
f229ebc3a8 | ||
|
|
0062351f6d | ||
|
|
e86f6798ec | ||
|
|
4f53f7136b | ||
|
|
d80b982dde | ||
|
|
24788aa9af | ||
|
|
9ffae658df | ||
|
|
82ad573cac | ||
|
|
36bf7ad65b | ||
|
|
b30af128c7 | ||
|
|
72c31ae097 | ||
|
|
d2c608021d | ||
|
|
1f36fb2413 | ||
|
|
16a0cbcecf | ||
|
|
e068e246aa | ||
|
|
ec7c77fcf9 | ||
|
|
46a338b874 | ||
|
|
bfee7ff09d | ||
|
|
ce1305d8ae | ||
|
|
aaebf88438 | ||
|
|
dde2c99e36 | ||
|
|
4dc2f3b9b9 | ||
|
|
f30cfffb86 | ||
|
|
ca3eb62ba7 | ||
|
|
c8e55ca4ce | ||
|
|
e4acb25a40 | ||
|
|
c741e10139 | ||
|
|
28d0b35f8e | ||
|
|
f7f09cd9e5 | ||
|
|
501c92c350 | ||
|
|
f021101322 | ||
|
|
369265bc2c | ||
|
|
b1f1e5db1f | ||
|
|
51d32e5afb | ||
|
|
f396e8e482 | ||
|
|
077321731e | ||
|
|
60eb0c6978 | ||
|
|
475f0af78a | ||
|
|
206fa07035 | ||
|
|
aff949714c | ||
|
|
7e834b9ff6 | ||
|
|
19bad26a98 | ||
|
|
7cc7c8d27b | ||
|
|
ae5a8c7cfa | ||
|
|
5004b73210 | ||
|
|
02f613d269 | ||
|
|
439ac0310b | ||
|
|
3e95467819 | ||
|
|
90522cb88b | ||
|
|
af39b01d4a | ||
|
|
73a0a5ff0b | ||
|
|
e157f500bc | ||
|
|
274ee5ed5f | ||
|
|
4cb11ba8c0 | ||
|
|
7b8e775139 | ||
|
|
86a7d26bfd | ||
|
|
84a437772d | ||
|
|
d7c95e2ae0 | ||
|
|
b4f0ef8b43 | ||
|
|
6d30cd7ae4 | ||
|
|
f631236ee7 | ||
|
|
1a58ff5c4c | ||
|
|
73aca913a1 | ||
|
|
24dee0cad6 | ||
|
|
2d2de75372 | ||
|
|
d98982e6fd | ||
|
|
14c12ffb08 | ||
|
|
f260afca11 | ||
|
|
5bcbe25d97 | ||
|
|
2eee366fbd | ||
|
|
85d57ec5e6 | ||
|
|
502c878f82 | ||
|
|
1136c3f767 | ||
|
|
42b496cd77 | ||
|
|
4acb5ee020 | ||
|
|
ea18781cc6 | ||
|
|
593617c0ff | ||
|
|
c6a139d88d | ||
|
|
b7357a4546 | ||
|
|
5eac959d15 | ||
|
|
74c86ecfbe | ||
|
|
f353e590e1 | ||
|
|
a4cc3e10c2 | ||
|
|
7321f56ee2 | ||
|
|
8800d9adc6 | ||
|
|
22cd535527 | ||
|
|
1d0e9592df | ||
|
|
2ef4af0ff2 | ||
|
|
542a6b1592 | ||
|
|
613ef94dba | ||
|
|
1dc2a1fadf | ||
|
|
41a606f5c1 | ||
|
|
7b2b9855f9 | ||
|
|
b2b519ba2e | ||
|
|
5cf89392ff | ||
|
|
0f05304ec3 | ||
|
|
87bc962c88 | ||
|
|
546ce6e229 | ||
|
|
2163d5aaf6 | ||
|
|
905ea160f2 | ||
|
|
675f4a372b | ||
|
|
7ff42db0c6 | ||
|
|
a01283a446 | ||
|
|
fefa261e7d | ||
|
|
0447b22dd2 | ||
|
|
cf125c1b48 | ||
|
|
81a9d8257c | ||
|
|
ee3f471300 | ||
|
|
5c2e5f626d | ||
|
|
a0f4b62361 | ||
|
|
786166b448 | ||
|
|
66e198b4ef | ||
|
|
4919240242 | ||
|
|
d7e6a41e3f | ||
|
|
202ef737dd | ||
|
|
04993224dc | ||
|
|
bebe7c28f8 | ||
|
|
639991dde4 | ||
|
|
31404cb89a | ||
|
|
f6205ca1dd | ||
|
|
6e86fc0593 | ||
|
|
f39a9845a3 | ||
|
|
ba17582945 | ||
|
|
02a1cbd467 | ||
|
|
2cd102ef0b | ||
|
|
240361b55b | ||
|
|
9beabc93cd | ||
|
|
8f4c6b911a | ||
|
|
083ef3010d | ||
|
|
e6c2253219 | ||
|
|
d802eb3f28 | ||
|
|
a342d5d5ad | ||
|
|
99adb77fcb | ||
|
|
2ea4eae9d6 | ||
|
|
9b079b2c3a | ||
|
|
8648e8569e | ||
|
|
1be0ab8bcb | ||
|
|
718f76c1f2 | ||
|
|
155d1f4c06 | ||
|
|
cb79e27d5a | ||
|
|
26991f8dd8 | ||
|
|
2375330d76 | ||
|
|
94e9b6d99b | ||
|
|
b516d24101 | ||
|
|
1b131d9371 | ||
|
|
3f45ef192d | ||
|
|
c6684af521 | ||
|
|
52f12b81ff | ||
|
|
6630f787bf | ||
|
|
2d7b2da3e2 | ||
|
|
d3b008fcd9 | ||
|
|
8a62fd0e6a | ||
|
|
b044860f05 | ||
|
|
1c5786dfb6 | ||
|
|
6bc9e3d695 | ||
|
|
b74fe59f12 | ||
|
|
6b57aa7f14 | ||
|
|
227125b35c | ||
|
|
c4012d8dfc | ||
|
|
cf3fa9ffbc | ||
|
|
40640d029a | ||
|
|
01eb7038dc | ||
|
|
58115bfd11 | ||
|
|
f1ea5031fb | ||
|
|
26d15a9fb3 | ||
|
|
54ba8e6047 | ||
|
|
eca063ab75 | ||
|
|
8892f4144e | ||
|
|
d2c25f9d6c | ||
|
|
b57457dc2f | ||
|
|
2861b0cfa2 | ||
|
|
0c45dbb884 | ||
|
|
a9f9261fb7 | ||
|
|
7e5f54a4f1 | ||
|
|
1228e8759c | ||
|
|
1daf771218 | ||
|
|
880cb08c3d | ||
|
|
e2cbae3089 | ||
|
|
42dcc3318c | ||
|
|
b32a85ae7e | ||
|
|
af85edddca | ||
|
|
eccd88e3c2 | ||
|
|
e0e11629a1 | ||
|
|
968095c183 | ||
|
|
d32b5115c5 | ||
|
|
d3001ec887 | ||
|
|
fef6a52008 | ||
|
|
048e6affbc | ||
|
|
c653d49691 | ||
|
|
6f5c9bd054 | ||
|
|
9e5576244d | ||
|
|
ef91317232 | ||
|
|
10c44d050f | ||
|
|
1845ea7170 | ||
|
|
d453294622 | ||
|
|
d11f9e4971 | ||
|
|
08272dd04e | ||
|
|
42441b9b42 | ||
|
|
e4a293c046 | ||
|
|
0cc5a39d63 | ||
|
|
942ea3f125 | ||
|
|
a8a70bb71c | ||
|
|
0d7c3fb4b2 | ||
|
|
77c682454e | ||
|
|
dd3473f5d8 | ||
|
|
cceadc5e04 | ||
|
|
e48c3a3f9c | ||
|
|
14981ef077 | ||
|
|
a7858d44bd | ||
|
|
9ae5f27c04 | ||
|
|
d691129842 | ||
|
|
e26d551263 | ||
|
|
277c6a444f | ||
|
|
f344800fd6 | ||
|
|
39a6fba33f | ||
|
|
8e11657bd2 | ||
|
|
dfbeaa4edf | ||
|
|
e90dc3b7f4 | ||
|
|
dba89e611a | ||
|
|
1a3fecc89e | ||
|
|
407e6a3d06 | ||
|
|
6ee19d5359 | ||
|
|
2df424dbac | ||
|
|
9874be6bf1 | ||
|
|
a3d4199d1d | ||
|
|
247fa146a9 | ||
|
|
f2b2c02cd6 | ||
|
|
a915f27f00 | ||
|
|
e14a488934 | ||
|
|
e82a8d9bc3 | ||
|
|
4527a0d12b | ||
|
|
01be202484 | ||
|
|
d1fe99edc3 | ||
|
|
fa629591e9 | ||
|
|
4ab3edc97b | ||
|
|
f1bfc6bf55 | ||
|
|
3283843ef3 | ||
|
|
4cb14ec8cc | ||
|
|
41535a68be | ||
|
|
d62447a12a | ||
|
|
802367c914 | ||
|
|
ff9b2c6ee8 | ||
|
|
a0e25c941a | ||
|
|
091c99e784 | ||
|
|
e264bb407b | ||
|
|
16625210fc | ||
|
|
2550453ee4 | ||
|
|
d1c480f23f | ||
|
|
b4b0397589 | ||
|
|
ab6b34e84c | ||
|
|
87af9d5078 | ||
|
|
95fab7c395 | ||
|
|
90825925ff | ||
|
|
7036cf9e49 | ||
|
|
53123eb0ee | ||
|
|
3c5407dd51 | ||
|
|
1ffe81f740 | ||
|
|
6bb35d61e1 | ||
|
|
f36ccf7bdc | ||
|
|
4632e68a00 | ||
|
|
09858d0783 | ||
|
|
9d1423c41b | ||
|
|
1a4b7786dd | ||
|
|
77c0a21ad0 | ||
|
|
7cedf14121 | ||
|
|
235346f3dd | ||
|
|
34c36b7c3a | ||
|
|
3e0f788ec3 | ||
|
|
867bb8a072 | ||
|
|
31a400158a | ||
|
|
8106ff6489 | ||
|
|
de3508993c | ||
|
|
fd3e7a6f8a | ||
|
|
4cf97a6054 | ||
|
|
75036e3ec7 | ||
|
|
a157f6ce27 | ||
|
|
d27cc94dd0 | ||
|
|
05b1416d39 | ||
|
|
001d6ed968 | ||
|
|
3ed3eecb00 | ||
|
|
8638e6cdeb | ||
|
|
15c7a9c22e | ||
|
|
20566e42ec | ||
|
|
92d1cac254 | ||
|
|
72e879c424 | ||
|
|
3b2516fea2 | ||
|
|
1151f98fd3 | ||
|
|
d608fdb6f0 | ||
|
|
5a2c172f96 | ||
|
|
6e1f7bdd7b | ||
|
|
bf96227b8b | ||
|
|
e7195dd68d | ||
|
|
6a374b0c5a | ||
|
|
a0a876a282 | ||
|
|
0a538375b2 | ||
|
|
ac5d60cd58 | ||
|
|
8498480b9c | ||
|
|
4c1c7fc514 | ||
|
|
1c3a0f9c71 | ||
|
|
39b5068370 | ||
|
|
4815cc7682 | ||
|
|
7886d32933 | ||
|
|
2dab88c7a9 | ||
|
|
35b83dcb9a | ||
|
|
5194b5f6bf | ||
|
|
d7c49fe19f | ||
|
|
e3dadd2ce8 | ||
|
|
d2d08bc77c | ||
|
|
41da374d93 | ||
|
|
c2f48fc90c | ||
|
|
18f2b61545 | ||
|
|
a71c7adaf7 | ||
|
|
3c050bee3b | ||
|
|
50be1ba510 | ||
|
|
445f62ca53 | ||
|
|
4810904aa8 | ||
|
|
3a6d459ebd | ||
|
|
5c23380de9 | ||
|
|
a0285d970f | ||
|
|
0e7e0f52f1 | ||
|
|
5054a9552b | ||
|
|
a7c55530a4 | ||
|
|
0f03746c6a | ||
|
|
4a891d9c9a | ||
|
|
209e233ee2 | ||
|
|
519ec081b5 | ||
|
|
a73c7ff8b6 | ||
|
|
ea74e0514e | ||
|
|
523bbd11cc | ||
|
|
becf6ad7a4 | ||
|
|
364f58b186 | ||
|
|
ef36b78399 | ||
|
|
1c77e6dc2c | ||
|
|
d581ce054c | ||
|
|
2956ec073f | ||
|
|
3ace876b66 | ||
|
|
d8722a8274 | ||
|
|
d5216a8e8c | ||
|
|
152521e9e5 | ||
|
|
a2d8518f14 | ||
|
|
e88a384c5e | ||
|
|
063663d5b0 | ||
|
|
0a48263013 | ||
|
|
2877bc8239 | ||
|
|
d5886fe3f2 | ||
|
|
c0bacb104f | ||
|
|
27b851dca1 | ||
|
|
bd358b38f7 | ||
|
|
f6c895fe78 | ||
|
|
23c8f175bb | ||
|
|
2949871ba1 | ||
|
|
34298fcfa1 | ||
|
|
83c6973d8e | ||
|
|
3b932fd52d | ||
|
|
e0291b8e5a | ||
|
|
8fe3736411 | ||
|
|
70e46c2b69 | ||
|
|
c5a7d823c8 | ||
|
|
56115d34a4 | ||
|
|
af3b91037e | ||
|
|
549161586e | ||
|
|
20ac60219f | ||
|
|
ef8b17f5c1 | ||
|
|
2c5339aa92 | ||
|
|
720fa70d60 | ||
|
|
b2eef1279f | ||
|
|
da5e5aedb2 | ||
|
|
51c505f9a6 | ||
|
|
4f97a61e94 | ||
|
|
7af0f28bd7 | ||
|
|
a9f4e95b77 | ||
|
|
3d3420b1aa | ||
|
|
26915ea94f | ||
|
|
dfa1d1c76e | ||
|
|
87c1870770 | ||
|
|
626c27b635 | ||
|
|
7572d1a6ff | ||
|
|
b707439de7 | ||
|
|
2e332707ff | ||
|
|
2f60efe273 | ||
|
|
632f8477fd | ||
|
|
53432520cd | ||
|
|
078893f7d1 | ||
|
|
131cb0ff79 | ||
|
|
c49117ffd5 | ||
|
|
cb52aa264d | ||
|
|
1c1a02757f | ||
|
|
4558c4a29c | ||
|
|
21832a1885 | ||
|
|
9b45cc087f | ||
|
|
b131e6ee8c | ||
|
|
306a297837 | ||
|
|
380eda64a0 | ||
|
|
2dd8e3016f | ||
|
|
fd9c61a1c7 | ||
|
|
4a2dba6e2e | ||
|
|
034d94ee22 | ||
|
|
65139094cb | ||
|
|
b607cf22a7 | ||
|
|
b79f8d05be | ||
|
|
520d157a0f | ||
|
|
f73be7e38f | ||
|
|
44834d1d27 | ||
|
|
d07422060a | ||
|
|
0ee9437cf8 | ||
|
|
6fe646a32b | ||
|
|
8e1f643612 | ||
|
|
7f2ba4d727 | ||
|
|
b8706eae10 | ||
|
|
34600ab0cf | ||
|
|
b3031b79d1 | ||
|
|
cc679ddcfa | ||
|
|
3633d469c1 | ||
|
|
46fa721a6c | ||
|
|
7e4116b1a2 | ||
|
|
2a043dbd53 | ||
|
|
4aa23cf755 | ||
|
|
4f261116de | ||
|
|
7ecd5481a0 | ||
|
|
1cea1b7bcf | ||
|
|
ccba688ec4 | ||
|
|
4eabe72078 | ||
|
|
fbbe97d297 | ||
|
|
26a80d1313 | ||
|
|
24b5edba9f | ||
|
|
9113e0e372 | ||
|
|
9f944dd171 | ||
|
|
b91f76914c | ||
|
|
8593d90209 | ||
|
|
df441b7236 | ||
|
|
43e2798a9b | ||
|
|
7ee14a48a7 | ||
|
|
1e5cf0ca5b | ||
|
|
12bac6d305 | ||
|
|
1518cd50ec | ||
|
|
9dfc82c106 | ||
|
|
087f10f7bb | ||
|
|
6971eac21f | ||
|
|
da7cde91b3 | ||
|
|
814b4fe0ae | ||
|
|
a2abc4fda9 | ||
|
|
9bcba9895e | ||
|
|
ff13ea71a6 | ||
|
|
7993dcb0b1 | ||
|
|
9a527fef20 | ||
|
|
e6de25c0a4 | ||
|
|
c45adc1a8a | ||
|
|
c06f86edbb | ||
|
|
ed515fa3fc | ||
|
|
c284983b4b | ||
|
|
5fed099034 | ||
|
|
c8dd335d65 | ||
|
|
17d2c6aa57 | ||
|
|
7183144d7b | ||
|
|
e87a2e9c8c | ||
|
|
b8da78f2fa | ||
|
|
528402437b |
27
.env.example
27
.env.example
@@ -1,20 +1,15 @@
|
||||
# Use the Prisma Postgres integration from Vercel Marketeplace to automatically connect a Prisma Postgres instance
|
||||
# Or manually run `npx prisma init --db` to create a Prisma Postgres and manually set the `DATABASE_URL` below
|
||||
# You already have access to basic local functionality (UI, authentication, database read access).
|
||||
|
||||
# Create a random 32-character string or run `npx auth secret` to obtain one and set it as the `AUTH_SECRET` below
|
||||
# openssl enc -aes-256-cbc -salt -pbkdf2 -iter 100000 -in backend/shared/src/googleApplicationCredentials-dev.json -out secrets/googleApplicationCredentials-dev.json.enc
|
||||
GOOGLE_CREDENTIALS_ENC_PWD=nP7s3274uzOG4c2t
|
||||
|
||||
GOOGLE_CLIENT_ID=
|
||||
GOOGLE_CLIENT_SECRET=
|
||||
NEXTAUTH_SECRET=
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
|
||||
# Email configuration
|
||||
EMAIL_SERVER_HOST=smtp.resend.dev
|
||||
EMAIL_SERVER_PORT=587
|
||||
EMAIL_SERVER_USER=BayesBond
|
||||
EMAIL_SERVER_PASSWORD=
|
||||
RESEND_API_KEY=
|
||||
EMAIL_FROM=
|
||||
# Optional variables for full local functionality
|
||||
|
||||
# Development (SQLite)
|
||||
DATABASE_URL=file:./dev.db
|
||||
# For the location / distance filtering features.
|
||||
# Create a free account at https://rapidapi.com/wirefreethought/api/geodb-cities and get an API key.
|
||||
GEODB_API_KEY=
|
||||
|
||||
# For sending emails (e.g. for user sign up, password reset, notifications, etc.).
|
||||
# Create a free account at https://resend.com and get an API key. Should start with "re_".
|
||||
RESEND_KEY=
|
||||
|
||||
15
.github/FUNDING.yml
vendored
Normal file
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [CompassConnections] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: CompassMeet # Replace with a single Patreon username
|
||||
open_collective: compass-connection # Replace with a single Open Collective username
|
||||
ko_fi: compassconnections # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: CompassConnections # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
thanks_dev: # Replace with a single thanks.dev username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
31
.github/workflows/build.yaml
vendored
31
.github/workflows/build.yaml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Check Next.js
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22' # or match the version in .nvmrc or package.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build the app
|
||||
env:
|
||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||
run: npm run build
|
||||
32
.github/workflows/cd.yml
vendored
Normal file
32
.github/workflows/cd.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: CD
|
||||
|
||||
# Must select "Read and write permissions" in GitHub → Repo → Settings → Actions → General → Workflow permissions
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 0 # To fetch all history for tags
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Tag and release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||
./scripts/release.sh
|
||||
60
.github/workflows/ci.yml
vendored
Normal file
60
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: All
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install
|
||||
|
||||
- name: Type check
|
||||
run: echo skipping #npx tsc --noEmit
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Run Jest tests
|
||||
run: npm run test tests/jest
|
||||
|
||||
# - name: Build app
|
||||
# env:
|
||||
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||
# run: npm run build
|
||||
|
||||
# Optional: Playwright E2E tests
|
||||
- name: Install Playwright deps
|
||||
run: npx playwright install --with-deps
|
||||
# npm install @playwright/test
|
||||
# npx playwright install
|
||||
|
||||
- name: Run E2E tests
|
||||
env:
|
||||
NEXT_PUBLIC_API_URL: localhost:8088
|
||||
NEXT_PUBLIC_FIREBASE_ENV: DEV
|
||||
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
|
||||
NEXT_PUBLIC_SUPABASE_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_KEY }}
|
||||
run: |
|
||||
yarn --cwd=web serve &
|
||||
npx wait-on http://localhost:3000
|
||||
npx playwright test tests/e2e
|
||||
SERVER_PID=$(fuser -k 3000/tcp)
|
||||
echo $SERVER_PID
|
||||
kill $SERVER_PID
|
||||
50
.gitignore
vendored
50
.gitignore
vendored
@@ -13,6 +13,9 @@
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# Playwright
|
||||
/tests/reports/playwright-report
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
@@ -33,6 +36,9 @@ yarn-error.log*
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env
|
||||
.env.local
|
||||
.env.*
|
||||
.envrc
|
||||
supabase/*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
@@ -41,9 +47,51 @@ yarn-error.log*
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
.idea/
|
||||
node_modules
|
||||
yarn-error.log
|
||||
dev
|
||||
firebase-debug.log
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
*.db
|
||||
|
||||
*prisma/migrations
|
||||
martin
|
||||
email-preview
|
||||
.obsidian
|
||||
.idea
|
||||
.idea
|
||||
*.last-run.json
|
||||
|
||||
*lock.hcl
|
||||
/web/pages/test.tsx
|
||||
|
||||
*.png
|
||||
*.jpg
|
||||
*.jpeg
|
||||
*.gif
|
||||
*.svg
|
||||
*.ico
|
||||
*.mp4
|
||||
*.mov
|
||||
*.webp
|
||||
*.avi
|
||||
*.wmv
|
||||
*.mp3
|
||||
*.wav
|
||||
*.flac
|
||||
*.aac
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
/favicon_color.ico
|
||||
/backend/shared/src/googleApplicationCredentials-dev.json
|
||||
*.tfstate
|
||||
*.tfstate.backup
|
||||
*.terraform
|
||||
/backups/firebase/auth/data/
|
||||
/backups/firebase/storage/data/
|
||||
|
||||
android/app/release*
|
||||
icons/
|
||||
*.bak
|
||||
|
||||
24
.prettierrc
Normal file
24
.prettierrc
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"trailingComma": "es5",
|
||||
"singleQuote": true,
|
||||
"plugins": ["prettier-plugin-sql"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.sql",
|
||||
"options": {
|
||||
"language": "postgresql",
|
||||
"keywordCase": "lower",
|
||||
"logicalOperatorNewline": "before"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "*.svg",
|
||||
"options": {
|
||||
"parser": "html"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,13 +13,13 @@ We welcome pull requests, but only if they meet the project's quality and design
|
||||
1. **Fork the repository** using the GitHub UI.
|
||||
2. **Clone your fork** locally:
|
||||
```bash
|
||||
git clone https://github.com/your-username/BayesBond.git
|
||||
git clone https://github.com/your-username/Compass.git
|
||||
cd your-fork
|
||||
|
||||
3. **Add the upstream remote**:
|
||||
|
||||
```bash
|
||||
git remote add upstream https://github.com/BayesBond/BayesBond.git
|
||||
git remote add upstream https://github.com/CompassConnections/Compass.git
|
||||
```
|
||||
|
||||
## Create a New Branch
|
||||
|
||||
674
LICENSE
674
LICENSE
@@ -1,21 +1,661 @@
|
||||
MIT License
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (c) 2025 BayesBond
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
21
LICENSE-MIT
Normal file
21
LICENSE-MIT
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 polylove, LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
6
NOTICE
Normal file
6
NOTICE
Normal file
@@ -0,0 +1,6 @@
|
||||
Modifications License (AGPL-3.0)
|
||||
|
||||
Portions of this software have been modified by Compass (c) 2025.
|
||||
These modifications are licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
|
||||
|
||||
The original software remains MIT-licensed (c) 2025 polylove, LLC.
|
||||
194
README.md
194
README.md
@@ -1,91 +1,191 @@
|
||||
# BayesBond
|
||||
|
||||
This repository provides the source code for [BayesBond](https://bayesbond.vercel.app), a web application where rational thinkers can bond and form deep 1-1
|
||||
relationships in a fully transparent and efficient way. It just got released—please share it with anyone who would benefit from it!
|
||||
[](https://github.com/CompassConnections/Compass/actions/workflows/ci.yml)
|
||||
[](https://github.com/CompassConnections/Compass/actions/workflows/cd.yml)
|
||||

|
||||
|
||||
To contribute, please submit a pull request or issue, or fill out this [form](https://forms.gle/tKnXUMAbEreMK6FC6) for suggestions and collaborations.
|
||||
# Compass
|
||||
|
||||
This repository contains the source code for [Compass](https://compassmeet.com) — an open platform for forming deep, authentic 1-on-1 connections with clarity and efficiency.
|
||||
|
||||
## Features
|
||||
|
||||
- Extremely detailed profiles for deep connections
|
||||
- Radically transparent: user base fully searchable
|
||||
- Free, ad-free, not for profit
|
||||
- Supported by donation
|
||||
- Free, ad-free, not for profit (supported by donations)
|
||||
- Created, hosted, maintained, and moderated by volunteers
|
||||
- Open source
|
||||
- Democratically governed
|
||||
|
||||
The full description is available [here](https://martinbraquet.com/meeting-rational).
|
||||
You can find a lot of interesting info in the [About page](https://www.compassmeet.com/about) and the [FAQ](https://www.compassmeet.com/faq) as well.
|
||||
A detailed description of the early vision is also available in this [blog post](https://martinbraquet.com/meeting-rational) (you can disregard the parts about rationality, as Compass shifted to a more general audience).
|
||||
|
||||
**We can’t do this alone.** Whatever your skills—coding, design, writing, moderation, marketing, or even small donations—you can make a real difference. [Contribute](https://www.compassmeet.com/support) in any way you can and help our community thrive!
|
||||
|
||||

|
||||
|
||||
## To Do
|
||||
|
||||
No contribution is too small—whether it’s changing a color, resizing a button, tweaking a font, or improving wording. Bigger contributions like adding new profile fields, building modules, or improving onboarding are equally welcome. The goal is to make the platform better step by step, and every improvement counts. If you see something that could be clearer, smoother, or more engaging, **please jump in**!
|
||||
|
||||
The complete, official list of tasks is available [here on ClickUp](https://sharing.clickup.com/90181043445/l/h/6-901810339879-1/bbfd32f4f4bf64b). If you are working on one task, just assign it to yourself and move its status to "in progress". If there is also a GitHub issue for that task, assign it to yourself as well.
|
||||
|
||||
To have edit access to the ClickUp workspace, you need an admin to manually give you permission (one time thing). To do so, use your preferred option:
|
||||
- Ask or DM an admin on [Discord](https://discord.gg/8Vd7jzqjun)
|
||||
- Email hello@compassmeet.com
|
||||
- Raise an issue on GitHub
|
||||
|
||||
If you want to add tasks without creating an account, you can simply email
|
||||
```
|
||||
a.t.901810339879.u-276866260.b847aba1-2709-4f17-b4dc-565a6967c234@tasks.clickup.com
|
||||
```
|
||||
Put the task title in the email subject and the task description in the email content.
|
||||
|
||||
Here is a tailored selection of things that would be very useful. If you want to help but don’t know where to start, just ask us on [Discord](https://discord.gg/8Vd7jzqjun).
|
||||
|
||||
- [x] Authentication (user/password and Google Sign In)
|
||||
- [x] Set up PostgreSQL in Production with supabase or prisma console (can stick with SQLite in dev / local)
|
||||
- [x] Set up hosting (vercel)
|
||||
- [x] Ask for detailed info per profile upon registration (intellectual interests, location, cause areas, personality type, conflict style, desired type of connection, prompt answers, gender, etc.)
|
||||
- [x] Set up PostgreSQL in Production with supabase
|
||||
- [x] Set up web hosting (vercel)
|
||||
- [x] Set up backend hosting (google cloud)
|
||||
- [x] Ask for detailed info upon registration (location, desired type of connection, prompt answers, gender, etc.)
|
||||
- [x] Set up page listing all the profiles
|
||||
- [x] Search through all the profile variables
|
||||
- [ ] (Set up chat / direct messaging)
|
||||
- [ ] Set up domain name (https://bayesbond.com)
|
||||
- [x] Search through most profile variables
|
||||
- [x] Set up chat / direct messaging
|
||||
- [x] Set up domain name (compassmeet.com)
|
||||
- [ ] Add mobile app (React Native on Android and iOS)
|
||||
- [ ] Add better onboarding (tooltips, modals, etc.)
|
||||
- [ ] Add modules to learn more about each other (personality test, conflict style, love languages, etc.)
|
||||
- [ ] Add modules to improve interpersonal skills (active listening, nonviolent communication, etc.)
|
||||
- [ ] Add calendar integration and scheduling
|
||||
- [ ] Add events (group calls, in-person meetups, etc.)
|
||||
|
||||
#### Secondary To Do
|
||||
|
||||
Any action item is open to anyone for collaboration, but the following ones are particularly easy to do for first-time contributors.
|
||||
Everything is open to anyone for collaboration, but the following ones are particularly easy to do for first-time contributors.
|
||||
|
||||
- [ ] Clean up terms and conditions
|
||||
- [ ] Clean up privacy notice
|
||||
- [ ] Clean up learn more page
|
||||
- [x] Clean up learn more page
|
||||
- [x] Add dark theme
|
||||
- [ ] Cover with tests
|
||||
- [ ] Add profile fields (intellectual interests, cause areas, personality type, conflict style, timezone, etc.)
|
||||
- [ ] Add filters to search through remaining profile fields (politics, religion, education level, etc.)
|
||||
- [ ] Cover with tests (crucial, just the test template and framework are ready)
|
||||
- [ ] Make the app more user-friendly and appealing (UI/UX)
|
||||
- [ ] Clean up terms and conditions (convert to Markdown)
|
||||
- [ ] Clean up privacy notice (convert to Markdown)
|
||||
- [ ] Add other authentication methods (GitHub, Facebook, Apple, phone, etc.)
|
||||
- [x] Add email verification
|
||||
- [x] Add password reset
|
||||
- [x] Add automated welcome email
|
||||
- [ ] Security audit and penetration testing
|
||||
- [ ] Make `deploy-api.sh` run automatically on push to `main` branch
|
||||
- [x] Create settings page (change email, password, delete account, etc.)
|
||||
- [ ] Improve [financials](web/public/md/financials.md) page (donor / acknowledgments, etc.)
|
||||
- [x] Improve loading sign (e.g., animation of a compass moving around)
|
||||
- [ ] Show compatibility score in profile page
|
||||
|
||||
## Implementation
|
||||
|
||||
The web app is coded in Typescript using React as front-end and Prisma as back-end. It includes:
|
||||
The web app is coded in Typescript using React as front-end. It includes:
|
||||
|
||||
- [NextAuth.js v4](https://next-auth.js.org/)
|
||||
- [Prisma Postgres](https://www.prisma.io/postgres)
|
||||
- [Prisma ORM](https://www.prisma.io/orm)
|
||||
- Vercel
|
||||
- [Supabase](https://supabase.com/) for the PostgreSQL database
|
||||
- [Google Cloud](https://console.cloud.google.com) for hosting the backend API
|
||||
- [Firebase](https://firebase.google.com/) for authentication and media storage
|
||||
- [Vercel](https://vercel.com/) for hosting the front-end
|
||||
|
||||
## Development
|
||||
|
||||
After cloning the repo and navigating into it, install dependencies:
|
||||
Below are the steps to contribute. If you have any trouble or questions, please don't hesitate to open an issue or contact us on [Discord](https://discord.gg/8Vd7jzqjun)! We're responsive and happy to help.
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
You now need to configure your database connection via an environment variable.
|
||||
|
||||
First, create an `.env` file:
|
||||
### Installation
|
||||
|
||||
Fork the [repo](https://github.com/CompassConnections/Compass) on GitHub (button in top right). Then, clone your repo and navigating into it:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
git clone https://github.com/<your-username>/Compass.git
|
||||
cd Compass
|
||||
```
|
||||
|
||||
To ensure your authentication works properly, you'll also need to set the `AUTH_SECRET` [env var for NextAuth.js]
|
||||
(https://next-auth.js.org/configuration/options). You can generate such a random 32-character string with:
|
||||
Install `opentofu`, `docker`, and `yarn`. Try running this on Linux or macOS for a faster install:
|
||||
```bash
|
||||
npx auth secret
|
||||
./setup.sh
|
||||
```
|
||||
If it doesn't work, you can install them manually (google how to install `opentofu`, `docker`, and `yarn` for your OS).
|
||||
|
||||
Then, install the dependencies for this project:
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
In the end, your entire `.env` file should look similar to this (but using _your own values_ for the env vars):
|
||||
```bash
|
||||
DATABASE_URL="file:./dev.db"
|
||||
AUTH_SECRET="gTwLSXFeNWFRpUTmxlRniOfegXYw445pd0k6JqXd7Ag="
|
||||
```
|
||||
### Environment Variables
|
||||
|
||||
Run the following commands to set up your local development database and Prisma schema:
|
||||
Almost all the features will work out of the box, so you can skip this step and come back later if you need to test the following services: email, geolocation.
|
||||
|
||||
We can't make the following information public, for security and privacy reasons:
|
||||
- Database, otherwise anyone could access all the user data (including private messages)
|
||||
- Firebase, otherwise anyone could remove users or modify the media files
|
||||
- Email, analytics, and location services, otherwise anyone could use the service plans Compass paid for and run up the bill.
|
||||
|
||||
That's why we separate all those services between production and development environments, so that you can code freely without impacting the functioning of the deployed platform.
|
||||
Contributors should use the default keys for local development. Production uses a separate environment with stricter rules and private keys that are not shared.
|
||||
|
||||
If you do need one of the few remaining services, you need to set them up and store your own secrets as environment variables. To do so, simply open `.env` and fill in the variables according to the instructions in the file.
|
||||
|
||||
### Tests
|
||||
|
||||
Make sure the tests pass:
|
||||
```bash
|
||||
npx prisma migrate dev --name init
|
||||
yarn test tests/jest/
|
||||
```
|
||||
Note that your local database will be made of synthetic data, not real users. This is fine for development and testing.
|
||||
TODO: make `yarn test` run all the tests, not just the ones in `tests/jest/`.
|
||||
|
||||
### Running the Development Server
|
||||
|
||||
Start the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Once the server is running, visit http://localhost:3000 to start using the app.
|
||||
Once the server is running, visit http://localhost:3000 to start using the app. You can sign up and visit the profiles; you should see a few synthetic profiles.
|
||||
|
||||
See [development.md](docs/development.md) for additional instructions, such as adding new profile features.
|
||||
Note: it's normal if page loading locally is much slower than the deployed version. It can take up to 10 seconds, it would be great to improve that though!
|
||||
|
||||
### Contributing
|
||||
|
||||
Now you can start contributing by making changes and submitting pull requests!
|
||||
|
||||
We recommend using a good code editor (VSCode, WebStorm, Cursor, etc.) with Typescript support and a good AI assistant (GitHub Copilot, etc.) to make your life easier. To debug, you can use the browser developer tools (F12), specifically:
|
||||
- Components tab to see the React component tree and props (you need to install the [React Developer Tools](https://react.dev/learn/react-developer-tools) extension)
|
||||
- Console tab for errors and logs
|
||||
- Network tab to see the requests and responses
|
||||
- Storage tab to see cookies and local storage
|
||||
|
||||
You can also add `console.log()` statements in the code.
|
||||
|
||||
If you are new to Typescript or the open-source space, you could start with small changes, such as tweaking some web components or improving wording in some pages. You can find those files in `web/public/md/`.
|
||||
|
||||
See [development.md](docs/development.md) for additional instructions, such as adding new profile fields.
|
||||
|
||||
### Submission
|
||||
|
||||
Add the original repo as upstream for syncing:
|
||||
```bash
|
||||
git remote add upstream https://github.com/CompassConnections/Compass.git
|
||||
```
|
||||
|
||||
Create a new branch for your changes:
|
||||
```bash
|
||||
git checkout -b <branch-name>
|
||||
```
|
||||
|
||||
Make changes, then stage and commit:
|
||||
```bash
|
||||
git add .
|
||||
git commit -m "Describe your changes"
|
||||
```
|
||||
|
||||
Push branch to your fork:
|
||||
```bash
|
||||
git push origin <branch-name>
|
||||
```
|
||||
|
||||
Finally, open a Pull Request on GitHub from your `fork/<branch-name>` → `CompassConnections/Compass` main branch.
|
||||
|
||||
## Acknowledgements
|
||||
This project is built on top of [manifold.love](https://github.com/sipec/polylove), an open-source dating platform licensed under the MIT License. We greatly appreciate their work and contributions to open-source, which have significantly aided in the development of some core features such as direct messaging, prompts, and email notifications. We invite the community to explore and contribute to other open-source projects like manifold.love as well, especially if you're interested in functionalities that deviate from Compass' ideals of deep, intentional connections.
|
||||
@@ -8,5 +8,5 @@
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Contact the development team to report a vulnerability. You should receive updates within a week.
|
||||
Contact the development team at hello@compassmeet.com to report a vulnerability. You should receive updates within a week.
|
||||
|
||||
|
||||
9
_old/.eslintrc.js
Normal file
9
_old/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// .eslintrc.js
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['next', 'next/core-web-vitals'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'react/no-unescaped-entities': 'off',
|
||||
},
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import {useEffect, useState} from "react";
|
||||
import Link from "next/link";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
import { FaHome } from "react-icons/fa";
|
||||
import {useSession} from "next-auth/react";
|
||||
import ThemeToggle from "@/lib/client/theme";
|
||||
import FavIcon from "@/components/FavIcon";
|
||||
|
||||
export default function Header() {
|
||||
const { data: session } = useSession();
|
||||
const {data: session} = useSession();
|
||||
const [isSmallScreen, setIsSmallScreen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const checkScreenSize = () => {
|
||||
setIsSmallScreen(window.innerWidth < 640); // Tailwind's 'sm' breakpoint is 640px
|
||||
};
|
||||
|
||||
|
||||
// Initial check
|
||||
checkScreenSize();
|
||||
|
||||
|
||||
// Add event listener for window resize
|
||||
window.addEventListener('resize', checkScreenSize);
|
||||
|
||||
|
||||
// Clean up the event listener when the component unmounts
|
||||
return () => window.removeEventListener('resize', checkScreenSize);
|
||||
}, []);
|
||||
@@ -30,25 +30,30 @@ export default function Header() {
|
||||
return (
|
||||
<header className="w-full
|
||||
{/*shadow-md*/}
|
||||
py-4 px-8 xs:px-4">
|
||||
py-5 px-8 xs:px-4">
|
||||
<nav className="flex justify-between items-center">
|
||||
<Link
|
||||
href="/"
|
||||
className="text-xl font-bold hover:text-blue-600 transition-colors flex items-center"
|
||||
aria-label={isSmallScreen ? "Home" : "IntentionalBond"}
|
||||
<Link
|
||||
href="/"
|
||||
className="text-4xl font-bold hover:text-blue-600 transition-colors flex items-center"
|
||||
aria-label={isSmallScreen ? "Home" : "Compass"}
|
||||
>
|
||||
{isSmallScreen ? <FaHome className="w-5 h-5" /> : 'IntentionalBond'}
|
||||
<FavIcon className="dark:invert"/>
|
||||
{!isSmallScreen && (
|
||||
<span className="flex items-center gap-2">
|
||||
Compass
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="flex items-center space-x-3">
|
||||
|
||||
<ThemeToggle/>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Link
|
||||
href="/learn-more"
|
||||
className={`${fontStyle} bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-white rounded-lg hover:bg-gray-300 dark:hover:bg-gray-500`}
|
||||
href="/about"
|
||||
className={`${fontStyle} bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-white rounded-full hover:bg-gray-300 dark:hover:bg-gray-500`}
|
||||
>
|
||||
Learn More
|
||||
About
|
||||
</Link>
|
||||
</div>
|
||||
{session ? (
|
||||
@@ -62,27 +67,22 @@ export default function Header() {
|
||||
</Link>
|
||||
{/*<Link*/}
|
||||
{/* href="/profiles"*/}
|
||||
{/* className="bg-blue-500 text-white px-4 py-2 rounded-lg hover:bg-blue-600 transition"*/}
|
||||
{/* className="bg-blue-500 text-white px-4 py-2 rounded-full hover:bg-blue-600 transition"*/}
|
||||
{/*>*/}
|
||||
{/* Dashboard*/}
|
||||
{/*</Link>*/}
|
||||
<button
|
||||
onClick={() => signOut({callbackUrl: "/"})}
|
||||
className={`${fontStyle} bg-red-500 text-white rounded-lg hover:bg-red-600`}
|
||||
>
|
||||
Sign Out
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Link href="/login" className={`${fontStyle} bg-blue-500 text-white rounded-lg hover:bg-blue-600 `}>
|
||||
<Link href="/login"
|
||||
className={`${fontStyle} bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-white rounded-full hover:bg-gray-300 dark:hover:bg-gray-500`}>
|
||||
Sign In
|
||||
</Link>
|
||||
<Link href="/register"
|
||||
className={`${fontStyle} bg-blue-500 text-white rounded-lg hover:bg-blue-600`}>
|
||||
{/*<Link href="/register"
|
||||
className={`${fontStyle} bg-blue-500 text-white rounded-full hover:bg-blue-600`}>
|
||||
Sign Up
|
||||
</Link>
|
||||
</Link> */}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -46,7 +46,7 @@ export async function POST(req: Request) {
|
||||
// const emailHtml = await render(VerificationEmail({ url: verificationUrl }));
|
||||
// try {
|
||||
// let payload = {
|
||||
// from: `BayesBond <${process.env.EMAIL_FROM!}>`,
|
||||
// from: `Compass <${process.env.EMAIL_FROM!}>`,
|
||||
// to: email,
|
||||
// subject: 'Verify your email',
|
||||
// html: emailHtml,
|
||||
@@ -1,10 +1,11 @@
|
||||
import { prisma } from "@/lib/server/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
import {prisma} from "@/lib/server/prisma";
|
||||
import {NextResponse} from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// Get all interests from the database
|
||||
const cacheStrategy = { swr: 60, ttl: 60, tags: ["interests"] };
|
||||
// Disable cache for now as it bugs when saving profile with new interest and clicking on "Edit Profile" just after
|
||||
const cacheStrategy = {swr: 0, ttl: 0, tags: ["interests"]};
|
||||
const interests = await prisma.interest.findMany({
|
||||
select: {
|
||||
id: true,
|
||||
@@ -27,6 +28,17 @@ export async function GET() {
|
||||
cacheStrategy: cacheStrategy,
|
||||
});
|
||||
|
||||
const books = await prisma.book.findMany({
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
orderBy: {
|
||||
name: 'asc'
|
||||
},
|
||||
cacheStrategy: cacheStrategy,
|
||||
});
|
||||
|
||||
const causeAreas = await prisma.causeArea.findMany({
|
||||
select: {
|
||||
id: true,
|
||||
@@ -49,12 +61,12 @@ export async function GET() {
|
||||
cacheStrategy: cacheStrategy,
|
||||
});
|
||||
|
||||
return NextResponse.json({ interests, coreValues, causeAreas, connections });
|
||||
return NextResponse.json({interests, coreValues, books, causeAreas, connections});
|
||||
} catch (error) {
|
||||
console.error('Error fetching interests:', error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to fetch interests" },
|
||||
{ status: 500 }
|
||||
{error: "Failed to fetch interests"},
|
||||
{status: 500}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export async function DELETE(
|
||||
prisma.profileCauseArea.deleteMany({
|
||||
where: { profileId: id },
|
||||
}),
|
||||
// Delete desired connections
|
||||
// Delete Type of Connection
|
||||
prisma.profileConnection.deleteMany({
|
||||
where: { profileId: id },
|
||||
}),
|
||||
@@ -12,9 +12,10 @@ export async function GET(request: Request) {
|
||||
const maxIntroversion = url.searchParams.get("maxIntroversion");
|
||||
const interests = url.searchParams.get("interests")?.split(",").filter(Boolean) || [];
|
||||
const coreValues = url.searchParams.get("coreValues")?.split(",").filter(Boolean) || [];
|
||||
const books = url.searchParams.get("books")?.split(",").filter(Boolean) || [];
|
||||
const causeAreas = url.searchParams.get("causeAreas")?.split(",").filter(Boolean) || [];
|
||||
const connections = url.searchParams.get("connections")?.split(",").filter(Boolean) || [];
|
||||
const searchQuery = url.searchParams.get("search") || "";
|
||||
const searchQueries = url.searchParams.get("searchQuery")?.split(",").map(q => q.trim()).filter(Boolean) || [];
|
||||
|
||||
const profilesPerPage = 100;
|
||||
const offset = (page - 1) * profilesPerPage;
|
||||
@@ -116,6 +117,22 @@ export async function GET(request: Request) {
|
||||
];
|
||||
}
|
||||
|
||||
// AND
|
||||
if (books.length > 0) {
|
||||
where.profile.AND = [
|
||||
...where.profile.AND,
|
||||
...books.map((name) => ({
|
||||
books: {
|
||||
some: {
|
||||
value: {
|
||||
name: name,
|
||||
},
|
||||
},
|
||||
},
|
||||
})),
|
||||
];
|
||||
}
|
||||
|
||||
if (causeAreas.length > 0) {
|
||||
where.profile.AND = [
|
||||
...where.profile.AND,
|
||||
@@ -145,93 +162,110 @@ export async function GET(request: Request) {
|
||||
};
|
||||
}
|
||||
|
||||
if (searchQuery) {
|
||||
where.OR = [
|
||||
{name: {contains: searchQuery, mode: 'insensitive'}},
|
||||
// {email: {contains: searchQuery, mode: 'insensitive'}},
|
||||
{
|
||||
profile: {
|
||||
description: {contains: searchQuery, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
occupation: {contains: searchQuery, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
location: {contains: searchQuery, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
contactInfo: {contains: searchQuery, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
intellectualInterests: {
|
||||
some: {
|
||||
interest: {
|
||||
name: {contains: searchQuery, mode: "insensitive"},
|
||||
if (searchQueries.length > 0) {
|
||||
where.AND = [
|
||||
...(where.AND ?? []),
|
||||
...searchQueries.map(query => ({
|
||||
OR: [
|
||||
{name: {contains: query, mode: 'insensitive'}},
|
||||
// {email: {contains: searchQuery, mode: 'insensitive'}},
|
||||
{
|
||||
profile: {
|
||||
description: {contains: query, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
occupation: {contains: query, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
location: {contains: query, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
contactInfo: {contains: query, mode: 'insensitive'},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
intellectualInterests: {
|
||||
some: {
|
||||
interest: {
|
||||
name: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
coreValues: {
|
||||
some: {
|
||||
value: {
|
||||
name: {contains: searchQuery, mode: "insensitive"},
|
||||
{
|
||||
profile: {
|
||||
coreValues: {
|
||||
some: {
|
||||
value: {
|
||||
name: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
causeAreas: {
|
||||
some: {
|
||||
causeArea: {
|
||||
name: {contains: searchQuery, mode: "insensitive"},
|
||||
{
|
||||
profile: {
|
||||
books: {
|
||||
some: {
|
||||
value: {
|
||||
name: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
desiredConnections: {
|
||||
some: {
|
||||
connection: {
|
||||
name: {contains: searchQuery, mode: "insensitive"},
|
||||
{
|
||||
profile: {
|
||||
causeAreas: {
|
||||
some: {
|
||||
causeArea: {
|
||||
name: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
promptAnswers: {
|
||||
some: {
|
||||
answer: {contains: searchQuery, mode: "insensitive"},
|
||||
{
|
||||
profile: {
|
||||
desiredConnections: {
|
||||
some: {
|
||||
connection: {
|
||||
name: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
profile: {
|
||||
promptAnswers: {
|
||||
some: {
|
||||
prompt: {contains: searchQuery, mode: "insensitive"},
|
||||
{
|
||||
profile: {
|
||||
promptAnswers: {
|
||||
some: {
|
||||
answer: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
{
|
||||
profile: {
|
||||
promptAnswers: {
|
||||
some: {
|
||||
prompt: {contains: query, mode: "insensitive"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
}))
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
console.log(where.profile);
|
||||
@@ -253,6 +287,7 @@ export async function GET(request: Request) {
|
||||
include: {
|
||||
intellectualInterests: {include: {interest: true}},
|
||||
coreValues: {include: {value: true}},
|
||||
books: {include: {value: true}},
|
||||
causeAreas: {include: {causeArea: true}},
|
||||
desiredConnections: {include: {connection: true}},
|
||||
promptAnswers: true,
|
||||
@@ -14,8 +14,9 @@ export async function POST(req: Request) {
|
||||
}
|
||||
|
||||
const data = await req.json();
|
||||
const {profile, image, name, interests = [], connections = [], coreValues = [], causeAreas = []} = data;
|
||||
const {profile, image, name, interests = [], connections = [], coreValues = [], books = [], causeAreas = []} = data;
|
||||
|
||||
console.log('books: ', books)
|
||||
Object.keys(profile).forEach(key => {
|
||||
if (profile[key] === '' || !profile[key]) {
|
||||
delete profile[key];
|
||||
@@ -71,6 +72,8 @@ export async function POST(req: Request) {
|
||||
profileConnection: prisma.profileConnection,
|
||||
value: prisma.value,
|
||||
profileValue: prisma.profileValue,
|
||||
book: prisma.book,
|
||||
profileBook: prisma.profileBook,
|
||||
causeArea: prisma.causeArea,
|
||||
profileCauseArea: prisma.profileCauseArea,
|
||||
} as const;
|
||||
@@ -79,7 +82,7 @@ export async function POST(req: Request) {
|
||||
|
||||
async function handleFeatures(features: any, attribute: ModelKey, profileAttribute: string, idName: string) {
|
||||
// Add new features
|
||||
if (features.length > 0 && updatedUser.profile) {
|
||||
if (features !== null && updatedUser.profile) {
|
||||
// First, find or create all features
|
||||
console.log('profile', profileAttribute, profileAttribute);
|
||||
const operations = features.map((feat: { id?: string; name: string }) =>
|
||||
@@ -95,25 +98,31 @@ export async function POST(req: Request) {
|
||||
// Get the IDs of all created/updated features
|
||||
const ids = createdFeatures.map(v => v.id);
|
||||
|
||||
// First, remove all existing interests for this profile
|
||||
await modelMap[profileAttribute].deleteMany({
|
||||
where: {profileId: updatedUser.profile.id},
|
||||
});
|
||||
const profileId = updatedUser.profile.id;
|
||||
console.log('profile ID:', profileId);
|
||||
|
||||
// Then, create new connections
|
||||
// First, remove all existing features for this profile
|
||||
const res = await modelMap[profileAttribute].deleteMany({
|
||||
where: {profileId: profileId},
|
||||
});
|
||||
console.log('deleted profile:', profileAttribute, res);
|
||||
|
||||
// Then, create new features
|
||||
if (ids.length > 0) {
|
||||
await modelMap[profileAttribute].createMany({
|
||||
const create_res =await modelMap[profileAttribute].createMany({
|
||||
data: ids.map(id => ({
|
||||
profileId: updatedUser.profile!.id,
|
||||
profileId: profileId,
|
||||
[idName]: id,
|
||||
})),
|
||||
skipDuplicates: true,
|
||||
});
|
||||
console.log('created many:', profileAttribute, create_res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await handleFeatures(interests, 'interest', 'profileInterest', 'interestId')
|
||||
await handleFeatures(books, 'book', 'profileBook', 'valueId')
|
||||
await handleFeatures(connections, 'connection', 'profileConnection', 'connectionId')
|
||||
await handleFeatures(coreValues, 'value', 'profileValue', 'valueId')
|
||||
await handleFeatures(causeAreas, 'causeArea', 'profileCauseArea', 'causeAreaId')
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import {ChangeEvent, ReactNode, Suspense, useEffect, useRef, useState} from 'react';
|
||||
import React, {ChangeEvent, ReactNode, Suspense, useEffect, useRef, useState} from 'react';
|
||||
import {useRouter, useSearchParams} from 'next/navigation';
|
||||
import {signOut, useSession} from 'next-auth/react';
|
||||
import Image from 'next/image';
|
||||
@@ -10,6 +10,11 @@ import {DeleteProfileButton} from "@/lib/client/profile";
|
||||
import PromptAnswer from '@/components/ui/PromptAnswer';
|
||||
|
||||
import imageCompression from 'browser-image-compression';
|
||||
import {Item} from '@/lib/client/schema';
|
||||
import {fetchFeatures} from "@/lib/client/fetching";
|
||||
import {errorBlock} from "@/lib/client/errors";
|
||||
import Slider from "@mui/material/Slider";
|
||||
|
||||
|
||||
export default function CompleteProfile() {
|
||||
return (
|
||||
@@ -51,28 +56,46 @@ function RegisterComponent() {
|
||||
const router = useRouter();
|
||||
const {data: session, update} = useSession();
|
||||
|
||||
const hooks = Object.fromEntries(['interests', 'coreValues', 'description', 'connections', 'causeAreas'].map((id) => {
|
||||
const [showMoreInfo, setShowMoreInfo] = useState(false);
|
||||
const [newFeature, setNewFeature] = useState('');
|
||||
const [allFeatures, setAllFeatures] = useState<{ id: string, name: string }[]>([]);
|
||||
const [selectedFeatures, setSelectedFeatures] = useState<Set<string>>(new Set());
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
const [showDropdown, setShowDropdown] = useState(false);
|
||||
const featureNames = ['interests', 'coreValues', 'description', 'connections', 'causeAreas', 'books'];
|
||||
|
||||
return [id, {
|
||||
showMoreInfo,
|
||||
setShowMoreInfo,
|
||||
newFeature,
|
||||
setNewFeature,
|
||||
allFeatures,
|
||||
setAllFeatures,
|
||||
selectedFeatures,
|
||||
setSelectedFeatures,
|
||||
dropdownRef,
|
||||
showDropdown,
|
||||
setShowDropdown
|
||||
}]
|
||||
}));
|
||||
const [showMoreInfo, _setShowMoreInfo] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, false]))
|
||||
);
|
||||
const setShowMoreInfo = (id: string, value: boolean) => {
|
||||
_setShowMoreInfo((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
const [newFeature, _setNewFeature] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, '']))
|
||||
);
|
||||
const setNewFeature = (id: string, value: string) => {
|
||||
_setNewFeature((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
const [allFeatures, _setAllFeatures] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, [] as Item[]]))
|
||||
);
|
||||
const setAllFeatures = (id: string, value: any) => {
|
||||
_setAllFeatures((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
const [selectedFeatures, _setSelectedFeatures] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, new Set<string>()]))
|
||||
);
|
||||
const setSelectedFeatures = (id: string, value: Set<string>) => {
|
||||
_setSelectedFeatures((prev) => ({...prev, [id]: value}));
|
||||
}
|
||||
|
||||
const [showDropdown, _setShowDropdown] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, false]))
|
||||
);
|
||||
const setShowDropdown = (id: string, value: boolean) => {
|
||||
_setShowDropdown((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
const refDropdown = useRef<any>(
|
||||
Object.fromEntries(featureNames.map((id) => [id, React.createRef<HTMLDivElement>()]))
|
||||
);
|
||||
|
||||
const id = session?.user.id
|
||||
|
||||
@@ -106,18 +129,19 @@ function RegisterComponent() {
|
||||
}
|
||||
|
||||
// Set selected interests if any
|
||||
function setSelectedFeatures(id: string, attribute: string, subAttribute: string) {
|
||||
function setSelFeat(id: string, attribute: string, subAttribute: string) {
|
||||
const feature = profile[attribute];
|
||||
if (feature?.length > 0) {
|
||||
const ids = feature.map((pi: any) => pi[subAttribute].id);
|
||||
hooks[id].setSelectedFeatures(new Set(ids));
|
||||
setSelectedFeatures(id, new Set(ids));
|
||||
}
|
||||
}
|
||||
|
||||
setSelectedFeatures('interests', 'intellectualInterests', 'interest')
|
||||
setSelectedFeatures('coreValues', 'coreValues', 'value')
|
||||
setSelectedFeatures('connections', 'desiredConnections', 'connection')
|
||||
setSelectedFeatures('causeAreas', 'causeAreas', 'causeArea')
|
||||
setSelFeat('interests', 'intellectualInterests', 'interest')
|
||||
setSelFeat('coreValues', 'coreValues', 'value')
|
||||
setSelFeat('connections', 'desiredConnections', 'connection')
|
||||
setSelFeat('causeAreas', 'causeAreas', 'causeArea')
|
||||
setSelFeat('books', 'books', 'value')
|
||||
|
||||
setImages([])
|
||||
setKeys(profile?.images)
|
||||
@@ -156,45 +180,37 @@ function RegisterComponent() {
|
||||
|
||||
}, []);
|
||||
|
||||
// Load existing interests and set up click-outside handler
|
||||
useEffect(() => {
|
||||
async function fetchFeatures() {
|
||||
try {
|
||||
const res = await fetch('/api/interests');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
for (const id of ['interests', 'coreValues', 'connections', 'causeAreas']) {
|
||||
hooks[id].setAllFeatures(data[id] || []);
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
const hook = hooks[id];
|
||||
const current = hook.dropdownRef.current;
|
||||
if (current && !current.contains(event.target as Node)) {
|
||||
hook.setShowDropdown(false);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
// return () => {
|
||||
// document.removeEventListener('mousedown', handleClickOutside);
|
||||
// };
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading' + id, error);
|
||||
}
|
||||
}
|
||||
|
||||
fetchFeatures();
|
||||
fetchFeatures(setAllFeatures)
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// Close dropdown when clicking outside
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
for (const id in showDropdown) {
|
||||
const ref = refDropdown.current[id];
|
||||
if (
|
||||
ref?.current &&
|
||||
!ref.current.contains(event.target as Node)
|
||||
) {
|
||||
setShowDropdown(id, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
};
|
||||
}, [showDropdown]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex justify-center items-center min-h-screen">
|
||||
<div className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
||||
<div className="flex justify-center min-h-screen py-8">
|
||||
<div data-testid="spinner"
|
||||
className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
const handleImagesUpload = async (e: ChangeEvent<HTMLInputElement>) => {
|
||||
@@ -294,10 +310,11 @@ function RegisterComponent() {
|
||||
...(key && {image: key}),
|
||||
...(name && {name}),
|
||||
};
|
||||
for (const name of ['interests', 'connections', 'coreValues', 'causeAreas']) {
|
||||
data[name] = Array.from(hooks[name].selectedFeatures).map(id => ({
|
||||
for (const name of ['books', 'interests', 'connections', 'coreValues', 'causeAreas']) {
|
||||
// if (!selectedFeatures[name].size) continue;
|
||||
data[name] = Array.from(selectedFeatures[name]).map(id => ({
|
||||
id: id.startsWith('new-') ? undefined : id,
|
||||
name: hooks[name].allFeatures.find(i => i.id === id)?.name || id.replace('new-', '')
|
||||
name: allFeatures[name].find(i => i.id === id)?.name
|
||||
}));
|
||||
}
|
||||
console.log('data', data)
|
||||
@@ -327,24 +344,21 @@ function RegisterComponent() {
|
||||
|
||||
const genderOptions = Object.values(Gender);
|
||||
// const personalityOptions = Object.values(PersonalityType);
|
||||
const conflictOptions = Object.values(ConflictStyle);
|
||||
// const conflictOptions = Object.values(ConflictStyle);
|
||||
|
||||
const headingStyle = "block text-base font-medium text-gray-700 dark:text-white mb-1";
|
||||
|
||||
function getDetails(id: string, brief: string, text: ReactNode) {
|
||||
const hook = hooks[id];
|
||||
const showMoreInfo = hook.showMoreInfo;
|
||||
const setShowMoreInfo = hook.setShowMoreInfo;
|
||||
return <>
|
||||
<div className="mt-2 mb-4">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowMoreInfo(!showMoreInfo)}
|
||||
onClick={() => setShowMoreInfo(id, !showMoreInfo[id])}
|
||||
className="text-sm text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 flex items-center"
|
||||
>
|
||||
{showMoreInfo ? 'Hide info' : brief}
|
||||
{showMoreInfo[id] ? 'Hide info' : brief}
|
||||
<svg
|
||||
className={`w-4 h-4 ml-1 transition-transform ${showMoreInfo ? 'rotate-180' : ''}`}
|
||||
className={`w-4 h-4 ml-1 transition-transform ${showMoreInfo[id] ? 'rotate-180' : ''}`}
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -352,7 +366,7 @@ function RegisterComponent() {
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7"/>
|
||||
</svg>
|
||||
</button>
|
||||
{showMoreInfo && (
|
||||
{showMoreInfo[id] && (
|
||||
<div className="mt-2 p-3 bg-gray-50 dark:bg-gray-800 rounded-md text-sm text-gray-700 dark:text-gray-300">
|
||||
{text}
|
||||
</div>
|
||||
@@ -370,11 +384,11 @@ function RegisterComponent() {
|
||||
|
||||
const dropdownConfig: DropdownConfig[] = [
|
||||
{
|
||||
id: 'connections', title: 'Desired Connections', allowAdd: false,
|
||||
id: 'connections', title: 'Connection Type', allowAdd: false,
|
||||
content: null
|
||||
},
|
||||
{
|
||||
id: 'coreValues', title: 'Core Values', allowAdd: true,
|
||||
id: 'coreValues', title: 'Values', allowAdd: true,
|
||||
content: <>
|
||||
<p className="mt-2">
|
||||
When defining your core values on a platform meant for forming deep, lasting bonds, focus on what governs your
|
||||
@@ -390,7 +404,7 @@ function RegisterComponent() {
|
||||
</>
|
||||
},
|
||||
{
|
||||
id: 'interests', title: 'Core Interests', allowAdd: true,
|
||||
id: 'interests', title: 'Interests', allowAdd: true,
|
||||
content: <>
|
||||
<p className="mt-2">
|
||||
When selecting your core interests on a platform designed to foster deep, lasting
|
||||
@@ -405,45 +419,50 @@ function RegisterComponent() {
|
||||
</>
|
||||
},
|
||||
{
|
||||
id: 'causeAreas', title: 'Cause Areas', allowAdd: true,
|
||||
id: 'books', title: 'Works to discuss', allowAdd: true,
|
||||
content: <>
|
||||
<p className="mt-2">
|
||||
When choosing your cause areas on a platform designed for deep, lasting connection, focus on the issues that
|
||||
you feel personally compelled to engage with—not just what’s socially approved or intellectually interesting.
|
||||
Good cause areas reveal what breaks your heart, what energizes your long-term thinking, or what you’d
|
||||
willingly struggle for even if no one noticed. Be honest about what genuinely matters to you: that might be
|
||||
existential risk reduction, prison abolition, mental health reform, animal welfare, epistemic integrity, or
|
||||
education equity. You don’t need to be an expert or activist to list a cause—just sincerely invested. The
|
||||
point isn’t to posture but to expose what kind of future you want to help shape, and to find others whose
|
||||
moral intuitions and sense of responsibility resonate with your own. That kind of alignment creates not just
|
||||
shared goals, but durable trust.
|
||||
List the works (books, articles, essays, reports, etc.) you would like to bring up.
|
||||
For each work, include the exact title (as it appears on the cover), the
|
||||
author’s full name, and, if necessary, the edition or publication year. For example: <i>Peter Singer - Animal
|
||||
Liberation</i>. If you want to focus on specific
|
||||
chapters, themes, or questions, note them in your description—it helps keep the discussion targeted. Don’t just write
|
||||
“something by Orwell” or “that new mystery”; vague entries waste time and make it harder for others to find
|
||||
the right work. Be explicit so everyone is literally on the same page!
|
||||
</p>
|
||||
</>
|
||||
},
|
||||
// {
|
||||
// id: 'causeAreas', title: 'Cause Areas', allowAdd: true,
|
||||
// content: <>
|
||||
// <p className="mt-2">
|
||||
// When choosing your cause areas on a platform designed for deep, lasting connection, focus on the issues that
|
||||
// you feel personally compelled to engage with—not just what’s socially approved or intellectually interesting.
|
||||
// Good cause areas reveal what breaks your heart, what energizes your long-term thinking, or what you’d
|
||||
// willingly struggle for even if no one noticed. Be honest about what genuinely matters to you: that might be
|
||||
// existential risk reduction, prison abolition, mental health reform, animal welfare, epistemic integrity, or
|
||||
// education equity. You don’t need to be an expert or activist to list a cause—just sincerely invested. The
|
||||
// point isn’t to posture but to expose what kind of future you want to help shape, and to find others whose
|
||||
// moral intuitions and sense of responsibility resonate with your own. That kind of alignment creates not just
|
||||
// shared goals, but durable trust.
|
||||
// </p>
|
||||
// </>
|
||||
// },
|
||||
]
|
||||
|
||||
function getDropdown({id, title, allowAdd, content}: DropdownConfig) {
|
||||
const hook = hooks[id];
|
||||
const newFeature = hook.newFeature;
|
||||
const setNewFeature = hook.setNewFeature;
|
||||
const showDropdown = hook.showDropdown;
|
||||
const setShowDropdown = hook.setShowDropdown;
|
||||
const allFeatures = hook.allFeatures;
|
||||
const setSelectedFeatures = hook.setSelectedFeatures;
|
||||
const setAllFeatures = hook.setAllFeatures;
|
||||
const dropdownRef = hook.dropdownRef;
|
||||
const selectedFeatures = hook.selectedFeatures;
|
||||
const newFeat = newFeature[id];
|
||||
const allFeat = allFeatures[id];
|
||||
const selectedFeat = selectedFeatures[id];
|
||||
|
||||
const toggleFeature = (featureId: string) => {
|
||||
setSelectedFeatures(prev => {
|
||||
const newSet = new Set(prev);
|
||||
if (newSet.has(featureId)) {
|
||||
newSet.delete(featureId);
|
||||
} else {
|
||||
newSet.add(featureId);
|
||||
}
|
||||
return newSet;
|
||||
});
|
||||
const newSet = new Set(selectedFeat);
|
||||
if (newSet.has(featureId)) {
|
||||
newSet.delete(featureId);
|
||||
} else {
|
||||
newSet.add(featureId);
|
||||
}
|
||||
setSelectedFeatures(id, newSet);
|
||||
};
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
@@ -451,17 +470,17 @@ function RegisterComponent() {
|
||||
e.preventDefault();
|
||||
addNewFeature();
|
||||
} else if (e.key === 'Escape') {
|
||||
setShowDropdown(false);
|
||||
setShowDropdown(id, false);
|
||||
}
|
||||
};
|
||||
|
||||
const addNewFeature = (e?: React.FormEvent) => {
|
||||
if (e) e.preventDefault();
|
||||
const toAdd = newFeature.trim();
|
||||
const toAdd = newFeat.trim();
|
||||
if (!toAdd) return;
|
||||
|
||||
// Check if interest already exists (case-insensitive)
|
||||
const existingFeature = allFeatures.find(
|
||||
const existingFeature = allFeat.find(
|
||||
i => i.name.toLowerCase() === toAdd.toLowerCase()
|
||||
);
|
||||
|
||||
@@ -471,36 +490,36 @@ function RegisterComponent() {
|
||||
} else {
|
||||
// Add new feature
|
||||
const newObj = {id: `new-${Date.now()}`, name: toAdd};
|
||||
setAllFeatures(prev => [...prev, newObj]);
|
||||
setSelectedFeatures(prev => new Set(prev).add(newObj.id));
|
||||
setAllFeatures(id, [...allFeat, newObj]);
|
||||
setSelectedFeatures(id, new Set(selectedFeat).add(newObj.id));
|
||||
}
|
||||
|
||||
setNewFeature('');
|
||||
setShowDropdown(false);
|
||||
setNewFeature(id, '');
|
||||
setShowDropdown(id, false);
|
||||
};
|
||||
|
||||
return <>
|
||||
<div className="relative" ref={dropdownRef}>
|
||||
<div className="relative" ref={refDropdown.current[id]}>
|
||||
<label className={headingStyle}>
|
||||
{title}
|
||||
</label>
|
||||
{content && getDetails(id, 'Guidance', content)}
|
||||
{content && getDetails(id, 'Tips', content)}
|
||||
|
||||
<div className="relative">
|
||||
<div className="flex items-center border border-gray-300 rounded-md shadow-sm">
|
||||
<input
|
||||
type="text"
|
||||
value={newFeature}
|
||||
value={newFeat}
|
||||
maxLength={100}
|
||||
onChange={(e) => setNewFeature(e.target.value)}
|
||||
onFocus={() => setShowDropdown(true)}
|
||||
onChange={(e) => setNewFeature(id, e.target.value)}
|
||||
onFocus={() => setShowDropdown(id, true)}
|
||||
onKeyDown={handleKeyDown}
|
||||
className="flex-1 min-w-0 block w-full px-3 py-2 rounded-l-md border-0 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||
placeholder={allowAdd ? "Type to search or add" : "Type to search"}
|
||||
placeholder={allowAdd ? "Search or add your own" : "Type to search"}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowDropdown(!showDropdown)}
|
||||
onClick={() => setShowDropdown(id, !showDropdown[id])}
|
||||
className="px-3 py-2 border-l border-gray-300 text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 "
|
||||
>
|
||||
<svg className="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||
@@ -514,7 +533,7 @@ function RegisterComponent() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={addNewFeature}
|
||||
disabled={!newFeature.trim()}
|
||||
disabled={!newFeat.trim()}
|
||||
className="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-r-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
Add
|
||||
@@ -522,12 +541,12 @@ function RegisterComponent() {
|
||||
}
|
||||
</div>
|
||||
|
||||
{(showDropdown || newFeature) && (
|
||||
{(showDropdown[id] || newFeat) && (
|
||||
<div
|
||||
className="absolute z-10 mt-1 w-full bg-white dark:bg-gray-800 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
|
||||
{/* New interest option */}
|
||||
{allowAdd && newFeature && !allFeatures.some(i =>
|
||||
i.name.toLowerCase() === newFeature.toLowerCase()
|
||||
{allowAdd && newFeat && !allFeat.some(i =>
|
||||
i.name.toLowerCase() === newFeat.toLowerCase()
|
||||
) && (
|
||||
<div
|
||||
className=" cursor-default select-none relative py-2 pl-3 pr-9 hover:bg-blue-50 dark:hover:bg-gray-700"
|
||||
@@ -535,36 +554,36 @@ function RegisterComponent() {
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<span className="font-normal ml-3 block truncate">
|
||||
Add "{newFeature}"
|
||||
Add "{newFeat}"
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Filtered interests */}
|
||||
{allFeatures
|
||||
.filter(interest =>
|
||||
interest.name.toLowerCase().includes(newFeature.toLowerCase())
|
||||
{/* Filtered features */}
|
||||
{(!allowAdd || newFeat.length >= 3) && allFeat
|
||||
.filter(feature =>
|
||||
feature.name.toLowerCase().includes(newFeat.toLowerCase())
|
||||
)
|
||||
.map((interest) => (
|
||||
.map((feature) => (
|
||||
<div
|
||||
key={interest.id}
|
||||
key={feature.id}
|
||||
className="cursor-default select-none relative py-2 pl-3 pr-9 hover:bg-blue-50 dark:hover:bg-gray-700"
|
||||
onClick={() => {
|
||||
toggleFeature(interest.id);
|
||||
setNewFeature('');
|
||||
toggleFeature(feature.id);
|
||||
setNewFeature(id, '');
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded "
|
||||
checked={selectedFeatures.has(interest.id)}
|
||||
checked={selectedFeat.has(feature.id)}
|
||||
onChange={(e) => {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
/>
|
||||
<span className="font-normal ml-3 block truncate">{interest.name}</span>
|
||||
<span className="font-normal ml-3 block truncate">{feature.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -574,8 +593,8 @@ function RegisterComponent() {
|
||||
|
||||
{/* Selected interests */}
|
||||
<div className="flex flex-wrap gap-2 mt-3">
|
||||
{Array.from(selectedFeatures).map(featureId => {
|
||||
const interest = allFeatures.find(i => i.id === featureId);
|
||||
{Array.from(selectedFeat).map(featureId => {
|
||||
const interest = allFeat.find(i => i.id === featureId);
|
||||
if (!interest) return null;
|
||||
return (
|
||||
<span
|
||||
@@ -605,24 +624,6 @@ function RegisterComponent() {
|
||||
</>
|
||||
}
|
||||
|
||||
function errorBlock() {
|
||||
return <div className="bg-red-50 border-l-4 border-red-400 p-4">
|
||||
<div className="flex">
|
||||
<div className="flex-shrink-0">
|
||||
<svg className="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path fillRule="evenodd"
|
||||
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
|
||||
clipRule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-3">
|
||||
<p className="text-sm text-red-700">{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
|
||||
<div className="max-w-3xl w-full space-y-8">
|
||||
@@ -632,7 +633,7 @@ function RegisterComponent() {
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
{error && errorBlock()}
|
||||
{error && errorBlock(error)}
|
||||
|
||||
<div className="flex justify-center mb-6">
|
||||
<div className="relative">
|
||||
@@ -747,26 +748,32 @@ function RegisterComponent() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{getDropdown(dropdownConfig[0])}
|
||||
{getDropdown(dropdownConfig[1])}
|
||||
{getDropdown(dropdownConfig[2])}
|
||||
{getDropdown(dropdownConfig[3])}
|
||||
{dropdownConfig.map((v, i) => (
|
||||
<React.Fragment key={i}>{getDropdown(v)}</React.Fragment>
|
||||
))}
|
||||
|
||||
|
||||
<div>
|
||||
<label htmlFor="introversion" className={headingStyle}>
|
||||
Introversion (0) - Extroversion (100)
|
||||
</label>
|
||||
<input
|
||||
id="introversion"
|
||||
name="introversion"
|
||||
type="number"
|
||||
min="0"
|
||||
max="100"
|
||||
value={introversion ? 100 - introversion : ''}
|
||||
onChange={(e) => setIntroversion(100 - Number(e.target.value))}
|
||||
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
// placeholder=""
|
||||
/>
|
||||
<label htmlFor="introversion" className={headingStyle}>Social Style</label>
|
||||
<div className="flex items-center w-full max-w-xl gap-4">
|
||||
<span className={headingStyle}>Introverted</span>
|
||||
<Slider
|
||||
value={introversion ? 100 - introversion : 50}
|
||||
onChange={(e, value) => setIntroversion(100 - Number(value))}
|
||||
valueLabelDisplay="auto"
|
||||
min={0}
|
||||
max={100}
|
||||
sx={{
|
||||
color: '#3B82F6',
|
||||
'& .MuiSlider-valueLabel': {
|
||||
backgroundColor: '#3B82F6',
|
||||
color: '#fff',
|
||||
},
|
||||
}}
|
||||
className="flex-1"
|
||||
/>
|
||||
<span className={headingStyle}>Extroverted</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/*<div>*/}
|
||||
@@ -789,39 +796,38 @@ function RegisterComponent() {
|
||||
{/* </select>*/}
|
||||
{/*</div>*/}
|
||||
|
||||
<div>
|
||||
<label htmlFor="conflictStyle" className={headingStyle}>
|
||||
Conflict Style
|
||||
</label>
|
||||
<select
|
||||
id="conflictStyle"
|
||||
name="conflictStyle"
|
||||
value={conflictStyle || ''}
|
||||
onChange={(e) => setConflictStyle(e.target.value as ConflictStyle)}
|
||||
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
>
|
||||
<option value="">Select your conflict style</option>
|
||||
{conflictOptions.map((style) => (
|
||||
<option key={style} value={style}>
|
||||
{style}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
{/*<div>*/}
|
||||
{/* <label htmlFor="conflictStyle" className={headingStyle}>*/}
|
||||
{/* Conflict Style*/}
|
||||
{/* </label>*/}
|
||||
{/* <select*/}
|
||||
{/* id="conflictStyle"*/}
|
||||
{/* name="conflictStyle"*/}
|
||||
{/* value={conflictStyle || ''}*/}
|
||||
{/* onChange={(e) => setConflictStyle(e.target.value as ConflictStyle)}*/}
|
||||
{/* className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"*/}
|
||||
{/* >*/}
|
||||
{/* <option value="">Select your conflict style</option>*/}
|
||||
{/* {conflictOptions.map((style) => (*/}
|
||||
{/* <option key={style} value={style}>*/}
|
||||
{/* {style}*/}
|
||||
{/* </option>*/}
|
||||
{/* ))}*/}
|
||||
{/* </select>*/}
|
||||
{/*</div>*/}
|
||||
|
||||
<div className="max-w-3xl w-full">
|
||||
<label htmlFor="description" className={headingStyle}>
|
||||
About You
|
||||
<p className="text-sm italic">
|
||||
Feel free to include any relevant links (dating / friends docs, etc.), but consider copy-pasting
|
||||
the content here so that people can find you by keyword search.
|
||||
People search by keyword, so include as many words that feel true to you!
|
||||
</p>
|
||||
</label>
|
||||
{getDetails(
|
||||
'description',
|
||||
'Guidance',
|
||||
'Tips',
|
||||
<>
|
||||
<p className="mt-2">To the extent that you are comfortable sharing, consider writing about:</p>
|
||||
<p className="mt-2">Consider adding:</p>
|
||||
<ul className="list-disc pl-5 space-y-1">
|
||||
<li>Your interests and what you're looking for: type of connection, activities to do, etc.</li>
|
||||
<li>Your availability and timezone</li>
|
||||
@@ -963,7 +969,7 @@ function RegisterComponent() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{error && errorBlock()}
|
||||
{error && errorBlock(error)}
|
||||
|
||||
<div>
|
||||
<button
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import {DropdownKey} from "@/app/profiles/page";
|
||||
import { DropdownKey } from "@/lib/client/schema";
|
||||
|
||||
|
||||
type DropdownProps = {
|
||||
id: DropdownKey
|
||||
@@ -66,3 +66,20 @@ ul {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.spinner {
|
||||
width: 48px; /* 12 * 4px */
|
||||
height: 48px;
|
||||
border: 4px solid #d1d5db; /* gray-300 */
|
||||
border-top-color: #1f2937; /* gray-800 */
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import Header from "@/app/Header";
|
||||
import Providers from "@/app/providers";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "IntentionalBond",
|
||||
description: "A bonding platform for rational thinkers",
|
||||
title: "Compass",
|
||||
description: "A social platform to form intentional bonds",
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function RootLayout(
|
||||
<footer className="p-6 text-center text-gray-500">
|
||||
<div className="mb-2">
|
||||
<a
|
||||
href="https://github.com/BayesBond/BayesBond"
|
||||
href="https://github.com/CompassConnections/Compass"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center text-gray-500 hover:text-gray-700 transition"
|
||||
@@ -41,7 +41,7 @@ export default function RootLayout(
|
||||
View on GitHub
|
||||
</a>
|
||||
</div>
|
||||
<div>© {new Date().getFullYear()} IntentionalBond. All rights reserved.</div>
|
||||
<div>© {new Date().getFullYear()} Compass. All rights reserved.</div>
|
||||
</footer>
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import {aColor, supportEmail} from "@/lib/client/constants";
|
||||
import Image from 'next/image';
|
||||
|
||||
export default function PrivacyPage() {
|
||||
return (
|
||||
@@ -169,7 +169,7 @@ export default function PrivacyPage() {
|
||||
<p>If the platform is very selective, there will be only a couple people with very aligned values. Their well-being will increase a lot, but there are only a few of them. So there is not much overall benefit for society.</p>
|
||||
<p>If the platform is fully open (everyone can join), there are two possibilities depending on the connection mechanism. If the list of members is opaque and poorly searchable, as in traditional dating apps, it becomes very unlikely to find value-aligned people. Hence, each individual’s increase in well-being is negligible, even though there are plenty of people, and there is not much overall benefit for society either.</p>
|
||||
<p>Qualitatively, the figure below illustrates this trade-off between selectivity and openness for poorly searchable (i.e., Tinder-type) platforms. The quality is the individual increase in well-being, which increases as the platform selects for people strictly following the core values. The quantity is simply the number of users. The platform’s overall benefit (read, increase in total well-being) is then the product of quantity and quality—reaching a maximum with a non-extreme selectivity.</p>
|
||||
<p><img src="https://martinbraquet.com/wp-content/uploads/rational_qualitative.png" alt="" /></p>
|
||||
<p><Image src="https://martinbraquet.com/wp-content/uploads/rational_qualitative.png" alt="" /></p>
|
||||
<p>The second possibility appears when the members are fully visible and searchable by anyone. In that case, each member can filter and meaningfully engage with the few people aligning with their values. Each individual’s increase in well-being becomes important, and there are plenty of people. So, a fully open and searchable platform may bring a lot of overall benefit for society.</p>
|
||||
<p>Of course, in practice, there will always be interferences within big communities. And, more importantly, a larger platform requires more resources (i.e., funding) and moderation. That’s why the focus of this article is on a specific community for now. Not only do I identify with the rational / intellectual community, but it is also composed of members who are much more likely to contribute (especially on the tech side), making it a very convenient community. But if it creates much greater good, I think it would be worth considering extending the platform at some point in the far future—provided that it doesn’t negatively dilute the community or create brand identity confusion. More than just creating a higher good, a larger user base means economy of scale: donations may scale proportionally while expense per user would diminish—making the platform more likely to survive financially.</p>
|
||||
<h3 id="viability">Viability</h3>
|
||||
23
_old/app/onboarding/page.tsx
Normal file
23
_old/app/onboarding/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import {Suspense} from "react";
|
||||
import OnboardingForm from "@/components/onboarding";
|
||||
|
||||
|
||||
export default function RegisterPage() {
|
||||
return (
|
||||
<Suspense fallback={<div></div>}>
|
||||
<RegisterComponent/>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
function RegisterComponent() {
|
||||
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
|
||||
<OnboardingForm/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
125
_old/app/page.tsx
Normal file
125
_old/app/page.tsx
Normal file
@@ -0,0 +1,125 @@
|
||||
'use client';
|
||||
|
||||
import ProfilePage from "@/app/profiles/page";
|
||||
import Link from "next/link";
|
||||
import {useEffect} from 'react';
|
||||
import {useSession} from "next-auth/react"; // ← Add this line here
|
||||
|
||||
export const dynamic = "force-dynamic"; // This disables SSG and ISR
|
||||
|
||||
|
||||
export default function HomePage() {
|
||||
const {data: session} = useSession();
|
||||
const userId = session?.user?.id
|
||||
console.log("session:", userId)
|
||||
|
||||
const fontStyle = "transition px-5 py-3 text-3xl font-medium xs:text-sm"
|
||||
|
||||
useEffect(() => {
|
||||
const text = "Search.";
|
||||
const typewriter = document.getElementById("typewriter");
|
||||
let i = 0;
|
||||
let timeoutId: any;
|
||||
let intervalId;
|
||||
|
||||
// Clear any existing content
|
||||
if (typewriter) typewriter.textContent = ""
|
||||
|
||||
function typeWriter() {
|
||||
if (i < text.length && typewriter) {
|
||||
typewriter.textContent = text.substring(0, i + 1);
|
||||
i++;
|
||||
timeoutId = setTimeout(typeWriter, 150);
|
||||
}
|
||||
}
|
||||
|
||||
// Start typing after delay
|
||||
intervalId = setTimeout(() => typeWriter(), 500);
|
||||
|
||||
// Cleanup function - this runs when component unmounts
|
||||
return () => {
|
||||
clearTimeout(timeoutId);
|
||||
clearTimeout(intervalId);
|
||||
if (typewriter) typewriter.textContent = "Search."
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<main className="min-h-screen flex flex-col">
|
||||
{/* Header */}
|
||||
{/*<header className="flex justify-between items-center p-2 max-w-6xl mx-auto w-full">*/}
|
||||
{/* <a */}
|
||||
{/* href="https://github.com/CompassConnections/Compass" */}
|
||||
{/* target="_blank" */}
|
||||
{/* rel="noopener noreferrer"*/}
|
||||
{/* className="text-gray-700 hover: transition"*/}
|
||||
{/* >*/}
|
||||
{/* <svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">*/}
|
||||
{/* <path fillRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.699 1.028 1.595 1.028 2.688 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clipRule="evenodd" />*/}
|
||||
{/* </svg>*/}
|
||||
{/* </a>*/}
|
||||
{/*</header>*/}
|
||||
|
||||
{/* Hero Section */}
|
||||
<section className="flex flex-col items-center justify-start flex-1 text-center px-4">
|
||||
<div className="h-10"></div>
|
||||
<h1
|
||||
className="pt-12 pb-2 text-7xl md:text-8xl xs:text-6xl font-extrabold max-w-4xl leading-tight xl:whitespace-nowrap md:whitespace-nowrap ">
|
||||
Don't Swipe. <span id="typewriter"></span><span id="cursor" className="animate-pulse">|</span>
|
||||
</h1>
|
||||
{/*<p className="mt-6 text-lg md:text-xl text-gray-400 max-w-2xl">*/}
|
||||
{/* {"Tired of swiping? Search what you're looking for!"}*/}
|
||||
{/*</p>*/}
|
||||
{/* Spacer */}
|
||||
<div className="h-10"></div>
|
||||
{!userId && <div className="py-8">
|
||||
<Link href="/register"
|
||||
className={`${fontStyle} bg-gradient-to-r from-red-600 to-red-800 text-white rounded-full hover:from-red-700 hover:to-red-900`}>
|
||||
Join Compass
|
||||
</Link>
|
||||
{/* Spacer */}
|
||||
{/*<div className="h-16"></div>*/}
|
||||
</div>}
|
||||
{/* Why Compass Bar */}
|
||||
<div className="w-full bg-gray-50 dark:bg-gray-900 py-8 mt-20">
|
||||
<div className="max-w-6xl mx-auto px-4">
|
||||
<div className="grid md:grid-cols-3 gap-8 text-center">
|
||||
<div className="space-y-2">
|
||||
<h3 className="text-lg font-bold">Radically Transparent</h3>
|
||||
<p className="text-gray-600 dark:text-gray-400">
|
||||
No algorithms. Every profile searchable.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<h3 className="text-lg font-bold">Built for Depth</h3>
|
||||
<p className="text-gray-600 dark:text-gray-400">
|
||||
Filter by any keyword and what matters most.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<h3 className="text-lg font-bold">Community Owned</h3>
|
||||
<p className="text-gray-600 dark:text-gray-400">
|
||||
Free forever. Built by users, for users.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* Spacer */}
|
||||
{userId &&
|
||||
<>
|
||||
{/*<div className="h-20"></div>*/}
|
||||
<div className=" w-full py-10">
|
||||
<main className="min-h-screen flex flex-col">
|
||||
<ProfilePage/>
|
||||
</main>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import Link from 'next/link';
|
||||
import {usePathname, useRouter} from "next/navigation";
|
||||
import {getProfile} from "@/lib/client/profile";
|
||||
import {Profile} from "@/lib/client/profile";
|
||||
import {useEffect} from "react";
|
||||
import {useSession} from "next-auth/react";
|
||||
import {signOut, useSession} from "next-auth/react";
|
||||
|
||||
export default function ProfilePage() {
|
||||
const pathname = usePathname(); // Get the current route
|
||||
@@ -30,16 +30,22 @@ export default function ProfilePage() {
|
||||
</div>
|
||||
<Link
|
||||
href={`/complete-profile?redirect=${encodeURIComponent(pathname)}`}
|
||||
className="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
className="mx-1 transition px-2 py-2 text-sm font-medium xs:text-xs bg-blue-500 text-white rounded-full hover:bg-blue-600 min-w-20"
|
||||
>
|
||||
Edit Profile
|
||||
</Link>
|
||||
<button
|
||||
onClick={() => signOut({callbackUrl: "/"})}
|
||||
className="mx-1 transition px-2 py-2 text-sm font-medium xs:text-xs bg-red-500 text-white rounded-full hover:bg-red-600 min-w-20"
|
||||
>
|
||||
Sign Out
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="min-h-screen py-12 px-4 sm:px-6 lg:px-8">
|
||||
{getProfile('/api/profile', header)}
|
||||
{Profile('/api/profile', header)}
|
||||
</div>
|
||||
)
|
||||
;
|
||||
@@ -1,11 +1,12 @@
|
||||
'use client';
|
||||
|
||||
import {useEffect, useRef, useState} from 'react';
|
||||
import React, {useEffect, useRef, useState} from 'react';
|
||||
import {Gender} from "@prisma/client";
|
||||
import Dropdown from "@/app/components/dropdown";
|
||||
import Slider from '@mui/material/Slider';
|
||||
import {DropdownKey, RangeKey} from "@/app/profiles/page";
|
||||
import {DropdownKey, Item, RangeKey} from "@/lib/client/schema";
|
||||
import {capitalize} from "@/lib/format";
|
||||
import {fetchFeatures} from "@/lib/client/fetching";
|
||||
|
||||
interface FilterProps {
|
||||
filters: {
|
||||
@@ -27,10 +28,11 @@ interface FilterProps {
|
||||
}
|
||||
|
||||
export const dropdownConfig: { id: DropdownKey, name: string }[] = [
|
||||
{id: "connections", name: "Desired Connections"},
|
||||
{id: "coreValues", name: "Core Values"},
|
||||
{id: "interests", name: "Core Interests"},
|
||||
{id: "causeAreas", name: "Cause Areas"},
|
||||
{id: "connections", name: "Connection Type"},
|
||||
{id: "coreValues", name: "Values"},
|
||||
{id: "interests", name: "Interests"},
|
||||
{id: "books", name: "Works"},
|
||||
// {id: "causeAreas", name: "Cause Areas"},
|
||||
]
|
||||
|
||||
export const rangeConfig: { id: RangeKey, name: string, min: number, max: number }[] = [
|
||||
@@ -39,59 +41,87 @@ export const rangeConfig: { id: RangeKey, name: string, min: number, max: number
|
||||
]
|
||||
|
||||
export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggleFilter, onReset}: FilterProps) {
|
||||
interface Item {
|
||||
id: DropdownKey;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const [showFilters, setShowFilters] = useState(true);
|
||||
|
||||
const dropDownStates = Object.fromEntries(dropdownConfig.map(({id}) => {
|
||||
const [all, setAll] = useState<Item[]>([]);
|
||||
const [selected, setSelected] = useState<Set<string>>(new Set());
|
||||
const [newValue, setNewValue] = useState('');
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const [show, setShow] = useState(false);
|
||||
// Initialize state for all dropdowns as an object with keys from dropdownConfig ids
|
||||
const [optionsDropdown, setOptionsDropdown] = useState(() =>
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, [] as Item[]]))
|
||||
);
|
||||
const setOptionsDropdownId = (id: string, value: any) => {
|
||||
setOptionsDropdown((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
const [selectedDropdown, setSelectedDropdown] = useState(() =>
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, new Set<string>()]))
|
||||
);
|
||||
|
||||
const [newDropdown, setNewDropdown] = useState(() =>
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, '']))
|
||||
);
|
||||
|
||||
const [showDropdown, setShowDropdown] = useState(() =>
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, false]))
|
||||
);
|
||||
|
||||
// refs cannot be in state; create refs map outside state
|
||||
const refDropdown = useRef<any>(
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, React.createRef<HTMLDivElement>()]))
|
||||
);
|
||||
|
||||
return [id, {
|
||||
options: {value: all, set: setAll},
|
||||
selected: {value: selected, set: setSelected},
|
||||
new: {value: newValue, set: setNewValue},
|
||||
ref: ref,
|
||||
show: {value: show, set: setShow},
|
||||
}]
|
||||
}))
|
||||
console.log(dropDownStates)
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchOptions() {
|
||||
try {
|
||||
const res = await fetch('/api/interests');
|
||||
if (res.ok) {
|
||||
const data = await res.json() as Record<string, Item[]>;
|
||||
console.log(data);
|
||||
for (const [id, values] of Object.entries(data)) {
|
||||
console.log(id)
|
||||
dropDownStates[id].options.set(values);
|
||||
fetchFeatures(setOptionsDropdownId);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('selectedDropdown changed:', selectedDropdown);
|
||||
}, [selectedDropdown]);
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
console.log('optionsDropdown changed:', optionsDropdown, params);
|
||||
|
||||
for (const [key, value] of params.entries()) {
|
||||
let v: any = value
|
||||
if (key === 'minAge') {
|
||||
setMinRange({...minRange, age: v});
|
||||
} else if (key === 'maxAge') {
|
||||
setMaxRange({...maxRange, age: v});
|
||||
} else if (key === 'minIntroversion') {
|
||||
setMinRange({...minRange, introversion: v});
|
||||
} else if (key === 'maxIntroversion') {
|
||||
setMaxRange({...maxRange, introversion: v});
|
||||
} else if (['interests', 'coreValues', 'causeAreas', 'connections'].includes(key)) {
|
||||
v = v.split(",").filter(Boolean) || []
|
||||
console.log(v)
|
||||
for (const n of v) {
|
||||
const option = optionsDropdown[key].find(i => i.name === n);
|
||||
if (option) {
|
||||
console.log(option);
|
||||
setSelectedDropdown(prev => {
|
||||
const newSet = new Set(prev[key]);
|
||||
newSet.add(option.id);
|
||||
return {...prev, [key]: newSet};
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading options:', error);
|
||||
}
|
||||
}
|
||||
}, [optionsDropdown]);
|
||||
|
||||
fetchOptions();
|
||||
|
||||
useEffect(() => {
|
||||
// Close dropdown when clicking outside
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
for (const id in dropDownStates) {
|
||||
const dropdown = dropDownStates[id];
|
||||
const ref = dropdown.ref;
|
||||
for (const id in showDropdown) {
|
||||
const ref = refDropdown.current[id];
|
||||
if (
|
||||
ref?.current &&
|
||||
!ref.current.contains(event.target as Node)
|
||||
) {
|
||||
dropdown.show?.set?.(false); // Defensive chaining
|
||||
setShowDropdown(prev => ({...prev, [id]: false}));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -101,61 +131,61 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
};
|
||||
}, []);
|
||||
}, [showDropdown]);
|
||||
|
||||
|
||||
const toggle = (id: DropdownKey, optionId: string) => {
|
||||
dropDownStates[id].selected.set(prev => {
|
||||
const newSet = new Set(prev);
|
||||
setSelectedDropdown(prev => {
|
||||
const newSet = new Set(prev[id]);
|
||||
if (newSet.has(optionId)) {
|
||||
newSet.delete(optionId);
|
||||
} else {
|
||||
newSet.add(optionId);
|
||||
}
|
||||
return newSet;
|
||||
// console.log(newSet);
|
||||
return {...prev, [id]: newSet};
|
||||
});
|
||||
};
|
||||
|
||||
const handleKeyDown = (id: DropdownKey, key: string) => {
|
||||
if (key === 'Escape') dropDownStates[id].show.set(false);
|
||||
if (key === 'Escape') setShowDropdown(prev => ({...prev, [id]: false}));
|
||||
};
|
||||
|
||||
const handleChange = (id: DropdownKey, e: string) => {
|
||||
dropDownStates[id].new.set(e);
|
||||
setNewDropdown(prev => ({...prev, [id]: e}));
|
||||
}
|
||||
|
||||
const handleFocus = (id: DropdownKey) => {
|
||||
dropDownStates[id].show.set(true);
|
||||
setShowDropdown(prev => ({...prev, [id]: true}))
|
||||
}
|
||||
|
||||
const handleClick = (id: DropdownKey) => {
|
||||
const shown = dropDownStates[id].show.value;
|
||||
dropDownStates[id].show.set(!shown);
|
||||
setShowDropdown(prev => ({...prev, [id]: !showDropdown[id]}))
|
||||
}
|
||||
|
||||
function getDrowDown(id: DropdownKey, name: string) {
|
||||
|
||||
return (
|
||||
<div key={id + '.div'}>
|
||||
<div className="relative" ref={dropDownStates[id].ref}>
|
||||
<div className="relative" ref={refDropdown.current[id]}>
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-white mb-2">
|
||||
{name}
|
||||
</label>
|
||||
<Dropdown
|
||||
key={id}
|
||||
id={id}
|
||||
value={dropDownStates[id].new.value}
|
||||
value={newDropdown[id]}
|
||||
onChange={handleChange}
|
||||
onFocus={handleFocus}
|
||||
onKeyDown={handleKeyDown}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
|
||||
{(dropDownStates[id].show.value) && (
|
||||
{(showDropdown[id]) && (
|
||||
<div
|
||||
className="absolute z-10 mt-1 w-full bg-white dark:bg-gray-900 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black dark:ring-white ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
|
||||
{dropDownStates[id].options.value
|
||||
.filter(v => v.name.toLowerCase().includes(dropDownStates[id].new.value.toLowerCase()))
|
||||
{optionsDropdown[id]
|
||||
.filter(v => v.name.toLowerCase().includes(newDropdown[id].toLowerCase()))
|
||||
.map((v) => (
|
||||
<div
|
||||
key={v.id}
|
||||
@@ -169,7 +199,7 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
<input
|
||||
type="checkbox"
|
||||
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
|
||||
checked={dropDownStates[id].selected.value.has(v.id)}
|
||||
checked={selectedDropdown[id].has(v.id)}
|
||||
onChange={() => {
|
||||
}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
@@ -184,8 +214,8 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2 mt-3">
|
||||
{Array.from(dropDownStates[id].selected.value).map(vId => {
|
||||
const value = dropDownStates[id].options.value.find(i => i.id === vId);
|
||||
{Array.from(selectedDropdown[id]).map(vId => {
|
||||
const value = optionsDropdown[id].find(i => i.id === vId);
|
||||
if (!value) return null;
|
||||
return (
|
||||
<span
|
||||
@@ -223,50 +253,50 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
max: number;
|
||||
}
|
||||
|
||||
const rangeStates = Object.fromEntries(rangeConfig.map(({id}) => {
|
||||
const [minVal, setMinVal] = useState<number | undefined>(undefined);
|
||||
const [maxVal, setMaxVal] = useState<number | undefined>(undefined);
|
||||
return [id, {
|
||||
minVal,
|
||||
maxVal,
|
||||
setMinVal,
|
||||
setMaxVal,
|
||||
}];
|
||||
}))
|
||||
const [minRange, setMinRange] = useState(() =>
|
||||
Object.fromEntries(rangeConfig.map(({id}) => [id, undefined]))
|
||||
);
|
||||
const [maxRange, setMaxRange] = useState(() =>
|
||||
Object.fromEntries(rangeConfig.map(({id}) => [id, undefined]))
|
||||
);
|
||||
|
||||
function getSlider({id, name, min, max}: Range) {
|
||||
function getSlider({id, name, min, max}: Range, showSlider: boolean = true) {
|
||||
const minStr = 'min' + capitalize(id);
|
||||
const maxStr = 'max' + capitalize(id);
|
||||
const {minVal, maxVal, setMinVal, setMaxVal} = rangeStates[id];
|
||||
const minVal = minRange[id];
|
||||
const maxVal = maxRange[id];
|
||||
const setMinVal = (v: any) => setMinRange({...minRange, [id]: v});
|
||||
const setMaxVal = (v: any) => setMaxRange({...maxRange, [id]: v});
|
||||
return (
|
||||
<div key={id + '.div'}>
|
||||
|
||||
<div className="w-full px-2">
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-white mb-2">{name}</label>
|
||||
<Slider
|
||||
value={[minVal || min, maxVal || max]}
|
||||
onChange={(e, value) => {
|
||||
let [_min, _max] = value;
|
||||
setMinVal((_min || min) > min ? _min : undefined);
|
||||
setMaxVal((_max || max) < max ? _max : undefined);
|
||||
}}
|
||||
onChangeCommitted={(e, value) => {
|
||||
let [_min, _max] = value;
|
||||
onFilterChange(minStr, (_min || min) > min ? _min : undefined);
|
||||
onFilterChange(maxStr, (_max || max) < max ? _max : undefined);
|
||||
}}
|
||||
valueLabelDisplay="auto"
|
||||
min={min}
|
||||
max={max}
|
||||
sx={{
|
||||
color: '#3B82F6',
|
||||
'& .MuiSlider-valueLabel': {
|
||||
backgroundColor: '#3B82F6',
|
||||
color: '#fff',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{showSlider &&
|
||||
<div className="w-full px-2">
|
||||
<label className="block text-sm font-medium text-gray-700 dark:text-white mb-2">{name}</label>
|
||||
<Slider
|
||||
value={[minVal || min, maxVal || max]}
|
||||
onChange={(e, value) => {
|
||||
let [_min, _max] = value;
|
||||
setMinVal((_min || min) > min ? _min : undefined);
|
||||
setMaxVal((_max || max) < max ? _max : undefined);
|
||||
}}
|
||||
onChangeCommitted={(e, value) => {
|
||||
let [_min, _max] = value;
|
||||
onFilterChange(minStr, (_min || min) > min ? _min : undefined);
|
||||
onFilterChange(maxStr, (_max || max) < max ? _max : undefined);
|
||||
}}
|
||||
valueLabelDisplay="auto"
|
||||
min={min}
|
||||
max={max}
|
||||
sx={{
|
||||
color: '#3B82F6',
|
||||
'& .MuiSlider-valueLabel': {
|
||||
backgroundColor: '#3B82F6',
|
||||
color: '#fff',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
{/*<label className="block text-sm font-medium text-gray-700 dark:text-white mb-1">Min Age</label>*/}
|
||||
@@ -347,7 +377,7 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{getSlider(rangeConfig[0])}
|
||||
{getSlider(rangeConfig[0], false)}
|
||||
{dropdownConfig.map(({id, name}) => getDrowDown(id, name))}
|
||||
{getSlider(rangeConfig[1])}
|
||||
|
||||
@@ -376,13 +406,15 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
|
||||
<button
|
||||
onClick={() => {
|
||||
onReset();
|
||||
Object.values(dropDownStates).map((v) => {
|
||||
v.selected.set(new Set());
|
||||
});
|
||||
Object.values(rangeStates).map((v) => {
|
||||
v.setMaxVal(undefined);
|
||||
v.setMinVal(undefined);
|
||||
});
|
||||
setSelectedDropdown(() =>
|
||||
Object.fromEntries(dropdownConfig.map(({id}) => [id, new Set<string>()]))
|
||||
);
|
||||
setMinRange(() =>
|
||||
Object.fromEntries(rangeConfig.map(({id}) => [id, undefined]))
|
||||
);
|
||||
setMaxRange(() =>
|
||||
Object.fromEntries(rangeConfig.map(({id}) => [id, undefined]))
|
||||
);
|
||||
}}
|
||||
className="px-4 py-2 text-sm text-gray-600 dark:text-white hover:text-gray-800"
|
||||
>
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import {useParams} from "next/navigation";
|
||||
import {getProfile} from "@/lib/client/profile";
|
||||
import {Profile} from "@/lib/client/profile";
|
||||
|
||||
export const dynamic = "force-dynamic"; // This disables SSG and ISR
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function Post() {
|
||||
return (
|
||||
|
||||
<div className="min-h-screen py-12 px-4 sm:px-6 lg:px-8">
|
||||
{getProfile(`/api/profiles/${id}`)}
|
||||
{Profile(`/api/profiles/${id}`)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import Link from "next/link";
|
||||
import {useCallback, useEffect, useState} from "react";
|
||||
import LoadingSpinner from "@/lib/client/LoadingSpinner";
|
||||
import {ProfileData} from "@/lib/client/schema";
|
||||
import React, {useCallback, useEffect, useState} from "react";
|
||||
import {DropdownKey, ProfileData} from "@/lib/client/schema";
|
||||
import {dropdownConfig, ProfileFilters} from "./ProfileFilters";
|
||||
import Image from "next/image";
|
||||
import {useSession} from "next-auth/react";
|
||||
|
||||
// Disable static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -19,42 +20,83 @@ const initialState = {
|
||||
maxIntroversion: null as number | null,
|
||||
interests: [] as string[],
|
||||
coreValues: [] as string[],
|
||||
books: [] as string[],
|
||||
causeAreas: [] as string[],
|
||||
connections: [] as string[],
|
||||
searchQuery: '',
|
||||
forceRun: false,
|
||||
};
|
||||
|
||||
export type DropdownKey = 'interests' | 'causeAreas' | 'connections' | 'coreValues';
|
||||
export type RangeKey = 'age' | 'introversion';
|
||||
// type OtherKey = 'gender' | 'searchQuery';
|
||||
type ProfileFilters = {
|
||||
gender: string;
|
||||
minAge: number | null;
|
||||
maxAge: number | null;
|
||||
minIntroversion: number | null;
|
||||
maxIntroversion: number | null;
|
||||
interests: string[];
|
||||
books: string[];
|
||||
coreValues: string[];
|
||||
causeAreas: string[];
|
||||
connections: string[];
|
||||
searchQuery: string;
|
||||
forceRun: boolean;
|
||||
};
|
||||
|
||||
|
||||
export default function ProfilePage() {
|
||||
const {data: session} = useSession();
|
||||
const userId = session?.user?.id
|
||||
console.log("session:", userId)
|
||||
|
||||
// if (!userId) return <div/>
|
||||
|
||||
const [profiles, setProfiles] = useState<ProfileData[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState('');
|
||||
const [_, setShowFilters] = useState(true);
|
||||
const [totalUsers, setTotalUsers] = useState<number>(0);
|
||||
const [images, setImages] = useState<string[]>([])
|
||||
const [images, setImages] = useState<string[]>([]);
|
||||
|
||||
const [text, setText] = useState<string>('');
|
||||
|
||||
const [filters, setFilters] = useState(initialState);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const getCount = async () => {
|
||||
const countResponse = await fetch('/api/profiles/count');
|
||||
if (countResponse.ok) {
|
||||
const {count} = await countResponse.json();
|
||||
setTotalUsers(count);
|
||||
}
|
||||
};
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const newFilters = {...initialState};
|
||||
|
||||
getCount();
|
||||
}, []); // <- runs once after initial mount
|
||||
for (const [key, value] of params.entries()) {
|
||||
// Type guard to check if the key is a valid filter key
|
||||
if (key in newFilters) {
|
||||
const filterKey = key as keyof ProfileFilters;
|
||||
|
||||
if (key === 'searchQuery') {
|
||||
setText(value);
|
||||
newFilters[filterKey] = value as never;
|
||||
} else if (['interests', 'coreValues', 'causeAreas', 'connections'].includes(key)) {
|
||||
const arrayKey = filterKey as 'interests' | 'coreValues' | 'causeAreas' | 'connections';
|
||||
newFilters[arrayKey] = [...newFilters[arrayKey], value];
|
||||
} else {
|
||||
newFilters[filterKey] = value as never;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(newFilters);
|
||||
|
||||
setFilters(newFilters);
|
||||
}, []);
|
||||
|
||||
const [isStart, setIsStart] = useState(true);
|
||||
|
||||
const fetchProfiles = useCallback(async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const params = new URLSearchParams();
|
||||
let params = new URLSearchParams();
|
||||
if (isStart) {
|
||||
params = new URLSearchParams(window.location.search);
|
||||
setIsStart(false);
|
||||
}
|
||||
console.log('fetchProfiles', params);
|
||||
|
||||
if (filters.gender) params.append('gender', filters.gender);
|
||||
if (filters.minAge) params.append('minAge', filters.minAge.toString());
|
||||
@@ -70,9 +112,12 @@ export default function ProfilePage() {
|
||||
}
|
||||
}
|
||||
|
||||
if (filters.searchQuery) params.append('search', filters.searchQuery);
|
||||
if (filters.searchQuery) params.append('searchQuery', filters.searchQuery);
|
||||
|
||||
const response = await fetch(`/api/profiles?${params.toString()}`);
|
||||
let s = params.toString();
|
||||
window.history.pushState({}, '', `?${s}`);
|
||||
|
||||
const response = await fetch(`/api/profiles?${s}`);
|
||||
const data = await response.json();
|
||||
if (!response.ok) {
|
||||
console.log(response);
|
||||
@@ -111,7 +156,7 @@ export default function ProfilePage() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [filters]);
|
||||
}, [filters, images]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchProfiles();
|
||||
@@ -140,12 +185,13 @@ export default function ProfilePage() {
|
||||
const resetFilters = () => {
|
||||
setFilters(initialState);
|
||||
setText('');
|
||||
// window.history.pushState({}, '', '');
|
||||
};
|
||||
|
||||
const [text, setText] = useState<string>('');
|
||||
|
||||
const onFilterChange = handleFilterChange
|
||||
|
||||
if (!userId) return <div/>
|
||||
|
||||
return (
|
||||
<div className="min-h-screen px-4 sm:px-6 lg:px-8">
|
||||
<div className="w-full max-w-7xl mx-auto">
|
||||
@@ -165,7 +211,7 @@ export default function ProfilePage() {
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
placeholder={totalUsers > 0 ? `Search anything among the ${totalUsers} users...` : "Search anything..."}
|
||||
placeholder='Try "meditation", "hiking", or multiple words like "writing, nature"'
|
||||
className="w-full pl-10 pr-10 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
value={text}
|
||||
onChange={(e) => setText(e.target.value)}
|
||||
@@ -220,8 +266,11 @@ export default function ProfilePage() {
|
||||
{/* Profiles Grid */}
|
||||
<div className="flex-1">
|
||||
{loading ? (
|
||||
<div className="flex justify-center py-2">
|
||||
<LoadingSpinner/>
|
||||
<div className="flex justify-center py-8">
|
||||
<div className="flex justify-center min-h-screen py-8">
|
||||
<div data-testid="spinner"
|
||||
className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
||||
</div>
|
||||
</div>
|
||||
) : error ? (
|
||||
<div className="flex justify-center py-2">
|
||||
@@ -241,7 +290,7 @@ export default function ProfilePage() {
|
||||
<div className="p-4 h-full flex flex-col">
|
||||
<div className="flex items-center space-x-4">
|
||||
{renderImages && (<div className="flex-shrink-0">
|
||||
<img
|
||||
<Image
|
||||
className="h-16 w-16 rounded-full object-cover"
|
||||
src={images[idx]}
|
||||
alt={``}
|
||||
@@ -280,6 +329,18 @@ export default function ProfilePage() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-4 space-y-2 flex-grow">
|
||||
{user.profile.books?.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{user.profile.books.slice(0, 6).map(({value}) => (
|
||||
<span key={value?.id}
|
||||
className="inline-block text-xs px-2 py-1 bg-blue-50 text-blue-700 dark:text-white dark:bg-gray-700 rounded-full">
|
||||
{value?.name}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
@@ -294,7 +355,7 @@ export default function ProfilePage() {
|
||||
</svg>
|
||||
<h3 className="mt-2 text-sm font-medium">No profiles found</h3>
|
||||
<p className="mt-1 text-sm">
|
||||
Try adjusting your search or filter to find what you're looking for.
|
||||
{"Try adjusting your search or filter to find what you're looking for."}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -5,7 +5,7 @@ export default function SetupPage() {
|
||||
<div className="min-h-screen flex flex-col items-center justify-center p-8">
|
||||
<div className="max-w-3xl w-full rounded-lg shadow-lg p-8">
|
||||
<h1 className="text-3xl font-bold text-center mb-6 ">
|
||||
Welcome to BayesBond
|
||||
Welcome to Compass
|
||||
</h1>
|
||||
<p className="text-gray-600 mb-8 text-center">
|
||||
It looks like your database isn't set up yet. Follow the
|
||||
695
_old/components/onboarding.tsx
Normal file
695
_old/components/onboarding.tsx
Normal file
@@ -0,0 +1,695 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {SubmitHandler, useForm} from "react-hook-form";
|
||||
import {Gender} from "@prisma/client";
|
||||
import {useSession} from "next-auth/react";
|
||||
import {useRouter, useSearchParams} from "next/navigation";
|
||||
import Slider from "@mui/material/Slider";
|
||||
import {errorBlock} from "@/lib/client/errors";
|
||||
import {Item} from "@/lib/client/schema";
|
||||
import {fetchFeatures} from "@/lib/client/fetching";
|
||||
|
||||
|
||||
// Updated Question type to support more field types and conditions
|
||||
type Question = {
|
||||
name: string;
|
||||
label: string;
|
||||
type?: string;
|
||||
options?: string[];
|
||||
range?: string[];
|
||||
optional?: boolean;
|
||||
group?: boolean;
|
||||
fields?: Question[];
|
||||
condition?: (values: any) => boolean;
|
||||
};
|
||||
|
||||
|
||||
// Onboarding questions with conditional logic and grouping
|
||||
const questions: Question[] = [
|
||||
{
|
||||
name: "name",
|
||||
label: "Hi! What's your first name?",
|
||||
},
|
||||
{
|
||||
name: "location",
|
||||
label: "Where are you located?",
|
||||
group: true,
|
||||
fields: [
|
||||
{name: "country", label: "Country"},
|
||||
// { name: "zipCode", label: "Zip Code" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "gender",
|
||||
label: "What's your gender?",
|
||||
type: "select",
|
||||
options: ["Man", "Woman", "Other"],
|
||||
},
|
||||
// {
|
||||
// name: "genderOther",
|
||||
// label: "How do you identify?",
|
||||
// type: "select",
|
||||
// options: [
|
||||
// "Agender",
|
||||
// "Androgynous",
|
||||
// "Bigender",
|
||||
// "Cis Man",
|
||||
// "Cis Woman",
|
||||
// "Genderfluid",
|
||||
// "Genderqueer",
|
||||
// "Gender Nonconforming",
|
||||
// "Hijra",
|
||||
// "Intersex",
|
||||
// "Non-binary",
|
||||
// "Other gender",
|
||||
// "Pangender",
|
||||
// "Transfeminine",
|
||||
// "Transgender",
|
||||
// "Trans Man",
|
||||
// "Transmasculine",
|
||||
// "Transsexual",
|
||||
// "Trans Woman",
|
||||
// "Two Spirit"
|
||||
// ],
|
||||
// optional: true,
|
||||
// condition: (values) => values.gender === "See all",
|
||||
// },
|
||||
{
|
||||
name: "birthday",
|
||||
label: "When's your birthday?",
|
||||
type: "date",
|
||||
},
|
||||
{
|
||||
name: "connections",
|
||||
label: "What kind of relationship are you looking for?",
|
||||
type: "multiselect",
|
||||
options: [
|
||||
// "Debate Partner",
|
||||
"Friendship",
|
||||
"Short-term relationship",
|
||||
"Long-term Relationship",
|
||||
// "Other",
|
||||
],
|
||||
},
|
||||
// {
|
||||
// name: "kids",
|
||||
// label: "What are your ideal plans for children? (optional)",
|
||||
// type: "select",
|
||||
// options: [
|
||||
// "Skip",
|
||||
// "Want someday",
|
||||
// "Don't want",
|
||||
// "Have and want more",
|
||||
// "Have and don't want more",
|
||||
// "Not sure yet",
|
||||
// "Have kids",
|
||||
// "Open to kids",
|
||||
// ],
|
||||
// optional: true,
|
||||
// condition: (values) =>
|
||||
// ["Short-term dating", "Hookups", "Long-term dating"].includes(
|
||||
// values.relationshipType
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// name: "nonMonogamy",
|
||||
// label: "Non-Monogamy Options",
|
||||
// type: "select",
|
||||
// options: ["Monogamous", "Non-monogamous", "Open to either"],
|
||||
// condition: (values) =>
|
||||
// ["Short-term dating", "Hookups", "Long-term dating"].includes(
|
||||
// values.relationshipType
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// name: "photos",
|
||||
// label: "Add photos (optional)",
|
||||
// type: "file",
|
||||
// optional: true,
|
||||
// },
|
||||
{
|
||||
name: "description",
|
||||
label: "Tell us about yourself",
|
||||
type: "textarea",
|
||||
},
|
||||
{
|
||||
name: "contactInfo",
|
||||
label: "How can people contact you?",
|
||||
type: "textarea",
|
||||
},
|
||||
// Personality questions
|
||||
// {
|
||||
// name: "intenseOrCarefree",
|
||||
// label: "Which word describes you better?",
|
||||
// type: "select",
|
||||
// options: ["Intense", "Carefree"],
|
||||
// },
|
||||
// {
|
||||
// name: "religion",
|
||||
// label: "How important is religion/God in your life?",
|
||||
// type: "select",
|
||||
// options: [
|
||||
// "Not at all important",
|
||||
// "Slightly important",
|
||||
// "Moderately important",
|
||||
// "Very important",
|
||||
// "Extremely important"
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "politics",
|
||||
// label: "Which best describes your political beliefs?",
|
||||
// type: "select",
|
||||
// options: [
|
||||
// "Very liberal",
|
||||
// "Liberal",
|
||||
// "Moderate",
|
||||
// "Conservative",
|
||||
// "Very conservative",
|
||||
// "Other"
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
name: "introversion",
|
||||
label: "How would you describe your social style?",
|
||||
type: "slider",
|
||||
range: ['Introverted', 'Extroverted'],
|
||||
},
|
||||
// {
|
||||
// name: "introversion",
|
||||
// label: "How would you describe your social style?",
|
||||
// type: "select",
|
||||
// options: [
|
||||
// "Very introverted",
|
||||
// "Somewhat introverted",
|
||||
// "In the middle",
|
||||
// "Somewhat extroverted",
|
||||
// "Very extroverted"
|
||||
// ]
|
||||
// },
|
||||
];
|
||||
|
||||
|
||||
// List of valid countries (shortened for brevity, add more as needed)
|
||||
const countryOptions = [
|
||||
"United States", "Canada", "United Kingdom", "Australia", "Germany", "France", "India", "China", "Japan", "Brazil", "Mexico", "Italy", "Spain", "Netherlands", "Sweden", "Norway", "Denmark", "Finland", "Ireland", "New Zealand"
|
||||
// ...add more countries as needed
|
||||
];
|
||||
|
||||
|
||||
type FormValues = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
|
||||
// Helper to get visible questions based on current form values
|
||||
const getVisibleQuestions = (values: FormValues) =>
|
||||
questions.filter((q) => !q.condition || q.condition(values));
|
||||
|
||||
|
||||
const OnboardingForm: React.FC = () => {
|
||||
const searchParams = useSearchParams();
|
||||
const redirect = searchParams.get('redirect') || '/';
|
||||
const router = useRouter();
|
||||
const {update} = useSession();
|
||||
const [error, setError] = useState('');
|
||||
|
||||
const [step, setStep] = useState(0);
|
||||
const {register, handleSubmit, getValues, formState: {errors}} = useForm<FormValues>();
|
||||
const [formValues, setFormValues] = useState<FormValues>({});
|
||||
const [showGenderDefs, setShowGenderDefs] = useState(false);
|
||||
const [sliderValue, setSliderValue] = useState(0);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
|
||||
const featureNames = ['connections'];
|
||||
const [allFeatures, _setAllFeatures] = useState(() =>
|
||||
Object.fromEntries(featureNames.map((id) => [id, [] as Item[]]))
|
||||
);
|
||||
const setAllFeatures = (id: string, value: any) => {
|
||||
_setAllFeatures((prev) => ({...prev, [id]: value}));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log('Fetching features...');
|
||||
fetchFeatures(setAllFeatures);
|
||||
}, []);
|
||||
|
||||
|
||||
// Helper to calculate age
|
||||
const getAge = (month: string, day: string, year: string) => {
|
||||
if (!month || !day || !year) return null;
|
||||
const mm = parseInt(month, 10);
|
||||
const dd = parseInt(day, 10);
|
||||
const yyyy = parseInt(year, 10);
|
||||
if (isNaN(mm) || isNaN(dd) || isNaN(yyyy)) return null;
|
||||
const today = new Date();
|
||||
// const birthDate = new Date(yyyy, mm - 1, dd);
|
||||
let age = today.getFullYear() - yyyy;
|
||||
const m = today.getMonth() - (mm - 1);
|
||||
if (m < 0 || (m === 0 && today.getDate() < dd)) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
|
||||
const visibleQuestions = getVisibleQuestions(formValues);
|
||||
const isLastStep = step === visibleQuestions.length - 1;
|
||||
const currentQuestion = visibleQuestions[step];
|
||||
|
||||
const onSubmit: SubmitHandler<FormValues> = async () => {
|
||||
setIsSubmitting(true);
|
||||
setError('');
|
||||
const allValues = {...formValues, ...getValues()};
|
||||
console.log(JSON.stringify(allValues, null, 2));
|
||||
try {
|
||||
const data: any = {
|
||||
profile: {
|
||||
description: allValues.description,
|
||||
contactInfo: allValues.contactInfo,
|
||||
location: allValues.country,
|
||||
gender: allValues.gender as Gender,
|
||||
birthYear: parseInt(allValues.birthYear),
|
||||
introversion: 100 - allValues.introversion,
|
||||
// images: keys,
|
||||
},
|
||||
// ...(key && {image: key}),
|
||||
name: allValues.name,
|
||||
};
|
||||
for (const t of ['connections']) {
|
||||
if (!allValues[t]) continue;
|
||||
data[t] = Array.from(allValues[t]).map(name => ({
|
||||
id: allFeatures[t].find(i => i.name === name)?.id,
|
||||
name: name
|
||||
}));
|
||||
}
|
||||
console.log('data:', data)
|
||||
const response = await fetch('/api/user/update-profile', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
setError(errorData.error || 'Failed to update profile');
|
||||
return;
|
||||
}
|
||||
|
||||
await update();
|
||||
router.push(redirect);
|
||||
} catch (error) {
|
||||
console.error('Profile update error:', error);
|
||||
setError(error instanceof Error ? error.message : 'Failed to update profile');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const nextStep = () => {
|
||||
const values = getValues();
|
||||
setFormValues((prev) => ({...prev, ...values}));
|
||||
setStep((s) => Math.min(s + 1, visibleQuestions.length - 1));
|
||||
};
|
||||
const prevStep = () => setStep((s) => Math.max(s - 1, 0));
|
||||
|
||||
|
||||
// Questions where skip is allowed (from 'relationshipDuration' onward)
|
||||
const skipFrom = visibleQuestions.findIndex(q => q.name === 'relationshipDuration');
|
||||
const canSkip = step >= skipFrom && skipFrom !== -1;
|
||||
|
||||
return (
|
||||
<div>
|
||||
{error && errorBlock(error)}
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="mt-0 space-y-6 flex flex-col items-center">
|
||||
<div className="w-full flex flex-col items-center">
|
||||
<label className="px-4 text-center block w-full text-3xl font-bold mb-8 mt-0"
|
||||
style={{marginTop: '0rem'}}>{currentQuestion.label}</label>
|
||||
{currentQuestion.group && currentQuestion.fields ? (
|
||||
currentQuestion.fields.map((field) => {
|
||||
let fieldInput;
|
||||
if (field.name === "country") {
|
||||
fieldInput = (
|
||||
<>
|
||||
<input
|
||||
list="country-list"
|
||||
{...register(field.name, {
|
||||
required: !field.optional,
|
||||
// validate: value => countryOptions.includes(value) || "Please select a valid country." // Skip until all countries are listed
|
||||
})}
|
||||
defaultValue={getValues(field.name) || ""}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
className="text-center text-lg py-3 px-5 h-14 rounded-full border w-72"
|
||||
/>
|
||||
<datalist id="country-list">
|
||||
{countryOptions.map((country) => (
|
||||
<option key={country} value={country}/>
|
||||
))}
|
||||
</datalist>
|
||||
</>
|
||||
);
|
||||
} else if (field.name === "zipCode") {
|
||||
fieldInput = (
|
||||
<input
|
||||
type="text"
|
||||
{...register(field.name, {
|
||||
required: !field.optional,
|
||||
pattern: {value: /^\d{5}(-\d{4})?$/, message: "Please enter a valid US zip code."}
|
||||
})}
|
||||
defaultValue={getValues(field.name) || ""}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
className="text-center text-lg py-3 px-5 h-14 rounded-full border w-48"
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
fieldInput = (
|
||||
<input
|
||||
type={field.type || "text"}
|
||||
{...register(field.name, {required: !field.optional})}
|
||||
defaultValue={getValues(field.name) || ""}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
className="text-center text-lg py-3 px-5 h-14 rounded-full border"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div key={field.name} className="w-full flex flex-col items-center">
|
||||
<label className="text-center w-full">{field.label}</label>
|
||||
{fieldInput}
|
||||
{errors[field.name] && (
|
||||
<span className="block text-center mt-4">
|
||||
{(errors[field.name] as any)?.message || "This field is required"}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
) : currentQuestion.name === "birthday" ? (
|
||||
<div className="flex flex-row gap-2 justify-center items-center mt-2">
|
||||
<input
|
||||
type="text"
|
||||
maxLength={2}
|
||||
placeholder="MM"
|
||||
{...register("birthMonth", {required: true, pattern: /^(0?[1-9]|1[0-2])$/})}
|
||||
className="rounded-full border px-4 py-2 text-lg text-center w-20"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
maxLength={2}
|
||||
placeholder="DD"
|
||||
{...register("birthDay", {required: true, pattern: /^(0?[1-9]|[12][0-9]|3[01])$/})}
|
||||
className="rounded-full border px-4 py-2 text-lg text-center w-20"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
maxLength={4}
|
||||
placeholder="YYYY"
|
||||
{...register("birthYear", {required: true, pattern: /^[0-9]{4}$/})}
|
||||
className="rounded-full border px-4 py-2 text-lg text-center w-28"
|
||||
/>
|
||||
{(() => {
|
||||
const month = getValues("birthMonth");
|
||||
const day = getValues("birthDay");
|
||||
const year = getValues("birthYear");
|
||||
const age = getAge(month, day, year);
|
||||
if (age && age > 0 && age < 120) {
|
||||
return <span className="ml-4 text-lg font-semibold text-blue-700">You are {age}!</span>;
|
||||
}
|
||||
return null;
|
||||
})()}
|
||||
</div>
|
||||
) : (currentQuestion.type === "select" && currentQuestion.options && currentQuestion.options.length <= 6) ? (
|
||||
<div className="flex flex-wrap gap-2 mt-2 justify-center">
|
||||
{currentQuestion.options.map((opt) => (
|
||||
<button
|
||||
key={opt}
|
||||
type="button"
|
||||
className={`px-4 py-2 rounded-full border ${formValues[currentQuestion.name] === opt ? 'bg-red-700 text-white' : 'bg-gray-100 dark:bg-gray-700'} hover:bg-red-100 dark:hover:bg-red-800 transition-colors`}
|
||||
onClick={() => {
|
||||
setFormValues({...formValues, [currentQuestion.name]: opt});
|
||||
setStep((s) => Math.min(s + 1, visibleQuestions.length - 1));
|
||||
}}
|
||||
>
|
||||
{opt}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
) : (currentQuestion.type === "multiselect" && currentQuestion.options && currentQuestion.options.length <= 6) ? (
|
||||
<div className="flex flex-wrap gap-2 mt-2 justify-center">
|
||||
{currentQuestion.options.map((opt) => {
|
||||
const selected = (formValues[currentQuestion.name] || []).includes(opt);
|
||||
return (
|
||||
<button
|
||||
key={opt}
|
||||
type="button"
|
||||
className={`px-4 py-2 rounded-full border ${selected ? 'bg-red-700 text-white' : 'bg-gray-100 dark:bg-gray-700'} hover:bg-red-100 dark:hover:bg-red-800 transition-colors`}
|
||||
onClick={() => {
|
||||
const prev = formValues[currentQuestion.name] || [];
|
||||
const next = selected ? prev.filter((v: string) => v !== opt) : [...prev, opt];
|
||||
setFormValues({...formValues, [currentQuestion.name]: next});
|
||||
}}
|
||||
>
|
||||
{opt}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : currentQuestion.type === "slider" ? (
|
||||
<div className="flex items-center w-full max-w-xl gap-4">
|
||||
{currentQuestion.range && (
|
||||
<span className="min-w-[80px] text-gray-500 text-left">
|
||||
{currentQuestion.range[0]}
|
||||
</span>
|
||||
)}
|
||||
<Slider
|
||||
value={sliderValue}
|
||||
onChange={(e, value) => {
|
||||
setSliderValue(value);
|
||||
setFormValues({...formValues, [currentQuestion.name]: value});
|
||||
}}
|
||||
valueLabelDisplay="auto"
|
||||
min={0}
|
||||
max={100}
|
||||
sx={{
|
||||
color: '#3B82F6',
|
||||
'& .MuiSlider-valueLabel': {
|
||||
backgroundColor: '#3B82F6',
|
||||
color: '#fff',
|
||||
},
|
||||
}}
|
||||
className="flex-1"
|
||||
/>
|
||||
{currentQuestion.range && (
|
||||
<span className="min-w-[80px] text-gray-500 text-right">
|
||||
{currentQuestion.range[1]}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
) : currentQuestion.type === "select" ? (
|
||||
<select
|
||||
{...register(currentQuestion.name, {required: !currentQuestion.optional})}
|
||||
className="px-4 text-center text-lg py-3 h-14 rounded-full border"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<option value="">Select...</option>
|
||||
{currentQuestion.options?.map((opt) => (
|
||||
<option key={opt} value={opt}>
|
||||
{opt}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : currentQuestion.type === "multiselect" ? (
|
||||
<select
|
||||
multiple
|
||||
{...register(currentQuestion.name, {required: !currentQuestion.optional})}
|
||||
className="px-4 border rounded-full w-full min-h-[44px] focus:outline-none focus:ring-2 focus:ring-blue-400 text-center text-lg py-3 h-14"
|
||||
style={{minHeight: 44, boxSizing: 'border-box', cursor: 'pointer'}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{currentQuestion.options?.map((opt) => (
|
||||
<option key={opt} value={opt}>
|
||||
{opt}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
// For a more advanced UI, consider using react-select's MultiSelect component
|
||||
) : currentQuestion.type === "textarea" ? (
|
||||
<textarea
|
||||
{...register(currentQuestion.name, {required: !currentQuestion.optional})}
|
||||
defaultValue={getValues(currentQuestion.name) || ""}
|
||||
className="text-center text-lg py-3 px-5 h-28 rounded-lg border"
|
||||
/>
|
||||
) : currentQuestion.type === "file" ? (
|
||||
<input
|
||||
type="file"
|
||||
{...register(currentQuestion.name)}
|
||||
className="text-center text-lg py-3 px-5 h-14 rounded-full border"
|
||||
/>
|
||||
) : (currentQuestion.name === "genderOther") ? (
|
||||
<div className="flex flex-col items-center w-full">
|
||||
<select
|
||||
{...register(currentQuestion.name, {required: !currentQuestion.optional})}
|
||||
className="px-4 text-center text-lg py-3 h-14 rounded-full border w-full max-w-xl"
|
||||
>
|
||||
<option value="">Select...</option>
|
||||
{questions.find(q => q.name === "genderOther")?.options?.map((opt) => (
|
||||
<option key={opt} value={opt}>{opt}</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="mt-4 mb-2 px-4 py-2 rounded-full border bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors"
|
||||
onClick={() => setShowGenderDefs((v) => !v)}
|
||||
>
|
||||
{showGenderDefs ? "Hide definitions" : "Show definitions"}
|
||||
</button>
|
||||
{showGenderDefs && (
|
||||
<div
|
||||
className="mt-2 p-4 bg-white border rounded-lg shadow max-w-xl text-left text-sm overflow-y-auto max-h-96">
|
||||
<ul className="list-disc pl-5">
|
||||
<li><b>Agender</b>: Individuals with no gender identity or a neutral gender identity.</li>
|
||||
<li><b>Androgynous</b>: Individuals with both male & female presentation or nature.</li>
|
||||
<li><b>Bigender</b>: Individuals who identify as multiple genders/identities, either simultaneously
|
||||
or
|
||||
at different times.
|
||||
</li>
|
||||
<li><b>Cis Man</b>: Individuals whose gender identity matches the male sex they were assigned at
|
||||
birth.
|
||||
</li>
|
||||
<li><b>Cis Woman</b>: Individuals whose gender identity matches the female sex they were assigned at
|
||||
birth.
|
||||
</li>
|
||||
<li><b>Genderfluid</b>: Individuals who don’t have a fixed gender identity.</li>
|
||||
<li><b>Genderqueer</b>: Individuals who don’t identify with binary gender identity norms.</li>
|
||||
<li><b>Gender Nonconforming</b>: Individuals whose gender expressions don’t match masculine &
|
||||
feminine
|
||||
gender norms.
|
||||
</li>
|
||||
<li><b>Hijra</b>: A third gender identity, largely used in the Indian subcontinent, which typically
|
||||
reflects people who were assigned male at birth, with feminine gender expression, who identify as
|
||||
neither male nor female.
|
||||
</li>
|
||||
<li><b>Intersex</b>: Individuals born with a reproductive or sexual anatomy that doesn’t fit the
|
||||
typical definitions of female or male.
|
||||
</li>
|
||||
<li><b>Non-binary</b>: A term covering any gender identity or expression that doesn’t fit within the
|
||||
gender binary.
|
||||
</li>
|
||||
<li><b>Other gender</b>: Individuals who identify with any other gender expressions.</li>
|
||||
<li><b>Pangender</b>: Individuals who identify with a wide multiplicity of gender identities.</li>
|
||||
<li><b>Transfeminine</b>: Transgender individuals whose gender expression is more feminine
|
||||
presenting.
|
||||
</li>
|
||||
<li><b>Transgender</b>: Individuals whose gender identity differs from the sex they were assigned at
|
||||
birth.
|
||||
</li>
|
||||
<li><b>Trans Man</b>: Individuals who were assigned female at birth (AFAB) but have a male gender
|
||||
identity.
|
||||
</li>
|
||||
<li><b>Transmasculine</b>: Transgender individuals whose gender expression is more masculine
|
||||
presenting.
|
||||
</li>
|
||||
<li><b>Transsexual</b>: This term is sometimes used to describe trans individuals (who do not
|
||||
identify
|
||||
with the sex they were assigned at birth) who wish to align their gender identity & sex through
|
||||
medical intervention.
|
||||
</li>
|
||||
<li><b>Trans Woman</b>: Individuals who were assigned male at birth (AMAB) but have a female gender
|
||||
identity.
|
||||
</li>
|
||||
<li><b>Two Spirit</b>: Term largely used in Indigenous, Native American, and First Nation cultures,
|
||||
reflecting individuals who identify with multiple genders/gender identities that are neither male
|
||||
nor female.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<input
|
||||
type={currentQuestion.type || "text"}
|
||||
{...register(currentQuestion.name, {required: !currentQuestion.optional})}
|
||||
defaultValue={getValues(currentQuestion.name) || ""}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
nextStep();
|
||||
}
|
||||
}}
|
||||
className="text-center text-lg py-3 px-5 h-14 rounded-full border"
|
||||
/>
|
||||
)}
|
||||
{errors[currentQuestion.name] && <span className="block text-center mt-4">This field is required</span>}
|
||||
</div>
|
||||
<div className="flex flex-row justify-center items-center w-full mt-16 gap-4">
|
||||
{step > 0 && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={prevStep}
|
||||
className="rounded-full px-6 py-2 font-semibold bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors"
|
||||
>
|
||||
Back
|
||||
</button>
|
||||
)}
|
||||
{canSkip && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setFormValues((prev) => ({...prev, [currentQuestion.name]: ""}));
|
||||
setStep((s) => Math.min(s + 1, visibleQuestions.length - 1));
|
||||
}}
|
||||
className="rounded-full px-6 py-2 font-semibold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors"
|
||||
>
|
||||
Skip
|
||||
</button>
|
||||
)}
|
||||
{!isLastStep ? (
|
||||
<button
|
||||
key={currentQuestion.name}
|
||||
type="button"
|
||||
onClick={nextStep}
|
||||
className="rounded-full px-6 py-2 font-semibold bg-red-700 text-white hover:bg-red-800 transition-colors"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
type="submit"
|
||||
className="rounded-full px-6 py-2 font-semibold bg-red-700 text-white hover:bg-red-800 transition-colors"
|
||||
>
|
||||
{isSubmitting ? 'Saving...' : 'Submit'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export default OnboardingForm;
|
||||
@@ -3,7 +3,7 @@
|
||||
import {useEffect, useState} from 'react';
|
||||
import {Textarea} from '@/components/ui/textarea';
|
||||
import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue,} from '@/components/ui/select';
|
||||
import {cons} from "effect/List";
|
||||
// import {cons} from "effect/List";
|
||||
|
||||
type Prompt = {
|
||||
id: string;
|
||||
9
_old/lib/client/LoadingSpinner.tsx
Normal file
9
_old/lib/client/LoadingSpinner.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// For som unknown reasons, the spinner does not render when using LoadingSpinner(), so I copy paste the div block everywhere (TODO)
|
||||
|
||||
export default function LoadingSpinner() {
|
||||
return (
|
||||
<div className="flex justify-center min-h-screen py-8">
|
||||
<div data-testid="spinner" className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
2
_old/lib/client/constants.tsx
Normal file
2
_old/lib/client/constants.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
'use client';
|
||||
|
||||
20
_old/lib/client/errors.tsx
Normal file
20
_old/lib/client/errors.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from "react";
|
||||
|
||||
|
||||
export function errorBlock(error: string = '') {
|
||||
return <div className="bg-red-50 border-l-4 border-red-400 p-4">
|
||||
<div className="flex">
|
||||
<div className="flex-shrink-0">
|
||||
<svg className="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path fillRule="evenodd"
|
||||
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
|
||||
clipRule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-3">
|
||||
<p className="text-sm text-red-700">{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
15
_old/lib/client/fetching.ts
Normal file
15
_old/lib/client/fetching.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export async function fetchFeatures(setAllFeatures: any) {
|
||||
// results = []
|
||||
try {
|
||||
const res = await fetch('/api/interests');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
for (const [id, values] of Object.entries(data)) {
|
||||
setAllFeatures(id, values || []);
|
||||
// results.push({id, values});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching feature options:', error);
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,4 @@ export async function parseImage(img: string, setImage: any, batch = false) {
|
||||
setImage(url);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
import Image from "next/image";
|
||||
import {pStyle} from "@/lib/client/constants";
|
||||
import {useEffect, useState} from "react";
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {parseImage} from "@/lib/client/media";
|
||||
import LoadingSpinner from "@/lib/client/LoadingSpinner";
|
||||
import {useRouter} from 'next/navigation';
|
||||
|
||||
interface DeleteProfileButtonProps {
|
||||
@@ -59,7 +58,7 @@ export function DeleteProfileButton({profileId, onDelete}: DeleteProfileButtonPr
|
||||
);
|
||||
}
|
||||
|
||||
export function getProfile(url: string, header: any = null) {
|
||||
export function Profile(url: string, header: any = null) {
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [userData, setUserData] = useState<any>(null);
|
||||
@@ -95,10 +94,15 @@ export function getProfile(url: string, header: any = null) {
|
||||
}
|
||||
|
||||
fetchImage();
|
||||
}, []);
|
||||
}, [url]);
|
||||
|
||||
if (loading) {
|
||||
return <LoadingSpinner/>;
|
||||
return (
|
||||
<div className="flex justify-center min-h-screen py-8">
|
||||
<div data-testid="spinner"
|
||||
className="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (!userData) {
|
||||
@@ -111,19 +115,21 @@ export function getProfile(url: string, header: any = null) {
|
||||
|
||||
interface Tags {
|
||||
profileAttribute: string;
|
||||
attribute: string;
|
||||
attribute?: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const tagsConfig: Tags[] = [
|
||||
{profileAttribute: 'desiredConnections', attribute: 'connection', title: 'Desired Connections'},
|
||||
{profileAttribute: 'coreValues', attribute: 'value', title: 'Core Values'},
|
||||
{profileAttribute: 'intellectualInterests', attribute: 'interest', title: 'Core Interests'},
|
||||
{profileAttribute: 'causeAreas', attribute: 'causeArea', title: 'Cause Areas'},
|
||||
{profileAttribute: 'desiredConnections', attribute: 'connection', title: 'Connection Type'},
|
||||
{profileAttribute: 'coreValues', title: 'Values'},
|
||||
{profileAttribute: 'intellectualInterests', attribute: 'interest', title: 'Interests'},
|
||||
{profileAttribute: 'books', title: 'Works to Discuss'},
|
||||
// {profileAttribute: 'causeAreas', attribute: 'causeArea', title: 'Cause Areas'},
|
||||
]
|
||||
|
||||
function getTags({profileAttribute, attribute, title}: Tags) {
|
||||
function getTags({profileAttribute, attribute = 'value', title}: Tags) {
|
||||
const values = userData?.profile?.[profileAttribute];
|
||||
console.log('values', values);
|
||||
return <div key={profileAttribute + '.div'}>
|
||||
{values?.length > 0 && (
|
||||
<div className="mt-3"><
|
||||
@@ -161,18 +167,18 @@ export function getProfile(url: string, header: any = null) {
|
||||
<div className="flex-1">
|
||||
<div className="h-32 w-32 rounded-full border-4 border-white overflow-hidden ">
|
||||
<a href={image} target="_blank" rel="noopener noreferrer">
|
||||
<Image
|
||||
src={image}
|
||||
alt={userData.name || 'Profile picture'}
|
||||
className="h-full w-full object-cover"
|
||||
width={200}
|
||||
height={200}
|
||||
// onError={(e) => {
|
||||
// const target = e.target as HTMLImageElement;
|
||||
// target.onerror = null;
|
||||
// target.src = `https://ui-avatars.com/api/?name=${encodeURIComponent(profile.name || 'U')}&background=random`;
|
||||
// }}
|
||||
/>
|
||||
<Image
|
||||
src={image}
|
||||
alt={userData.name || 'Profile picture'}
|
||||
className="h-full w-full object-cover"
|
||||
width={200}
|
||||
height={200}
|
||||
// onError={(e) => {
|
||||
// const target = e.target as HTMLImageElement;
|
||||
// target.onerror = null;
|
||||
// target.src = `https://ui-avatars.com/api/?name=${encodeURIComponent(profile.name || 'U')}&background=random`;
|
||||
// }}
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -234,10 +240,21 @@ export function getProfile(url: string, header: any = null) {
|
||||
{
|
||||
userData?.profile?.introversion && (
|
||||
<div>
|
||||
<h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Introversion -
|
||||
Extroversion </h2>
|
||||
< p
|
||||
className="mt-1 capitalize"> {100 - userData.profile.introversion}% </p>
|
||||
<h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider">
|
||||
Social Style
|
||||
</h2>
|
||||
<div className="flex items-center w-full max-w-xl gap-4">
|
||||
<span className={pStyle}>Introverted</span>
|
||||
<div className="mt-1 flex items-center gap-4 w-32">
|
||||
<div className="w-full bg-gray-200 rounded-full h-2">
|
||||
<div
|
||||
className="bg-blue-600 h-2 rounded-full transition-all duration-200"
|
||||
style={{width: `${100 - userData.profile.introversion}%`}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span className={pStyle}>Extroverted</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -253,16 +270,15 @@ export function getProfile(url: string, header: any = null) {
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
userData?.profile?.conflictStyle && (
|
||||
<div>
|
||||
<h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Conflict
|
||||
Style </h2>
|
||||
< p
|
||||
className={pStyle}> {userData.profile.conflictStyle} </p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{/*{*/}
|
||||
{/* userData?.profile?.conflictStyle && (*/}
|
||||
{/* <div>*/}
|
||||
{/* <h2 className="text-sm font-medium text-gray-500 uppercase tracking-wider"> Conflict Style </h2>*/}
|
||||
{/* < p*/}
|
||||
{/* className={pStyle}> {userData.profile.conflictStyle} </p>*/}
|
||||
{/* </div>*/}
|
||||
{/* )*/}
|
||||
{/*}*/}
|
||||
|
||||
{tagsConfig.map((tag: any) => getTags(tag))}
|
||||
|
||||
@@ -16,9 +16,20 @@ export interface ProfileData {
|
||||
contactInfo: string;
|
||||
intellectualInterests: { interest?: { name?: string, id?: string } }[];
|
||||
coreValues: { value?: { name?: string, id?: string } }[];
|
||||
books: { value?: { name?: string, id?: string } }[];
|
||||
causeAreas: { causeArea?: { name?: string, id?: string } }[];
|
||||
desiredConnections: { connection?: { name?: string, id?: string } }[];
|
||||
promptAnswers: { prompt?: string; answer?: string, id?: string }[];
|
||||
images: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export type DropdownKey = 'interests' | 'causeAreas' | 'connections' | 'coreValues' | 'books';
|
||||
export type RangeKey = 'age' | 'introversion';
|
||||
|
||||
// type OtherKey = 'gender' | 'searchQuery';
|
||||
|
||||
export interface Item {
|
||||
id: DropdownKey;
|
||||
name: string;
|
||||
}
|
||||
@@ -29,6 +29,7 @@ export async function retrieveUser(id: string) {
|
||||
intellectualInterests: {include: {interest: true}},
|
||||
causeAreas: {include: {causeArea: true}},
|
||||
coreValues: {include: {value: true}},
|
||||
books: {include: {value: true}},
|
||||
desiredConnections: {include: {connection: true}},
|
||||
promptAnswers: true,
|
||||
},
|
||||
@@ -6,5 +6,5 @@ import 'server-only';
|
||||
//
|
||||
// export const supabase = createClient(
|
||||
// process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
// process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
||||
// process.env.SUPABASE_KEY!
|
||||
// );
|
||||
78
_old/package.json
Normal file
78
_old/package.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "Compass",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"postinstall": "npx prisma generate --no-engine",
|
||||
"build": "npx prisma migrate deploy && next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"test:update": "jest --updateSnapshot"
|
||||
},
|
||||
"dependencies": {
|
||||
"@auth/prisma-adapter": "^2.10.0",
|
||||
"@aws-sdk/client-s3": "^3.855.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.855.0",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@heroicons/react": "^2.2.0",
|
||||
"@mui/material": "^7.2.0",
|
||||
"@next-auth/prisma-adapter": "^1.0.7",
|
||||
"@playwright/test": "^1.54.2",
|
||||
"@prisma/client": "^6.12.0",
|
||||
"@prisma/extension-accelerate": "^2.0.2",
|
||||
"@radix-ui/react-select": "^2.2.5",
|
||||
"@react-email/render": "^1.1.3",
|
||||
"@supabase/supabase-js": "^2.53.0",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@upstash/ratelimit": "^2.0.6",
|
||||
"@upstash/redis": "^1.35.3",
|
||||
"bcryptjs": "^3.0.2",
|
||||
"browser-image-compression": "^2.0.2",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"express-rate-limit": "^8.0.1",
|
||||
"heroicons": "^2.2.0",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"lucide-react": "^0.503.0",
|
||||
"next": "^15.4.4",
|
||||
"next-auth": "^4.24.11",
|
||||
"next-rate-limit": "^0.0.3",
|
||||
"next-themes": "^0.4.6",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-hook-form": "^7.62.0",
|
||||
"react-icons": "^5.5.0",
|
||||
"resend": "^4.7.0",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"use-debounce": "^10.0.5",
|
||||
"uuid": "^11.1.0",
|
||||
"wait-on": "^8.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@testing-library/jest-dom": "^6.6.4",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.1.7",
|
||||
"jest": "^30.0.5",
|
||||
"jest-environment-jsdom": "^30.0.5",
|
||||
"postcss": "^8",
|
||||
"prisma": "^6.13.0",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"prisma": {
|
||||
"seed": "npx tsx prisma/seed.ts"
|
||||
}
|
||||
}
|
||||
17
_old/prisma.config.ts
Normal file
17
_old/prisma.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import path from "node:path";
|
||||
|
||||
import 'dotenv/config'; // <-- This loads your .env file before Prisma runs
|
||||
import type {PrismaConfig} from "prisma";
|
||||
|
||||
export default {
|
||||
schema: path.join("prisma", "schema.prisma"),
|
||||
migrations: {
|
||||
path: path.join("prisma", "migrations"),
|
||||
},
|
||||
// views: {
|
||||
// path: path.join("prisma", "views"),
|
||||
// },
|
||||
// typedSql: {
|
||||
// path: path.join("prisma", "queries"),
|
||||
// }
|
||||
} satisfies PrismaConfig;
|
||||
245
_old/prisma/migrations/20250803103956_init/migration.sql
Normal file
245
_old/prisma/migrations/20250803103956_init/migration.sql
Normal file
@@ -0,0 +1,245 @@
|
||||
-- CreateSchema
|
||||
CREATE SCHEMA IF NOT EXISTS "public";
|
||||
|
||||
-- CreateEnum
|
||||
CREATE TYPE "public"."Gender" AS ENUM ('Male', 'Female', 'Other');
|
||||
|
||||
-- CreateEnum
|
||||
CREATE TYPE "public"."PersonalityType" AS ENUM ('Introvert', 'Extrovert', 'Ambivert');
|
||||
|
||||
-- CreateEnum
|
||||
CREATE TYPE "public"."ConflictStyle" AS ENUM ('Competing', 'Avoidant', 'Compromising', 'Accommodating', 'Collaborating');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."User" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT,
|
||||
"email" TEXT,
|
||||
"password" TEXT,
|
||||
"emailVerified" TIMESTAMP(3),
|
||||
"verificationToken" TEXT,
|
||||
"verificationTokenExpires" TIMESTAMP(3),
|
||||
"image" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Profile" (
|
||||
"id" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"location" TEXT,
|
||||
"description" TEXT,
|
||||
"contactInfo" TEXT,
|
||||
"birthYear" INTEGER,
|
||||
"occupation" TEXT,
|
||||
"gender" "public"."Gender",
|
||||
"personalityType" "public"."PersonalityType",
|
||||
"introversion" INTEGER,
|
||||
"conflictStyle" "public"."ConflictStyle",
|
||||
"images" TEXT[],
|
||||
|
||||
CONSTRAINT "Profile_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Connection" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Connection_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Interest" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Interest_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Value" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Value_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."CauseArea" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "CauseArea_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."ProfileConnection" (
|
||||
"profileId" TEXT NOT NULL,
|
||||
"connectionId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ProfileConnection_pkey" PRIMARY KEY ("profileId","connectionId")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."ProfileInterest" (
|
||||
"profileId" TEXT NOT NULL,
|
||||
"interestId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ProfileInterest_pkey" PRIMARY KEY ("profileId","interestId")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."ProfileValue" (
|
||||
"profileId" TEXT NOT NULL,
|
||||
"valueId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ProfileValue_pkey" PRIMARY KEY ("profileId","valueId")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."ProfileCauseArea" (
|
||||
"profileId" TEXT NOT NULL,
|
||||
"causeAreaId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ProfileCauseArea_pkey" PRIMARY KEY ("profileId","causeAreaId")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."PromptAnswer" (
|
||||
"id" TEXT NOT NULL,
|
||||
"profileId" TEXT NOT NULL,
|
||||
"prompt" TEXT NOT NULL,
|
||||
"answer" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "PromptAnswer_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Account" (
|
||||
"id" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"provider" TEXT NOT NULL,
|
||||
"providerAccountId" TEXT NOT NULL,
|
||||
"refresh_token" TEXT,
|
||||
"access_token" TEXT,
|
||||
"expires_at" INTEGER,
|
||||
"token_type" TEXT,
|
||||
"scope" TEXT,
|
||||
"id_token" TEXT,
|
||||
"session_state" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Session" (
|
||||
"id" TEXT NOT NULL,
|
||||
"sessionToken" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"expires" TIMESTAMP(3) NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."VerificationToken" (
|
||||
"identifier" TEXT NOT NULL,
|
||||
"token" TEXT NOT NULL,
|
||||
"expires" TIMESTAMP(3) NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Authenticator" (
|
||||
"credentialID" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"providerAccountId" TEXT NOT NULL,
|
||||
"credentialPublicKey" TEXT NOT NULL,
|
||||
"counter" INTEGER NOT NULL,
|
||||
"credentialDeviceType" TEXT NOT NULL,
|
||||
"credentialBackedUp" BOOLEAN NOT NULL,
|
||||
"transports" TEXT,
|
||||
|
||||
CONSTRAINT "Authenticator_pkey" PRIMARY KEY ("userId","credentialID")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "public"."User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_verificationToken_key" ON "public"."User"("verificationToken");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Profile_userId_key" ON "public"."Profile"("userId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Connection_name_key" ON "public"."Connection"("name");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Interest_name_key" ON "public"."Interest"("name");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Value_name_key" ON "public"."Value"("name");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "CauseArea_name_key" ON "public"."CauseArea"("name");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "public"."Account"("provider", "providerAccountId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Session_sessionToken_key" ON "public"."Session"("sessionToken");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "public"."VerificationToken"("identifier", "token");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Authenticator_credentialID_key" ON "public"."Authenticator"("credentialID");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."Profile" ADD CONSTRAINT "Profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileConnection" ADD CONSTRAINT "ProfileConnection_connectionId_fkey" FOREIGN KEY ("connectionId") REFERENCES "public"."Connection"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileConnection" ADD CONSTRAINT "ProfileConnection_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileInterest" ADD CONSTRAINT "ProfileInterest_interestId_fkey" FOREIGN KEY ("interestId") REFERENCES "public"."Interest"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileInterest" ADD CONSTRAINT "ProfileInterest_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileValue" ADD CONSTRAINT "ProfileValue_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileValue" ADD CONSTRAINT "ProfileValue_valueId_fkey" FOREIGN KEY ("valueId") REFERENCES "public"."Value"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileCauseArea" ADD CONSTRAINT "ProfileCauseArea_causeAreaId_fkey" FOREIGN KEY ("causeAreaId") REFERENCES "public"."CauseArea"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileCauseArea" ADD CONSTRAINT "ProfileCauseArea_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."PromptAnswer" ADD CONSTRAINT "PromptAnswer_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."Authenticator" ADD CONSTRAINT "Authenticator_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The values [Male,Female] on the enum `Gender` will be removed. If these variants are still used in the database, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "public"."Gender_new" AS ENUM ('Man', 'Woman', 'Other');
|
||||
ALTER TABLE "public"."Profile" ALTER COLUMN "gender" TYPE "public"."Gender_new" USING ("gender"::text::"public"."Gender_new");
|
||||
ALTER TYPE "public"."Gender" RENAME TO "Gender_old";
|
||||
ALTER TYPE "public"."Gender_new" RENAME TO "Gender";
|
||||
DROP TYPE "public"."Gender_old";
|
||||
COMMIT;
|
||||
@@ -0,0 +1,24 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."Book" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Book_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "public"."ProfileBook" (
|
||||
"profileId" TEXT NOT NULL,
|
||||
"valueId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ProfileBook_pkey" PRIMARY KEY ("profileId","valueId")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Book_name_key" ON "public"."Book"("name");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileBook" ADD CONSTRAINT "ProfileBook_valueId_fkey" FOREIGN KEY ("valueId") REFERENCES "public"."Book"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "public"."ProfileBook" ADD CONSTRAINT "ProfileBook_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES "public"."Profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
3
_old/prisma/migrations/migration_lock.toml
Normal file
3
_old/prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "postgresql"
|
||||
202
_old/prisma/schema.prisma
Normal file
202
_old/prisma/schema.prisma
Normal file
@@ -0,0 +1,202 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
name String?
|
||||
email String? @unique
|
||||
password String?
|
||||
emailVerified DateTime?
|
||||
verificationToken String? @unique
|
||||
verificationTokenExpires DateTime?
|
||||
image String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
accounts Account[]
|
||||
Authenticator Authenticator[]
|
||||
profile Profile?
|
||||
sessions Session[]
|
||||
}
|
||||
|
||||
model Profile {
|
||||
id String @id @default(cuid())
|
||||
userId String @unique
|
||||
location String?
|
||||
description String?
|
||||
contactInfo String?
|
||||
birthYear Int?
|
||||
occupation String?
|
||||
gender Gender?
|
||||
personalityType PersonalityType?
|
||||
introversion Int?
|
||||
conflictStyle ConflictStyle?
|
||||
images String[]
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
causeAreas ProfileCauseArea[]
|
||||
desiredConnections ProfileConnection[]
|
||||
intellectualInterests ProfileInterest[]
|
||||
coreValues ProfileValue[]
|
||||
books ProfileBook[]
|
||||
promptAnswers PromptAnswer[]
|
||||
}
|
||||
|
||||
model Connection {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
users ProfileConnection[]
|
||||
}
|
||||
|
||||
model Interest {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
users ProfileInterest[]
|
||||
}
|
||||
|
||||
model Value {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
users ProfileValue[]
|
||||
}
|
||||
|
||||
model Book {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
users ProfileBook[]
|
||||
}
|
||||
|
||||
model CauseArea {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
users ProfileCauseArea[]
|
||||
}
|
||||
|
||||
model ProfileConnection {
|
||||
profileId String
|
||||
connectionId String
|
||||
connection Connection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([profileId, connectionId])
|
||||
}
|
||||
|
||||
model ProfileInterest {
|
||||
profileId String
|
||||
interestId String
|
||||
interest Interest @relation(fields: [interestId], references: [id], onDelete: Cascade)
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([profileId, interestId])
|
||||
}
|
||||
|
||||
model ProfileValue {
|
||||
profileId String
|
||||
valueId String
|
||||
value Value @relation(fields: [valueId], references: [id], onDelete: Cascade)
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([profileId, valueId])
|
||||
}
|
||||
|
||||
model ProfileBook {
|
||||
profileId String
|
||||
valueId String
|
||||
value Book @relation(fields: [valueId], references: [id], onDelete: Cascade)
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([profileId, valueId])
|
||||
}
|
||||
|
||||
model ProfileCauseArea {
|
||||
profileId String
|
||||
causeAreaId String
|
||||
causeArea CauseArea @relation(fields: [causeAreaId], references: [id], onDelete: Cascade)
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([profileId, causeAreaId])
|
||||
}
|
||||
|
||||
model PromptAnswer {
|
||||
id String @id @default(cuid())
|
||||
profileId String
|
||||
prompt String
|
||||
answer String
|
||||
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
type String
|
||||
provider String
|
||||
providerAccountId String
|
||||
refresh_token String?
|
||||
access_token String?
|
||||
expires_at Int?
|
||||
token_type String?
|
||||
scope String?
|
||||
id_token String?
|
||||
session_state String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([provider, providerAccountId])
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(cuid())
|
||||
sessionToken String @unique
|
||||
userId String
|
||||
expires DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model VerificationToken {
|
||||
identifier String
|
||||
token String
|
||||
expires DateTime
|
||||
|
||||
@@unique([identifier, token])
|
||||
}
|
||||
|
||||
model Authenticator {
|
||||
credentialID String @unique
|
||||
userId String
|
||||
providerAccountId String
|
||||
credentialPublicKey String
|
||||
counter Int
|
||||
credentialDeviceType String
|
||||
credentialBackedUp Boolean
|
||||
transports String?
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([userId, credentialID])
|
||||
}
|
||||
|
||||
enum Gender {
|
||||
Man
|
||||
Woman
|
||||
Other
|
||||
}
|
||||
|
||||
enum PersonalityType {
|
||||
Introvert
|
||||
Extrovert
|
||||
Ambivert
|
||||
}
|
||||
|
||||
enum ConflictStyle {
|
||||
Competing
|
||||
Avoidant
|
||||
Compromising
|
||||
Accommodating
|
||||
Collaborating
|
||||
}
|
||||
@@ -16,6 +16,7 @@ async function main() {
|
||||
bio: string;
|
||||
interests: string[];
|
||||
values: string[];
|
||||
books: string[];
|
||||
};
|
||||
|
||||
const profiles: ProfileBio[] = [
|
||||
@@ -27,7 +28,8 @@ async function main() {
|
||||
location: "Berlin, Germany",
|
||||
bio: "I’m passionate about understanding the limits and mechanics of human reasoning. I spend weekends dissecting papers on decision theory and evenings debating moral uncertainty. If you know your way around LessWrong and thought experiments, we’ll get along.",
|
||||
interests: ["Bayesian epistemology", "AI alignment", "Effective Altruism", "Meditation", "Game Theory"],
|
||||
values: ["Intellectualism", "Rationality", "Autonomy"]
|
||||
values: ["Intellectualism", "Rationality", "Autonomy"],
|
||||
books: ["Daniel Kahneman - Thinking, Fast and Slow"]
|
||||
},
|
||||
{
|
||||
name: "Marcus",
|
||||
@@ -37,7 +39,8 @@ async function main() {
|
||||
location: "San Francisco, USA",
|
||||
bio: "Practicing instrumental rationality one well-calibrated belief at a time. Stoicism and startup life have taught me a lot about tradeoffs. Looking for someone who can argue in good faith and loves truth-seeking as much as I do.",
|
||||
interests: ["Stoicism", "Predictive processing", "Rational fiction", "Startups", "Causal inference"],
|
||||
values: ["Diplomacy", "Rationality", "Community"]
|
||||
values: ["Diplomacy", "Rationality", "Community"],
|
||||
books: ["Daniel Kahneman - Thinking, Fast and Slow"]
|
||||
},
|
||||
{
|
||||
name: "Aya",
|
||||
@@ -47,7 +50,8 @@ async function main() {
|
||||
location: "Oxford, UK",
|
||||
bio: "My research focuses on metaethics and formal logic, but my heart belongs to moral philosophy. I think a lot about personhood, consciousness, and the ethics of future civilizations. Let's talk about Rawls or Parfit over tea.",
|
||||
interests: ["Metaethics", "Consciousness", "Transhumanism", "Moral realism", "Formal logic"],
|
||||
values: ["Radical Honesty", "Structure", "Sufficiency"]
|
||||
values: ["Radical Honesty", "Structure", "Sufficiency"],
|
||||
books: ["Daniel Kahneman - Thinking, Fast and Slow"]
|
||||
},
|
||||
{
|
||||
name: "David",
|
||||
@@ -57,7 +61,8 @@ async function main() {
|
||||
location: "Toronto, Canada",
|
||||
bio: "Former humanities major turned quant. Still fascinated by existential risk, the philosophy of science, and how to stay sane in an uncertain world. I'm here to meet people who think weird is a compliment.",
|
||||
interests: ["Probability theory", "Longtermism", "Epistemic humility", "Futurology", "Meditation"],
|
||||
values: ["Conservatism", "Ambition", "Idealism"]
|
||||
values: ["Conservatism", "Ambition", "Idealism"],
|
||||
books: ["Daniel Kahneman - Thinking, Fast and Slow"]
|
||||
},
|
||||
{
|
||||
name: "Mei",
|
||||
@@ -67,12 +72,14 @@ async function main() {
|
||||
location: "Singapore",
|
||||
bio: "Writing essays on intellectual humility, the philosophy of language, and how thinking styles shape our lives. I appreciate calm reasoning, rigorous curiosity, and the beauty of well-defined concepts. Let's try to model each other's minds.",
|
||||
interests: ["Philosophy of language", "Bayesian reasoning", "Writing", "Dialectics", "Systems thinking"],
|
||||
values: ["Emotional Merging", "Sufficiency", "Pragmatism"]
|
||||
values: ["Emotional Merging", "Sufficiency", "Pragmatism"],
|
||||
books: ["Daniel Kahneman - Thinking, Fast and Slow"]
|
||||
}
|
||||
];
|
||||
|
||||
const interests = new Set<string>();
|
||||
const values = new Set<string>();
|
||||
const books = new Set<string>();
|
||||
|
||||
profiles.forEach(profile => {
|
||||
profile.interests.forEach(v => interests.add(v));
|
||||
@@ -82,8 +89,13 @@ async function main() {
|
||||
profile.values.forEach(v => values.add(v));
|
||||
});
|
||||
|
||||
profiles.forEach(profile => {
|
||||
profile.books.forEach(v => books.add(v));
|
||||
});
|
||||
|
||||
console.log('Interests:', [...interests]);
|
||||
console.log('Values:', [...values]);
|
||||
console.log('Books:', [...books]);
|
||||
|
||||
await prisma.interest.createMany({
|
||||
data: [...interests].map(v => ({name: v})),
|
||||
@@ -95,6 +107,11 @@ async function main() {
|
||||
skipDuplicates: true,
|
||||
});
|
||||
|
||||
await prisma.book.createMany({
|
||||
data: [...books].map(v => ({name: v})),
|
||||
skipDuplicates: true,
|
||||
});
|
||||
|
||||
await prisma.causeArea.createMany({
|
||||
data: [
|
||||
{name: 'Climate Change'},
|
||||
@@ -106,9 +123,10 @@ async function main() {
|
||||
|
||||
await prisma.connection.createMany({
|
||||
data: [
|
||||
{name: 'Debate Partner'},
|
||||
// {name: 'Debate Partner'},
|
||||
{name: 'Friendship'},
|
||||
{name: 'Relationship'},
|
||||
{name: 'Short-term relationship'},
|
||||
{name: 'Long-term relationship'},
|
||||
],
|
||||
skipDuplicates: true,
|
||||
});
|
||||
@@ -117,6 +135,7 @@ async function main() {
|
||||
// Get actual Interest & CauseArea objects
|
||||
const allInterests = await prisma.interest.findMany();
|
||||
const allValues = await prisma.value.findMany();
|
||||
const allBooks = await prisma.book.findMany();
|
||||
const allCauseAreas = await prisma.causeArea.findMany();
|
||||
const allConnections = await prisma.connection.findMany();
|
||||
|
||||
@@ -125,7 +144,7 @@ async function main() {
|
||||
const profile = profiles[i % profiles.length];
|
||||
const user = await prisma.user.create({
|
||||
data: {
|
||||
email: `user${i + 1}@bayesbond.com`,
|
||||
email: `user${i + 1}@Compassmeet.com`,
|
||||
name: profile.name,
|
||||
image: 'profile-pictures/57a821c0-cda0-4797-8654-f54f26fed414.jpg',
|
||||
profile: {
|
||||
@@ -134,10 +153,10 @@ async function main() {
|
||||
birthYear: 2025 - profile.age,
|
||||
introversion: profile.introversion,
|
||||
description: `[Dummy profile for demo purposes]\n${profile.bio}`,
|
||||
gender: i % 2 === 0 ? 'Male' : 'Female',
|
||||
gender: i % 2 === 0 ? 'Man' : 'Woman',
|
||||
personalityType: i % 3 === 0 ? 'Extrovert' : 'Introvert',
|
||||
conflictStyle: 'Avoidant',
|
||||
contactInfo: `Email: user${i}@bayesbond.com\nPhone: +1 (123) 456-7890`,
|
||||
contactInfo: `Email: user${i}@Compassmeet.com\nPhone: +1 (123) 456-7890`,
|
||||
occupation: profile.occupation,
|
||||
desiredConnections: {
|
||||
create: [
|
||||
@@ -154,6 +173,11 @@ async function main() {
|
||||
.filter(e => (new Set(profile.values)).has(e.name))
|
||||
.map(e => ({valueId: e.id}))
|
||||
},
|
||||
books: {
|
||||
create: allBooks
|
||||
.filter(e => (new Set(profile.books)).has(e.name))
|
||||
.map(e => ({valueId: e.id}))
|
||||
},
|
||||
causeAreas: {
|
||||
create: [
|
||||
{causeAreaId: allCauseAreas[i % allCauseAreas.length].id},
|
||||
@@ -17,6 +17,9 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
corePlugins: {
|
||||
animation: true,
|
||||
},
|
||||
darkMode: 'class', // required for next-themes
|
||||
plugins: [ ],
|
||||
} satisfies Config;
|
||||
@@ -24,5 +24,8 @@
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"],
|
||||
"types": ["jest", "@testing-library/jest-dom"],
|
||||
"typeRoots": ["./node_modules/@types", "./types"],
|
||||
"jsx": "react-jsx",
|
||||
"sourceMap": true
|
||||
}
|
||||
0
android/.aiexclude
Normal file
0
android/.aiexclude
Normal file
102
android/.gitignore
vendored
Normal file
102
android/.gitignore
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
|
||||
|
||||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
||||
# release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
# Android Studio 3 in .gitignore file.
|
||||
.idea/caches
|
||||
.idea/modules.xml
|
||||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
||||
.idea/navEditor.xml
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
#*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
# google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
# lint/reports/
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
# Cordova plugins for Capacitor
|
||||
capacitor-cordova-android-plugins
|
||||
|
||||
# Copied web assets
|
||||
app/src/main/assets/public
|
||||
|
||||
# Generated Config files
|
||||
app/src/main/assets/capacitor.config.json
|
||||
app/src/main/assets/capacitor.plugins.json
|
||||
app/src/main/res/xml/config.xml
|
||||
/app/release/
|
||||
364
android/README.md
Normal file
364
android/README.md
Normal file
@@ -0,0 +1,364 @@
|
||||
# Compass Android WebView App
|
||||
|
||||
This folder contains the source code for the Android application of Compass.
|
||||
A hybrid mobile app built with **Next.js (TypeScript)** frontend, **Firebase backend**, and wrapped as a **Capacitor WebView** for Android. In the future it may contain native code as well.
|
||||
|
||||
This document describes how to:
|
||||
1. Build and run the web frontend and backend locally
|
||||
2. Sync and build the Android WebView wrapper
|
||||
3. Debug, sign, and publish the APK
|
||||
4. Enable Google Sign-In and push notifications
|
||||
|
||||
---
|
||||
|
||||
## 1. Project Overview
|
||||
|
||||
The app is a Capacitor Android project that loads the local Next.js assests inside a WebView.
|
||||
|
||||
During development, it can instead load the local frontend (`http://10.0.2.2:3000`) and backend (`http://10.0.2.2:8088`).
|
||||
|
||||
Firebase handles authentication and push notifications.
|
||||
Google Sign-In is supported natively in the WebView via the Capacitor Social Login plugin.
|
||||
|
||||
Project Structure
|
||||
|
||||
- `app/src/main/java/com/compass/app`: Contains the Java/Kotlin source code for the Android application.
|
||||
- `app/src/main/res`: Contains the resources for the application, such as layouts, strings, and images.
|
||||
- `app/build.gradle`: The Gradle build file for the Android application module.
|
||||
- `build.gradle`: The top-level Gradle build file for the project.
|
||||
- `AndroidManifest.xml`: The manifest file that describes essential information about the application.
|
||||
|
||||
### **Why Local Is the Default**
|
||||
- **Performance:** Local assets load instantly, without network latency.
|
||||
- **Reliability:** Works offline or in poor connectivity environments.
|
||||
- **App Store policy compliance:** Apple and Google generally prefer that the main experience doesn’t depend on a remote site (for security, review, and performance reasons).
|
||||
- **Version consistency:** The web bundle is versioned with the app, ensuring no breaking updates outside your control.
|
||||
|
||||
When Remote (No Local Assets) Is sometimes Used
|
||||
Loading from a **remote URL** (e.g. `https://compassmeet.com`) is **less common**, but seen in a few cases:
|
||||
- **Internal enterprise apps** where the WebView just wraps an existing web portal.
|
||||
- **Dynamic content** or **frequent updates** where pushing a new web build every time through app stores would be too slow.
|
||||
- To leverage the low latency of ISR and SSR.
|
||||
However, this approach requires:
|
||||
- Careful handling of **CORS**, **SSL**, and **login/session** persistence.
|
||||
- Compliance with **Google Play policies** (they may reject apps that are “just a webview of a website” unless there’s meaningful native integration).
|
||||
|
||||
**A middle ground we use:**
|
||||
- The app ships with **local assets** for core functionality.
|
||||
- The app **fetches remote content or updates** (e.g., via Capacitor Live Updates, Ionic Appflow).
|
||||
|
||||
## 2. Prerequisites
|
||||
|
||||
### Required Software
|
||||
| Tool | Version | Purpose |
|
||||
| -------------- | ------- | ---------------------------------- |
|
||||
| Node.js | 22+ | For building frontend/backend |
|
||||
| yarn | latest | Package manager |
|
||||
| Java | 21 | Required for Android Gradle plugin |
|
||||
| Android Studio | latest | For building and signing APKs |
|
||||
| Capacitor CLI | latest | Android bridge |
|
||||
| OpenJDK | 21 | JDK for Gradle |
|
||||
|
||||
### Environment Setup
|
||||
```bash
|
||||
sudo apt install openjdk-21-jdk
|
||||
sudo update-alternatives --config java
|
||||
# Select Java 21
|
||||
|
||||
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
|
||||
java -version
|
||||
javac -version
|
||||
````
|
||||
|
||||
---
|
||||
|
||||
## 3. Build and Run the Web App
|
||||
|
||||
```
|
||||
yarn install
|
||||
yarn build-web
|
||||
```
|
||||
|
||||
### Local mode
|
||||
|
||||
If you want the webview to load from your local web version of Compass, run the web app.
|
||||
|
||||
In root directory:
|
||||
```bash
|
||||
export NEXT_PUBLIC_LOCAL_ANDROID=1
|
||||
yarn dev # or prod
|
||||
```
|
||||
|
||||
* Runs Next.js frontend at `http://localhost:3000`
|
||||
* Runs backend at `http://10.0.2.2:8088`
|
||||
|
||||
### Deployed mode
|
||||
|
||||
If you want the webview to load from the deployed web version of Compass (like at www.compassmeet.com), no web app to run.
|
||||
|
||||
---
|
||||
|
||||
## 5. Android WebView App Setup
|
||||
|
||||
### Install dependencies
|
||||
|
||||
```
|
||||
cd android
|
||||
./gradlew clean
|
||||
```
|
||||
|
||||
Sync web files and native plugins with Android, for offline fallback. In root:
|
||||
```
|
||||
export NEXT_PUBLIC_LOCAL_ANDROID=1 # if running your local web Compass
|
||||
yarn build-web # if you made changes to web app
|
||||
npx cap sync android
|
||||
```
|
||||
|
||||
### Load from site
|
||||
|
||||
During local development, open Android Studio project and run the app on an emulator or your physical device. Note that right now you can't use a physical device for the local web version (`10.0.2.2:3000 time out` )
|
||||
|
||||
```
|
||||
npx cap open android
|
||||
```
|
||||
|
||||
Building the Application:
|
||||
1. Open Android Studio.
|
||||
2. Click on "Open an existing Android Studio project".
|
||||
3. Navigate to the `android` folder in this repository and select it.
|
||||
4. Wait for Android Studio to index the project and download any necessary dependencies.
|
||||
5. Connect your Android device via USB or set up an Android emulator.
|
||||
6. Click on the "Run" button (green play button) in Android Studio to build and run the application.
|
||||
7. Select your device or emulator and click "OK".
|
||||
8. The application should now build and launch on your device or emulator.
|
||||
|
||||
---
|
||||
|
||||
## 6. Building the APK
|
||||
|
||||
### From Android Studio
|
||||
|
||||
- If you want to generate a signed APK for release, go to "Build" > "Generate Signed Bundle / APK..." and follow the prompts.
|
||||
- Make sure to test the application thoroughly on different devices and Android versions to ensure compatibility.
|
||||
|
||||
### Debug build
|
||||
|
||||
```bash
|
||||
cd android
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
Outputs:
|
||||
|
||||
```
|
||||
android/app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
### Install on emulator
|
||||
|
||||
```bash
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
### Release build (signed)
|
||||
|
||||
1. Generate a release keystore:
|
||||
|
||||
```bash
|
||||
keytool -genkey -v -keystore release-key.keystore -alias compass \
|
||||
-keyalg RSA -keysize 2048 -validity 10000
|
||||
```
|
||||
2. Add signing config to `android/app/build.gradle`
|
||||
3. Build:
|
||||
|
||||
```bash
|
||||
./gradlew assembleRelease
|
||||
```
|
||||
|
||||
---
|
||||
## 9. Debugging
|
||||
|
||||
Client logs from the emulator on Chrome can be accessed at:
|
||||
```
|
||||
chrome://inspect/#devices
|
||||
```
|
||||
|
||||
Backend logs can be accessed from the output of `yarn prod / dev` like in the web application.
|
||||
|
||||
Java/Kotlin logs can be accessed via Android Studio's Logcat.
|
||||
```
|
||||
adb logcat | grep CompassApp
|
||||
adb logcat | grep com.compassconnections.app
|
||||
adb logcat | grep Capacitor
|
||||
```
|
||||
|
||||
You can also add this inside `MainActivity.java`:
|
||||
|
||||
```java
|
||||
webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
Log.d("WebView", consoleMessage.message());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Deploy to Play Store
|
||||
|
||||
1. Sign the release APK or AAB.
|
||||
2. Verify package name matches Firebase settings (`com.compassconnections.app`).
|
||||
3. Upload to Google Play Console.
|
||||
4. Add Privacy Policy and content rating.
|
||||
5. Submit for review.
|
||||
|
||||
---
|
||||
|
||||
## 11. Common Issues
|
||||
|
||||
| Problem | Cause | Fix |
|
||||
| -------------------------------------- | -------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `INSTALL_FAILED_UPDATE_INCOMPATIBLE` | Old APK signed with different key | Uninstall old app first |
|
||||
| `Account reauth failed [16]` | Missing or incorrect SHA-1 in Firebase | Re-add SHA-1 of keystore |
|
||||
| App opens in Firefox | Missing `WebViewClient` override | Fix `shouldOverrideUrlLoading` |
|
||||
| APK > 1 GB | Cached webpack artifacts included | Add `.next/` and `/public/cache` to `.gitignore` and build excludes |
|
||||
|
||||
---
|
||||
|
||||
## 13. Local Development Workflow
|
||||
|
||||
```bash
|
||||
# Terminal 1
|
||||
export NEXT_PUBLIC_LOCAL_ANDROID=1
|
||||
yarn dev # or prod
|
||||
|
||||
# Terminal 2: start frontend
|
||||
export NEXT_PUBLIC_LOCAL_ANDROID=1
|
||||
yarn build-web # if you made changes to web app
|
||||
npx cap sync android
|
||||
# Run on emulator or device
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 14. Deployment Workflow
|
||||
|
||||
```bash
|
||||
# 1. Build web app for production
|
||||
yarn build-web
|
||||
|
||||
# 2. Sync assets to Android
|
||||
npx cap sync android
|
||||
|
||||
# 3. Build signed release APK in Android Studio
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 15. Resources
|
||||
|
||||
* [Capacitor Docs](https://capacitorjs.com/docs)
|
||||
* [Firebase Android Setup](https://firebase.google.com/docs/android/setup)
|
||||
* [FCM HTTP API](https://firebase.google.com/docs/cloud-messaging/send-message)
|
||||
* [Next.js Deployment](https://nextjs.org/docs/deployment)
|
||||
|
||||
|
||||
# Useful Commands
|
||||
|
||||
- To build the project: `./gradlew assembleDebug`
|
||||
- To run unit tests: `./gradlew test`
|
||||
- To run instrumentation tests: `./gradlew connectedAndroidTest`
|
||||
- To clean the project: `./gradlew clean`
|
||||
- To install dependencies: Open Android Studio and it will handle dependencies automatically.
|
||||
- To update dependencies: Modify the `build.gradle` files and sync the project in Android Studio.
|
||||
- To generate a signed APK: Use the "Generate Signed Bundle / APK..." option in Android Studio.
|
||||
- To lint the project: `./gradlew lint`
|
||||
- To check for updates to the Android Gradle Plugin: `./gradlew dependencyUpdates`
|
||||
- To run the application on a connected device or emulator: `./gradlew installDebug`
|
||||
- To view the project structure: Use the "Project" view in Android Studio.
|
||||
- To analyze the APK: `./gradlew analyzeRelease`
|
||||
- To run ProGuard/R8: `./gradlew minifyRelease`
|
||||
- To generate documentation: `./gradlew javadoc`
|
||||
|
||||
# One time setups
|
||||
|
||||
Was already done for Compass, so you only need to do the steps below if you create a project separated from Compass.
|
||||
## Configure Firebase
|
||||
|
||||
### In Firebase Console
|
||||
|
||||
1. Add a **Web app** → obtain `firebaseConfig`
|
||||
2. Add an **Android app**
|
||||
|
||||
* Package name: `com.compassconnections.app`
|
||||
* Add your SHA-1 and SHA-256 fingerprints (see below)
|
||||
* Download `google-services.json` and put it in:
|
||||
|
||||
```
|
||||
android/app/google-services.json
|
||||
```
|
||||
|
||||
### To get SHA-1 for debug keystore
|
||||
|
||||
```bash
|
||||
keytool -list -v \
|
||||
-keystore ~/.android/debug.keystore \
|
||||
-alias androiddebugkey \
|
||||
-storepass android \
|
||||
-keypass android
|
||||
```
|
||||
|
||||
Add both SHA-1 and SHA-256 to Firebase.
|
||||
|
||||
|
||||
## 7. Google Sign-In (Web + Native)
|
||||
|
||||
In Firebase Console:
|
||||
|
||||
* Enable **Google** provider under *Authentication → Sign-in method*
|
||||
* Add your **Android SHA-1**
|
||||
* Add your **Web OAuth client ID**
|
||||
|
||||
In your code:
|
||||
|
||||
```ts
|
||||
import { googleNativeLogin } from 'web/lib/service/android-push'
|
||||
```
|
||||
|
||||
|
||||
## 8. Push Notifications (FCM)
|
||||
|
||||
### Setup FCM
|
||||
|
||||
* Add Firebase Cloud Messaging to your project
|
||||
* Include `google-services.json` under `android/app/`
|
||||
* Add in `android/build.gradle`:
|
||||
|
||||
```gradle
|
||||
classpath 'com.google.gms:google-services:4.3.15'
|
||||
```
|
||||
* Add at the bottom of `android/app/build.gradle`:
|
||||
|
||||
```gradle
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
```
|
||||
|
||||
### Test notification
|
||||
|
||||
```ts
|
||||
const message = {
|
||||
notification: {
|
||||
title: "Test Notification",
|
||||
body: "Hello from Firebase Admin SDK"
|
||||
},
|
||||
token: "..."
|
||||
};
|
||||
initAdmin()
|
||||
await admin.messaging().send(message)
|
||||
.then(response => console.log("Successfully sent message:", response))
|
||||
.catch(error => console.error("Error sending message:", error));
|
||||
```
|
||||
|
||||
---
|
||||
3
android/app/.gitignore
vendored
Normal file
3
android/app/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/build/*
|
||||
!/build/.npmkeep
|
||||
/google-services.json
|
||||
66
android/app/build.gradle
Normal file
66
android/app/build.gradle
Normal file
@@ -0,0 +1,66 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
namespace "com.compassconnections.app"
|
||||
compileSdk 36
|
||||
defaultConfig {
|
||||
applicationId "com.compassconnections.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 13
|
||||
versionName "1.1.2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:34.4.0')
|
||||
// TODO: Add the dependencies for Firebase products you want to use
|
||||
// When using the BoM, don't specify versions in Firebase dependencies
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
// Add the dependencies for any other desired Firebase products
|
||||
// https://firebase.google.com/docs/android/setup#available-libraries
|
||||
|
||||
implementation 'com.google.android.gms:play-services-auth:21.4.0'
|
||||
implementation 'com.google.firebase:firebase-auth:24.0.1'
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
|
||||
try {
|
||||
def servicesJSON = file('google-services.json')
|
||||
if (servicesJSON.text) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
} catch(Exception e) {
|
||||
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
||||
}
|
||||
23
android/app/capacitor.build.gradle
Normal file
23
android/app/capacitor.build.gradle
Normal file
@@ -0,0 +1,23 @@
|
||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||
dependencies {
|
||||
implementation project(':capacitor-app')
|
||||
implementation project(':capacitor-keyboard')
|
||||
implementation project(':capacitor-push-notifications')
|
||||
implementation project(':capacitor-status-bar')
|
||||
implementation project(':capgo-capacitor-social-login')
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (hasProperty('postBuildExtras')) {
|
||||
postBuildExtras()
|
||||
}
|
||||
21
android/app/proguard-rules.pro
vendored
Normal file
21
android/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
37
android/app/release/output-metadata.json
Normal file
37
android/app/release/output-metadata.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.compassconnections.app",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 13,
|
||||
"versionName": "1.1.2",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File",
|
||||
"baselineProfiles": [
|
||||
{
|
||||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/app-release.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/app-release.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
"minSdkVersionForDexing": 23
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.getcapacitor.app", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
76
android/app/src/main/AndroidManifest.xml
Normal file
76
android/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.1" encoding="utf-8" ?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="openapp" />-->
|
||||
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
|
||||
|
||||
<!-- <data android:scheme="com.compassconnections.app" android:host="details"/>-->
|
||||
<!-- </intent-filter>-->
|
||||
|
||||
<!-- <intent-filter android:autoVerify="true">-->
|
||||
<!-- <action android:name="android.intent.action.VIEW" />-->
|
||||
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
|
||||
<!-- <data android:scheme="com.compassconnections.app" android:host="auth" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
|
||||
<!-- <service-->
|
||||
<!-- android:name=".MyMessagingService"-->
|
||||
<!-- android:exported="false">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!--<!– <meta-data–>-->
|
||||
<!--<!– android:name="com.google.firebase.messaging.default_notification_channel_id"–>-->
|
||||
<!--<!– android:value="@string/default_notification_channel_id" />–>-->
|
||||
<!-- </service>-->
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
<!-- Permissions -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
|
||||
|
||||
<!-- Firebase Cloud Messaging -->
|
||||
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
|
||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
||||
<!-- Old, can be removed ?-->
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
</manifest>
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.compassconnections.app;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin;
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
import com.getcapacitor.BridgeWebViewClient;
|
||||
import com.getcapacitor.Plugin;
|
||||
import com.getcapacitor.PluginHandle;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import ee.forgr.capacitor.social.login.GoogleProvider;
|
||||
import ee.forgr.capacitor.social.login.ModifiedMainActivityForSocialLoginPlugin;
|
||||
import ee.forgr.capacitor.social.login.SocialLoginPlugin;
|
||||
|
||||
|
||||
//import android.app.NotificationChannel;
|
||||
//import android.app.NotificationManager;
|
||||
//import android.os.Build;
|
||||
//import com.google.firebase.messaging.RemoteMessage;
|
||||
//import com.capacitorjs.plugins.pushnotifications.MessagingService;
|
||||
|
||||
//public class MyMessagingService extends MessagingService {
|
||||
//
|
||||
// @Override
|
||||
// public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
// // TODO(developer): Handle FCM messages here.
|
||||
// // Not getting messages here? See why this may be: https://goo.gl/39bRNJ
|
||||
// Log.d(TAG, "From: " + remoteMessage.getFrom());
|
||||
//
|
||||
// // Check if message contains a data payload.
|
||||
// if (remoteMessage.getData().size() > 0) {
|
||||
// Log.d(TAG, "Message data payload: " + remoteMessage.getData());
|
||||
//
|
||||
// if (/* Check if data needs to be processed by long running job */ true) {
|
||||
// // For long-running tasks (10 seconds or more) use WorkManager.
|
||||
// scheduleJob();
|
||||
// } else {
|
||||
// // Handle message within 10 seconds
|
||||
// handleNow();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// // Check if message contains a notification payload.
|
||||
// if (remoteMessage.getNotification() != null) {
|
||||
// Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
|
||||
// }
|
||||
//
|
||||
// // Also if you intend on generating your own notifications as a result of a received FCM
|
||||
// // message, here is where that should be initiated. See sendNotification method below.
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public class MainActivity extends BridgeActivity implements ModifiedMainActivityForSocialLoginPlugin {
|
||||
|
||||
// Declare this at class level
|
||||
private final ActivityResultLauncher<String> requestPermissionLauncher =
|
||||
registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {
|
||||
if (isGranted) {
|
||||
Log.i("CompassApp", "Permission granted");
|
||||
// Permission granted – you can show notifications
|
||||
} else {
|
||||
Log.i("CompassApp", "Permission denied");
|
||||
// Permission denied – handle gracefully
|
||||
}
|
||||
});
|
||||
|
||||
private void askNotificationPermission() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { // API 33
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
// Permission not yet granted; request it
|
||||
requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class NativeBridge {
|
||||
@JavascriptInterface
|
||||
public boolean isNativeApp() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
// String data = intent.getDataString();
|
||||
String endpoint = intent.getStringExtra("endpoint");
|
||||
Log.i("CompassApp", "onNewIntent called with endpoint: " + endpoint);
|
||||
if (endpoint != null) {
|
||||
Log.i("CompassApp", "redirecting to endpoint: " + endpoint);
|
||||
try {
|
||||
String payload = new JSONObject().put("endpoint", endpoint).toString();
|
||||
Log.i("CompassApp", "Payload: " + payload);
|
||||
bridge.getWebView().post(() -> bridge.getWebView().evaluateJavascript("bridgeRedirect(" + payload + ");", null));
|
||||
} catch (JSONException e) {
|
||||
Log.i("CompassApp", "Failed to encode JSON payload", e);
|
||||
}
|
||||
} else {
|
||||
Log.i("CompassApp", "No relevant data");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i("CompassApp", "onCreate called");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
WebView webView = this.bridge.getWebView();
|
||||
webView.setWebViewClient(new BridgeWebViewClient(this.bridge));
|
||||
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
|
||||
// Set a recognizable User-Agent (always reliable)
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setUserAgentString(settings.getUserAgentString() + " CompassAppWebView");
|
||||
|
||||
settings.setJavaScriptEnabled(true);
|
||||
webView.addJavascriptInterface(new NativeBridge(), "AndroidBridge");
|
||||
|
||||
registerPlugin(PushNotificationsPlugin.class);
|
||||
// Initialize the Bridge with Push Notifications plugin
|
||||
// this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
|
||||
// add(com.getcapacitor.plugin.PushNotifications.class);
|
||||
// }});
|
||||
|
||||
askNotificationPermission();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode >= GoogleProvider.REQUEST_AUTHORIZE_GOOGLE_MIN && requestCode < GoogleProvider.REQUEST_AUTHORIZE_GOOGLE_MAX) {
|
||||
PluginHandle pluginHandle = getBridge().getPlugin("SocialLogin");
|
||||
if (pluginHandle == null) {
|
||||
Log.i("CompassApp", "SocialLogin login handle is null");
|
||||
return;
|
||||
}
|
||||
Plugin plugin = pluginHandle.getInstance();
|
||||
if (!(plugin instanceof SocialLoginPlugin)) {
|
||||
Log.i("CompassApp", "SocialLogin plugin instance is not SocialLoginPlugin");
|
||||
return;
|
||||
}
|
||||
Log.i("CompassApp", "handleGoogleLoginIntent");
|
||||
((SocialLoginPlugin) plugin).handleGoogleLoginIntent(requestCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
// This function will never be called, leave it empty
|
||||
@Override
|
||||
public void IHaveModifiedTheMainActivityForTheUseWithSocialLoginPlugin() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
170
android/app/src/main/res/drawable/ic_launcher_background.xml
Normal file
170
android/app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
12
android/app/src/main/res/layout/activity_main.xml
Normal file
12
android/app/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
||||
7
android/app/src/main/res/values/strings.xml
Normal file
7
android/app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Compass</string>
|
||||
<string name="title_activity_main">Compass</string>
|
||||
<string name="package_name">com.compassconnections.app</string>
|
||||
<string name="custom_url_scheme">com.compassconnections.app</string>
|
||||
</resources>
|
||||
25
android/app/src/main/res/values/styles.xml
Normal file
25
android/app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="android:background">@drawable/splash</item>
|
||||
</style>
|
||||
</resources>
|
||||
5
android/app/src/main/res/xml/file_paths.xml
Normal file
5
android/app/src/main/res/xml/file_paths.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="my_images" path="." />
|
||||
<cache-path name="my_cache_images" path="." />
|
||||
</paths>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user