Biomark is a Flutter-based mobile application developed for a research organization that collects personal data from volunteers for building predictive machine learning models. This app handles user registration, login, profile management, and account recovery using Firebase Authentication and local SQLite storage.
- User Registration: Users can create an account with email and password.
- User Login: Firebase Authentication is used for secure login.
- Profile Management: Users can view and manage personal information.
- Account Recovery: Recover user accounts using security questions.
- Data Persistence: Sensitive data is securely stored locally using SQLite.
- Frontend: Flutter (Dart)
- Backend: Firebase Authentication, Firebase Firestore (future integration)
- Database: SQLite (local storage)
- Flutter SDK: Install Flutter
- Android Studio / Xcode: For Android and iOS builds.
- Firebase Account: Create a project in Firebase Console.
-
Clone the repository:
git clone https://github.com/your-username/biomark.git cd biomark -
Install dependencies:
Run the following command to install the required Flutter dependencies:
flutter pub get
-
Firebase Setup:
- Go to the Firebase Console.
- Create a new project or use an existing one.
- Register your Android app with the package name
com.majestta.biomark. - Download the
google-services.jsonfile from the Firebase Console. - Place the
google-services.jsonfile in theandroid/app/directory of your project.
-
Environment Variables:
Set up environment variables to handle API keys and other sensitive data. You can use the
flutter_dotenvpackage for this:-
Create a
.envfile in the root of your project:touch .env
-
Add your API keys and sensitive values to this file:
API_KEY=your_firebase_api_key_here -
Ensure that your
.envfile is ignored by Git by adding it to.gitignore:.env -
Load environment variables in your
main.dart:import 'package:flutter_dotenv/flutter_dotenv.dart'; Future<void> main() async { await dotenv.load(fileName: ".env"); runApp(BiomarkApp()); }
-
-
Ignore Sensitive Files:
Make sure the following files are added to
.gitignoreto avoid pushing sensitive information to version control:android/app/google-services.json .envIf you’ve already pushed these files to Git, remove them from tracking with:
git rm --cached android/app/google-services.json git rm --cached .env
-
Run the app:
-
For Android:
flutter run
-
For iOS:
flutter run --release
-
- Ensure that the
google-services.jsonfile is placed in theandroid/app/directory. - Firebase Authentication is used for login, registration, and user management.
- To manage Firebase keys and security, rotate keys periodically and restrict API usage.
- API Key Restrictions: You can restrict the Firebase API key to only be used by your app. Go to the Firebase Console, navigate to APIs & Services > Credentials, and set restrictions for your API key.
You can run tests by using the following Flutter command:
flutter test-
Building APK for Android:
flutter build apk --release
-
Building for iOS:
flutter build ios --release
-
API Key Management:
- Ensure API keys are not exposed in the codebase. Use environment variables for storing sensitive data.
- Add the
google-services.jsonand.envfiles to.gitignoreto avoid pushing them to version control.
-
Firebase Security:
- Restrict API key usage to authorized apps only.
- Regularly monitor Firebase usage and security settings.
Contributions are welcome! Please follow the Contributor Guidelines for more information.
This project is licensed under the MIT License. See the LICENSE file for details.