{"id":13684752,"url":"https://github.com/AhmedLSayed9/deliverzler","last_synced_at":"2025-05-01T00:33:00.035Z","repository":{"id":44396314,"uuid":"451502234","full_name":"AhmedLSayed9/deliverzler","owner":"AhmedLSayed9","description":"Delivery App for Restaurants built on Flutter using Domain-Driven Design (DDD) and Layered Architecture along with Riverpod Framework.","archived":false,"fork":false,"pushed_at":"2024-11-05T13:32:22.000Z","size":18980,"stargazers_count":617,"open_issues_count":1,"forks_count":159,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-11-05T14:28:34.643Z","etag":null,"topics":["clean-architecture","clean-code","dart","ddd","domain-driven-design","fcm","firebase","flutter","go-router","google-maps","layered-architecture","local-notifications","riverpod","tdd","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AhmedLSayed9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T14:41:32.000Z","updated_at":"2024-11-05T13:32:15.000Z","dependencies_parsed_at":"2023-02-14T07:31:13.081Z","dependency_job_id":"f788d7e4-8ece-4537-bb92-7d17806fe467","html_url":"https://github.com/AhmedLSayed9/deliverzler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedLSayed9%2Fdeliverzler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedLSayed9%2Fdeliverzler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedLSayed9%2Fdeliverzler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmedLSayed9%2Fdeliverzler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AhmedLSayed9","download_url":"https://codeload.github.com/AhmedLSayed9/deliverzler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224230591,"owners_count":17277372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","clean-code","dart","ddd","domain-driven-design","fcm","firebase","flutter","go-router","google-maps","layered-architecture","local-notifications","riverpod","tdd","unit-testing"],"created_at":"2024-08-02T14:00:38.264Z","updated_at":"2024-11-12T06:30:34.463Z","avatar_url":"https://github.com/AhmedLSayed9.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# Deliverzler\n\nAn open-source Delivery App for Restaurants built on Flutter using Domain-Driven Design (DDD) and\nLayered Architecture along with Riverpod Framework, Firebase as backend, Navigation 2.0 (GoRouter),\nGoogle Maps, Live Tracking, Local Notifications, FCM Notifications, Cloud Functions, Flutter Hooks,\nFreezed, RxDart, FpDart and more.\n\n### Architecture Diagram:\n\n\u003cp align=\"left\"\u003e\n    \u003cimg src=\"/.github/images/architecture_diagram.png\" alt=\"Image\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n### Folder Structure:\n\n- lib\n  - features\n    - feature1\n      - presentation\n        - screens\n        - components\n        - providers (all providers that have observable state used by the view)\n      - domain\n        - entities, aggregates and value objects\n        - services (encapsulate application and business logic, if any)\n      - infrastructure\n        - repos and facades\n        - dtos\n        - data_sources\n\n_Note_: This is my current approach and architecture. In addition, the repository includes other\nbranches that implement TDD and Clean Architecture approach if you're interested:\n\n- clean-arch branch: TDD and Clean Architecture approach using Riverpod 2.0 with code generation.\n- clean-arch-no-code-gen branch: TDD and Clean Architecture approach using Riverpod 2.0 without code\n  generation.\n\n## ScreenShots\n\n\u003cp align=\"left\"\u003e\n    \u003cimg src=\"/.github/images/ss_01.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_02.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_03.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_04.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_05.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_06.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_07.png\" alt=\"Image\" width=\"600\"/\u003e\n    \u003cimg src=\"/.github/images/ss_08.png\" alt=\"Image\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n## Instructions to run the project\n\n1. Create Firebase project and add it to your Flutter app (\n   Follow https://firebase.google.com/docs/flutter/setup instructions).\n2. Add user manually at Firebase Auth to login with (This for testing as registration should be done\n   with another Admin app).\n3. Add user data (id field from previous step - User UID) and some orders to show at your Firebase\n   Firestore similar to the following model architecture:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/.github/images/firebase_1.png\" alt=\"Image\" width=\"450\"/\u003e\n    \u003cimg src=\"/.github/images/firebase_2.png\" alt=\"Image\" width=\"350\"/\u003e\n\u003c/p\u003e\n\n4. Configure an API project with the Google Maps Platform and enable Maps SDK for Android/iOS (FREE)\n   to be able to open the map. Also, enable Directions/ Geolocation/Places APIs to enable other map\n   features as search and live tracking (You have to create a billing account to use these APIs).\n5. Add your Google Map API Keys to the `configs.template` folder then rename the folder to `configs`.\n6. [Optional]: deploy functions within the project to Firebase Cloud Functions to receive FCM\n   notifications when new order is ready to be delivered.\n7. Run the project using the command `flutter run --dart-define-from-file=configs/{flavor}.json`, or from VSCode using the predefined launch configurations.\n\n## Features\n\n- Using Riverpod Framework with code generation (Most recommended) integrated with Flutter Hooks \u0026\n  Freezed.\n- Simplified Layered architecture by relying on Riverpod to catch exceptions and auto convert it to\n  AsyncError instead of the traditional Result/Either pattern, which reduce lots of boilerplate\n  code.\n- Navigation 2.0 (declarative routing) with GoRouter using the code generation variant and\n  implementing nested navigation.\n- Functional Programming: FpDart(Option in particular) \u0026 RxDart.\n- Firebase Firestore as the backend with Firebase Storage, FCM and Cloud Functions.\n- Receive Local notification when arrive client's location and the ability to call him or confirm\n  the order.\n- Receive FCM notification in (Foreground/Background/Terminated) when new order is ready to be\n  delivered.\n- Real-Time Changes from Firebase using Streams, Refreshing current stream capability.\n- Optimized live location tracking using RxDart and updating delivery data on changes.\n- Search places and update its information on map using Google Map Autocomplete \u0026 Place Details.\n- Live tracking on map using Place Directions, Perform actions when arrive client's location.\n- Responsive UI, Platform-Aware Widgets, Multi-Themes, Internationalization \u0026 Localization (Using\n  Flutter without external packages).\n- Well documented features and Unit Tests.\n\n## Business Logic\n\n- The app can be used by multiple delivery drivers in the restaurant. Also, you can make it work for\n  Multi-Vendor apps.\n- Only login screen for employee. You should authorize them in the backend by an admin app.\n- Home screen will show stream of delivery orders that are ready to be delivered `upcoming` or is\n  delivering `onTheWay`.\n- Any employee can see order details and deliver `upcoming` orders.\n- Employee can deliver multiple orders.\n- Only the employee that are delivering the order can confirm/cancel or show map of the order.\n- If the client provided his location \"in the client app\" it'll be loaded to the map, otherwise\n  employee can search for the location (new session token used for every search session to reduce\n  Google Maps bill).\n- When the order arrive to the destination by (200 meter) employee responsible for the order will\n  get local notification and will be able to confirm and call the client on the map.\n- If the delivery driver location changed with both (5seconds \u0026 50meter change in distance), it'll\n  update delivery geoPoint on the backend (for all his current delivering orders, so the clients\n  can listen to it) and will update map directions (for only the opened map, if any).\n- When new order is added to the backend (delivery order). All employees will get notification from\n  FCM (works with app in foreground, background or terminated).\n- Employee can add/edit his info at the profile screen.\n\n---\n\n**Appreciation**: I was inspired by [@RandalSchwartz](https://github.com/RandalSchwartz) to adopt\nand implement DDD Layered architecture with Riverpod Framework.\nAlso, ResoCoder’s DDD course (outdated) was a helpful start point to get some ideas about\nimplementing DDD Layered architecture in Flutter.\n\nGive a ⭐️ if you like the project.. Thanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhmedLSayed9%2Fdeliverzler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAhmedLSayed9%2Fdeliverzler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhmedLSayed9%2Fdeliverzler/lists"}