|
1 |
| -# Time Tracking app with Flutter & Firebase |
| 1 | +<h1 id="top" align="center">Danlaw Smart Charger</h1> |
2 | 2 |
|
3 |
| -A time tracking application built with Flutter & Firebase: |
| 3 | +## Table of Contents |
4 | 4 |
|
5 |
| - |
| 5 | +- [Description](#description) |
| 6 | +- [Features](#features) |
| 7 | +- [Roadmap](#roadmap) |
| 8 | +- [Packages](#packages) |
| 9 | +- [Support](#support) |
| 10 | +- [Design](#design) |
| 11 | +- [Screenshots](#screenshots) |
| 12 | +- [License](#license) |
6 | 13 |
|
7 |
| -This is intended as a **reference app** based on my [Riverpod Architecture](https://codewithandrea.com/articles/flutter-app-architecture-riverpod-introduction/). |
8 |
| - |
9 |
| -> **Note**: this project used to be called "Started Architecture for Flutter & Firebase" (based on this [old article](https://codewithandrea.com/videos/starter-architecture-flutter-firebase/)). As of January 2023, it follows my updated [Riverpod Architecture](https://codewithandrea.com/articles/flutter-app-architecture-riverpod-introduction/), using the latest packages. |
10 |
| -
|
11 |
| -## Flutter web preview |
12 |
| - |
13 |
| -A Flutter web preview of the app is available here: |
14 |
| - |
15 |
| -- [Time Tracker | Flutter web demo](https://starter-architecture-flutter.web.app) |
| 14 | +## Description |
16 | 15 |
|
| 16 | +Danlaw Smart Charger provides a simple interface for users to monitor the charging status of their EVs, plan custom charging schedules and setup various alerts. |
| 17 | + |
17 | 18 | ## Features
|
18 | 19 |
|
19 |
| -- **Simple onboarding page** |
20 |
| -- **Full authentication flow** (using email & password) |
21 |
| -- **Jobs**: users can view, create, edit, and delete their own private jobs (each job has a name and hourly rate) |
22 |
| -- **Entries**: for each job, user can view, create, edit, and delete the corresponding entries (an entry is a task with a start and end time, with an optional comment) |
23 |
| -- **A report page** that shows a daily breakdown of all jobs, hours worked and pay, along with the totals. |
24 |
| - |
25 |
| -All the data is persisted with Firestore and is kept in sync across multiple devices. |
| 20 | +- **Account**: New users need to create an account to access the features of the app. |
| 21 | +- **Authentication**: After account creation, users can login with email & password. |
| 22 | +- **Household**: |
| 23 | + - Users can add up to 3 households per account. |
| 24 | + - Household details can be changed. |
| 25 | +- **Charger**: |
| 26 | + - Users can add up to 3 chargers per household. |
| 27 | + - Chargers can be added with scanning a QR code or Bluetooth flow. |
| 28 | +- **Vehicle**: |
| 29 | + - Users can add up to 6 vehicles per household. |
| 30 | + - Vehicles can be added with scanning a QR code or Bluetooth flow. |
| 31 | + - Diagnostic Trouble Codes can be accessed from details page. |
| 32 | +- **Alert**: |
| 33 | + - Alerts are grouped by Vehicles and Chargers. |
| 34 | + - Users can be alerted by Push Notifications, Email and SMS. |
| 35 | + - Alerts can be set based on remaining miles, charge status, etc.. |
| 36 | +- **Schedule**: Users can see and set charging schedules for the week. |
| 37 | +- **Reports**: Energy reports are available for all the vehicles and chargers. Table can be grouped by chargers. |
26 | 38 |
|
27 | 39 | ## Roadmap
|
28 | 40 |
|
29 |
| -- [ ] Add missing tests |
30 |
| -- [x] Stateful Nested Navigation (available since GoRouter 7.1) |
31 |
| -- [ ] Use controllers / notifiers consistently across the app (some code still needs to be updated) |
32 |
| -- [ ] Add localization |
33 |
| -- [ ] Use the new Firebase UI packages where useful |
34 |
| -- [ ] Responsive UI |
35 |
| - |
36 |
| -> This is a tentative roadmap. There is no ETA for any of the points above. This is a low priority project and I don't have much time to maintain it. |
37 |
| -
|
38 |
| -## Relevant Articles |
| 41 | +- [ ] Update Add Charger Flow |
| 42 | +- [ ] Update Add Vehicle Flow |
| 43 | +- [ ] Add more tests |
| 44 | +- [ ] Add language selection |
39 | 45 |
|
40 |
| -The app is based on my Flutter Riverpod architecture, which is explained in detail here: |
| 46 | +>**Note:** Some of the items on the roadmap might be tackled at the next phase of development. |
41 | 47 |
|
42 |
| -- [Flutter App Architecture with Riverpod: An Introduction](https://codewithandrea.com/articles/flutter-app-architecture-riverpod-introduction/) |
43 |
| -- [Flutter Project Structure: Feature-first or Layer-first?](https://codewithandrea.com/articles/flutter-project-structure/) |
44 |
| -- [Flutter App Architecture: The Repository Pattern](https://codewithandrea.com/articles/flutter-repository-pattern/) |
45 |
| - |
46 |
| -More more info on Riverpod, read this: |
47 |
| - |
48 |
| -- [Flutter Riverpod 2.0: The Ultimate Guide](https://codewithandrea.com/articles/flutter-state-management-riverpod/) |
49 |
| - |
50 |
| -## Packages in use |
| 48 | +## Packages |
51 | 49 |
|
52 | 50 | These are the main packages used in the app:
|
53 | 51 |
|
54 | 52 | - [Flutter Riverpod](https://pub.dev/packages/flutter_riverpod) for data caching, dependency injection, and more
|
55 | 53 | - [Riverpod Generator](https://pub.dev/packages/riverpod_generator) and [Riverpod Lint](https://pub.dev/packages/riverpod_lint) for the latest Riverpod APIs
|
56 | 54 | - [GoRouter](https://pub.dev/packages/go_router) for navigation
|
57 |
| -- [Firebase Auth](https://pub.dev/packages/firebase_auth) and [Firebase UI Auth](https://pub.dev/packages/firebase_ui_auth) for authentication |
58 |
| -- [Cloud Firestore](https://pub.dev/packages/cloud_firestore) as a realtime database |
59 |
| -- [Firebase UI for Firestore](https://pub.dev/packages/firebase_ui_firestore) for the `FirestoreListView` widget with pagination support |
60 |
| -- [RxDart](https://pub.dev/packages/rxdart) for combining multiple Firestore collections as needed |
61 |
| -- [Intl](https://pub.dev/packages/intl) for currency, date, time formatting |
| 55 | +- [Intl](https://pub.dev/packages/intl) for date, time formatting |
62 | 56 | - [Mocktail](https://pub.dev/packages/mocktail) for testing
|
63 | 57 | - [Equatable](https://pub.dev/packages/equatable) to reduce boilerplate code in model classes
|
| 58 | +- [flutter_blue_plus](https://pub.dev/packages/flutter_blue_plus) to communicate with Charger and Vehicle via Bluetooth |
| 59 | +- [Reflectable](https://pub.dev/packages/reflectable) to automate widget generation from bespoke objects |
64 | 60 |
|
65 | 61 | See the [pubspec.yaml](pubspec.yaml) file for the complete list.
|
66 | 62 |
|
67 |
| -## Running the project with Firebase |
68 |
| - |
69 |
| -To use this project with Firebase, follow these steps: |
70 |
| - |
71 |
| -- Create a new project with the Firebase console |
72 |
| -- Enable Firebase Authentication, along with the Email/Password Authentication Sign-in provider in the Firebase Console (Authentication > Sign-in method > Email/Password > Edit > Enable > Save) |
73 |
| -- Enable Cloud Firestore |
74 |
| - |
75 |
| -Then, follow one of the two approaches below. 👇 |
| 63 | +## Support |
| 64 | +Application support by [Danlaw](https://danlawtechnologies.com/contactus). |
76 | 65 |
|
77 |
| -### 1. Using the CLI |
| 66 | +Platform support: |
| 67 | +- Android: SDK 34+ |
| 68 | +- iOS: iOS 17.0+ |
78 | 69 |
|
79 |
| -Make sure you have the Firebase CLI and [FlutterFire CLI](https://pub.dev/packages/flutterfire_cli) installed. |
| 70 | +Localization support: |
| 71 | +- United States English |
| 72 | +- Canadian French |
| 73 | +- Mexican Spanish |
80 | 74 |
|
81 |
| -Then run this on the terminal from the root of this project: |
| 75 | +Currently application uses default language of the device. If device language is not supported defaults to Engligh. |
82 | 76 |
|
83 |
| -- Run `firebase login` so you have access to the Firebase project you have created |
84 |
| -- Run `flutterfire configure` and follow all the steps |
| 77 | +## Design |
85 | 78 |
|
86 |
| -For more info, follow this guide: |
| 79 | +Current designs for this application can be found at [Figma](https://www.figma.com/design/Ji08JojX9t4N5U4uhjgH55/DAN003---EV-Charger-App?node-id=315-20822&t=r8H62xjxlTNpKI6r-0). |
87 | 80 |
|
88 |
| -- [How to add Firebase to a Flutter app with FlutterFire CLI](https://codewithandrea.com/articles/flutter-firebase-flutterfire-cli/) |
| 81 | +## Screenshots |
89 | 82 |
|
90 |
| -### 2. Manual way (not recommended) |
| 83 | +<p > |
| 84 | + <img src="assets/readme_assets/start.png" height="400"> |
| 85 | + <img src="assets/readme_assets/landing_empty.png" height="400"> |
| 86 | + <img src="assets/readme_assets/landing_full.png" height="400"> |
| 87 | +</p> |
| 88 | +<p > |
| 89 | + <img src="assets/readme_assets/alert_main.png" height="400"> |
| 90 | + <img src="assets/readme_assets/alert_config.png" height="400"> |
| 91 | + <img src="assets/readme_assets/report_table.png" height="400"> |
| 92 | +</p> |
| 93 | +<p > |
| 94 | + <img src="assets/readme_assets/add_charger.png" height="400"> |
| 95 | + <img src="assets/readme_assets/add_dongle.png" height="400"> |
| 96 | + <img src="assets/readme_assets/report_main.png" height="400"> |
| 97 | +</p> |
91 | 98 |
|
92 |
| -If you don't want to use FlutterFire CLI, follow these steps instead: |
93 | 99 |
|
94 |
| -- Register separate iOS, Android, and web apps in the Firebase project settings. |
95 |
| -- On Android, use `com.example.starter_architecture_flutter_firebase` as the package name. |
96 |
| -- then, [download and copy](https://firebase.google.com/docs/flutter/setup#configure_an_android_app) `google-services.json` into `android/app`. |
97 |
| -- On iOS, use `com.example.starterArchitectureFlutterFirebase` as the bundle ID. |
98 |
| -- then, [download and copy](https://firebase.google.com/docs/flutter/setup#configure_an_ios_app) `GoogleService-Info.plist` into `iOS/Runner`, and add it to the Runner target in Xcode. |
| 100 | +## License |
| 101 | +Copyright © 2024. All rights reserved by [Danlaw](https://danlawtechnologies.com/terms-conditions). |
99 | 102 |
|
100 |
| -That's it. Have fun! |
| 103 | +<br><br> |
101 | 104 |
|
102 |
| -## [License: MIT](LICENSE.md) |
| 105 | +[Back to Top](#top) |
0 commit comments