-
Notifications
You must be signed in to change notification settings - Fork 10
Project Specifications and Knowledge base
Welcome to the vocabhub! This page outlines the business logic and the technical details involved in functioning the app.
App currently only supports login with Google and allows user to access limited features with Guest mode.
When user launches the app for the first time, he is taken to the home screen in guest mode and if the user is
- logged in: The user stays logged in unless explicitly logged out.
- logged out: Every successful app launch will take to homescreen (in guest mode) and every third app launch takes to login screen.
A new word of the day is published when the first user(past 24 hours since the word was published) comes online.
Explore page shows a vertical scroll animation every 7 days, The animation is trigged only when the user is in Explore Tab.
Users can add any words to collections (private and stored on user device)
The app currently has three types of User notifications
- word of the day: Pushed to word of the day topic
- New word: When a new word gets added to the platform
- When the contribution status changes (approved/rejected)
Admin gets notified for all of the above along with
- When someone reports a bug
- When someone makes contribution on the platform.
The app currently uses Supabase, Firebase services and some custom variables. These variables and the api keys in this project are managed using --dart-define flags passed to the flutter run command.
flutter <command> --dart-define=SUPABASE_PROJECT_URL=<your project url here> --dart-define=SUPABASE_API_KEY=<your api key here> --dart-define=SUPABASE_REDIRECT_URL=<your redirect url here> --dart-define=FIREBASE_VAPID_KEY=<vapid key from web push certificate in firebase> --dart-define=ADMIN_EMAIL=<youremail> --dart-define=FCM_SERVER_KEY=<Firebase server key>
If you want to use the launch.json file to run the app, you can copy paste the below configuration to your .vscode/launch.json
file and pass the keys from the Supabase settings.
{
"configurations": [
{
"name": "Android debug",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"program": "lib/main.dart",
"args": [
// "-v",
"> log.txt",
"--dart-define=SUPABASE_PROJECT_URL=",
"--dart-define=SUPABASE_API_KEY=",
"--dart-define=SUPABASE_REDIRECT_URL=",
"--dart-define=SUPABASE_SERVICE_ROLE=",
"--dart-define=FIREBASE_VAPID_KEY=",
"--dart-define=ADMIN_EMAIL=",
"--dart-define=FCM_SERVER_KEY="
]
},
{
"name": "Web debug",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"flutterMode": "debug",
"args": [
"-d",
"chrome",
"--web-port",
"63133",
"--dart-define=SUPABASE_PROJECT_URL=",
"--dart-define=SUPABASE_API_KEY=",
"--dart-define=SUPABASE_REDIRECT_URL=",
"--dart-define=SUPABASE_SERVICE_ROLE=",
"--dart-define=FIREBASE_VAPID_KEY=",
"--dart-define=ADMIN_EMAIL=",
"--dart-define=FCM_SERVER_KEY="
]
},
{
"name": "Web release",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"flutterMode": "release",
"args": [
"build",
"web",
"--release",
"--dart-define=SUPABASE_PROJECT_URL=",
"--dart-define=SUPABASE_API_KEY=",
"--dart-define=SUPABASE_REDIRECT_URL=",
"--dart-define=SUPABASE_SERVICE_ROLE=",
"--dart-define=FIREBASE_VAPID_KEY=",
"--dart-define=ADMIN_EMAIL=",
"--dart-define=FCM_SERVER_KEY="
]
},
{
"name": "Android release",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"program": "lib/main.dart",
"args": [
"--dart-define=SUPABASE_PROJECT_URL=",
"--dart-define=SUPABASE_API_KEY=",
"--dart-define=SUPABASE_REDIRECT_URL=",
"--dart-define=SUPABASE_SERVICE_ROLE=",
"--dart-define=FIREBASE_VAPID_KEY=",
"--dart-define=ADMIN_EMAIL=",
"--dart-define=FCM_SERVER_KEY="
"echo > CHANGELOG.md"
]
},
]
}
Run the project using the command
flutter run --dart-define=SUPABASE_PROJECT_URL=<your project url here> --dart-define=SUPABASE_API_KEY=<your api key here> --dart-define=SUPABASE_REDIRECT_URL=<your redirect url here> --dart-define=FIREBASE_VAPID_KEY=<vapid key from web push certificate in firebase> --dart-define=ADMIN_EMAIL=<youremail> --dart-define=FCM_SERVER_KEY=<Firebase server key>
run app on port 63133 required for googleSignIn to work on localhost
flutter run -d chrome --web-port 63133 --dart-define=SUPABASE_PROJECT_URL=<your project url here> --dart-define=SUPABASE_API_KEY=<your api key here> --dart-define=SUPABASE_REDIRECT_URL=<your redirect url here> --dart-define=FIREBASE_VAPID_KEY=<vapid key from web push certificate in firebase>
flutter run --dart-define=SUPABASE_PROJECT_URL=<your project url here> --dart-define=SUPABASE_API_KEY=<your api key here> --dart-define=SUPABASE_REDIRECT_URL=<your redirect url here> --dart-define=FIREBASE_VAPID_KEY=<vapid key from web push certificate in firebase>
flutter build apk --dart-define=SUPABASE_PROJECT_URL=<your project url here> --dart-define=SUPABASE_API_KEY=<your api key here> --dart-define=SUPABASE_REDIRECT_URL=<your redirect url here> --dart-define=FIREBASE_VAPID_KEY=<vapid key from web push certificate in firebase> --dart-define=ADMIN_EMAIL=<youremail> --dart-define=FCM_SERVER_KEY=<Firebase server key>
The apk will be generated in the build/app/outputs/flutter-apk/app-release.apk
folder.
flutter drive
--driver=test_driver/integration_test.dart
--target=integration_test/app_test.dart --dart-define=SUPABASE_PROJECT_URL= --dart-define=SUPABASE_API_KEY= --dart-define=SUPABASE_REDIRECT_URL= --dart-define=SUPABASE_SERVICE_ROLE= --dart-define=FIREBASE_VAPID_KEY=