Repository navigation
Expand file tree
/
Copy pathconstants.dart
More file actions
165 lines (139 loc) · 6.87 KB
/
Copy pathconstants.dart
File metadata and controls
165 lines (139 loc) · 6.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// This file contains constants that are used throughout the app.
// Appwrite Project Constants
const String baseDomain = String.fromEnvironment(
'APPWRITE_BASE_DOMAIN',
defaultValue: '10.12.78.30',
);
const String appwriteProjectId = String.fromEnvironment(
'APPWRITE_PROJECT_ID',
defaultValue: 'resonate',
);
// http for a local Appwrite; release builds pass https
const String appwriteScheme = String.fromEnvironment(
'APPWRITE_SCHEME',
defaultValue: 'http',
);
const String appwriteEndpoint = "$appwriteScheme://$baseDomain/v1";
const String localhostLivekitEndpoint = "http://$baseDomain:7880";
// The push broker is a listener of its own not a route on the API host
const String appwriteMqttHost = String.fromEnvironment(
'APPWRITE_MQTT_HOST',
defaultValue: baseDomain,
);
// 8883 is MQTT over TLS, 1883 plaintext. A local Appwrite serves the API over
// http, so the broker is plaintext there too.
const int appwriteMqttPort = int.fromEnvironment(
'APPWRITE_MQTT_PORT',
defaultValue: appwriteScheme == 'https' ? 8883 : 1883,
);
const String appwritePushEndpoint = appwriteScheme == 'https'
? "mqtts://$appwriteMqttHost:$appwriteMqttPort"
: "mqtt://$appwriteMqttHost:$appwriteMqttPort";
const String meilisearchEndpoint = String.fromEnvironment(
'MEILISEARCH_ENDPOINT',
defaultValue: 'http://$baseDomain:7700',
);
const String meilisearchApiKey = String.fromEnvironment(
'MEILISEARCH_API_KEY',
defaultValue: 'myMasterKey',
);
// F-Droid ships its own updates, so the in-app Play Store check must not run:
// it would point users at a channel they did not install from.
const bool isFDroidBuild = bool.fromEnvironment('FDROID');
const bool isUsingMeilisearch = bool.fromEnvironment(
'USE_MEILISEARCH',
defaultValue: false,
);
const String storySemanticEmbedder = String.fromEnvironment(
'MEILISEARCH_STORY_EMBEDDER',
defaultValue: 'stories-semantic',
);
const int semanticSearchPercent = int.fromEnvironment(
'MEILISEARCH_SEMANTIC_PERCENT',
defaultValue: 50,
);
const double semanticSearchRatio = semanticSearchPercent / 100;
const double semanticScoreThreshold = 0.2;
// Every table lives in a single Appwrite database.
const String databaseId = "main";
// Discussion related Database Constants
const String subscribedUserTableId = "6522fd267db6fdad3392";
const String upcomingRoomsTableId = "6522fd163103bd453183";
// Story related Constants
const String storyTableId = "670259e900321c12a5a2";
const String chapterTableId = "670277ad002530531daf";
const String likeTableId = "670259e20000ddda49a0";
const String storyBucketId = "6703f4c70037edfd8429";
// Anything larger than this doesn't uploads in single request
const int maxUploadBytes = 5 * 1024 * 1024;
const String chapterDefaultCoverImageId = "67012e19003d00f39e17";
const String storyDefaultCoverImageId = "67012e19003d00f39e16";
const String chapterCoverImagePlaceholderUrl =
"$appwriteEndpoint/storage/buckets/$userProfileImageBucketId/files/$chapterDefaultCoverImageId/view?project=$appwriteProjectId&mode=admin";
const String storyCoverImagePlaceholderUrl =
"$appwriteEndpoint/storage/buckets/$userProfileImageBucketId/files/$storyDefaultCoverImageId/view?project=$appwriteProjectId&mode=admin";
// User related Database Constants
const String usersTableID = "64a52f0a6c41ded09def";
const String usernameTableID = "64a131980b5388c2a0af";
const String followersTableID = "68b16bae0027e57ba2c6";
const String friendsTableID = "68b43e30002f89343479";
const String userReportsTableID = "68dfcba90010d07ee333";
const String userProfileImageBucketId = "64a13095a4c87fd78bc6";
const String liveChapterAttendeesTableId = "68e6427f0014f8b0e580";
const String liveChaptersTableId = "68e5227e001b2f868c05";
// User stats & gamification constants. user_stats is read-only to clients: the
// Record Activity function holds the only write key, which is what makes a
// badge evidence rather than a claim.
const String userStatsTableID = "user_stats";
const String achievementThresholdsTableID = "achievement_thresholds";
// userProfileImagePlaceholder on theme constant IDs
const String amberUserProfileImagePlaceholderID = "67012e19003d00f39e10";
const String classicUserProfileImagePlaceholderID = "67012e19003d00f39e11";
const String creamUserProfileImagePlaceholderID = "67012e19003d00f39e12";
const String forestUserProfileImagePlaceholderID = "67012e19003d00f39e13";
const String timeUserProfileImagePlaceholderID = "67012e19003d00f39e14";
const String vintageUserProfileImagePlaceholderID = "67012e19003d00f39e15";
// Rooms related Database Constants
const String roomsTableId = "64a5217e695bf2c4ec9c";
const String participantsTableId = "64a63e508145d1084abf";
const String chatMessagesTableId = "670d812c0002c33c09a8";
const String chatMessageReplyTableId = "672759820027801f121f";
const String pollsTableId = "room_polls";
const String pollVotesTableId = "room_poll_votes";
// Pair chat database constants
const String pairRequestTableId = "64d980211f1395263ebe";
const String activePairsTableId = "64d980cd65ff2e08ab97";
const String friendCallsTableId = "68b764ba002794fa2f61";
// Room related cloud function constants
const String createRoomServiceId = "651e2670b1e4a26e3cf1";
const String joinRoomServiceId = "651e3d8fa35c690ed957";
const String deleteRoomServiceId = "651e348775f28d84e11e";
const String createLiveChapterRoomFunctionId = "68e8c39600152445ca07";
const String deleteLiveChapterRoomFunctionId = "68ebff09000f814cc979";
const String sendOtpFunctionID = "6513e9d40b57c6ec156f";
const String verifyOtpFunctionID = "651303df122abc151bf3";
const String verifyUserFunctionID = "6513df34a0de595ccfb3";
const String updateEmailFunctionID = "64b27d2e813dd152f0edz";
const String sendMessageNotificationFunctionID = "65368a58ef47cf6861206";
const String sendStoryNotificationFunctionID = "68b241f500012870fca3";
const String sendSocialNotificationFunctionID = "send-social-notification";
const String startFriendCallFunctionID = "68b76fe00027c243610e";
const String recordActivityFunctionID = "record-activity";
const String verificationTableID = "64a7c0100eabfe8d3844";
// Deep links. The Android manifest registers an app link for
// https://<roomLinkHost>/<roomLinkSegment>/..., tabview_notifier parses it and
// the room share builds it -- all three have to agree, so they read it here.
const String roomLinkHost = "resonate.aossie.org";
const String roomLinkSegment = "room";
String roomLinkFor(String roomId) =>
"https://$roomLinkHost/$roomLinkSegment/$roomId";
// Github Constants
const String githubRepoUrl = "https://github.com/AOSSIE-Org/Resonate";
const String discordRepoUrl = "https://discord.com/invite/6mFZ2S846n";
const String xPageUrl = "https://x.com/aossie_org";
const String playStoreUrl =
"https://play.google.com/store/apps/details?id=com.resonate.resonate";
//Authentication Error types
const String userInvalidCredentials = 'user_invalid_credentials';
const String generalArgumentInvalid = 'general_argument_invalid';
String languageLocale = "en";