Skip to content

Project Specifications and Knowledge base

Mahesh Jamdade edited this page Aug 9, 2023 · 2 revisions

Welcome to the vocabhub! This page outlines the business logic and the technical details involved in functioning the app.

Login

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.

Dashboard

A new word of the day is published when the first user(past 24 hours since the word was published) comes online.

Explore Page

Explore page shows a vertical scroll animation every 7 days, The animation is trigged only when the user is in Explore Tab.

Collections

Users can add any words to collections (private and stored on user device)

Notifications

The app currently has three types of User notifications

  1. word of the day: Pushed to word of the day topic
  2. New word: When a new word gets added to the platform
  3. When the contribution status changes (approved/rejected)

Admin gets notified for all of the above along with

  1. When someone reports a bug
  2. When someone makes contribution on the platform.

Running the app

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>

command to run the app from the command line, or 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.

 {
    "name": "Launch",
    "request": "launch",
    "type": "dart",
    "program": "lib/main.dart",
    "args": [
        "--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 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>

Build the app

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.

Web

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>

Android/IOS

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>