Deliverzler is an innovative open-source delivery app designed for restaurants, built with Flutter and leveraging concepts like Domain-Driven Design (DDD) and Layered Architecture. This user-friendly guide will take you step-by-step through the setup process, ensuring that you have a smooth experience.
Architecture Overview
The app follows a structured architecture that helps in scaling and maintaining the codebase effectively. Here’s a visual representation of the architecture:
Folder Structure
Understanding the folder structure will make it easier for you to navigate the project:
- lib
- features
- feature1
- presentation
- screeens
- components
- providers (observable states)
- domain
- entities, aggregates, and value objects
- services (application and business logic)
- infrastructure
- repos and facades
- dtos
- data_sources
- presentation
- feature1
- features
If you’re interested in a different approach, check out the other branches in the repository that implement TDD and Clean Architecture:
- clean-arch branch: TDD and Clean Architecture with Riverpod 2.0.
- clean-arch-no-code-gen branch: TDD and Clean Architecture without code generation.
Instructions to Run the Project
Follow these simple steps to get the Deliverzler project up and running:
- Create a Firebase project and add it to your Flutter app (Follow Firebase Setup Instructions).
- Add a user manually at Firebase Auth for testing.
- Populate Firestore with user data (server ID & some orders) similar to the shown model architecture:
- Configure an API project with the Google Maps Platform and enable necessary APIs.
- Add your Google Map API Keys to the configs.template folder, then rename it to configs.
- (Optional) Deploy functions to Firebase Cloud Functions for FCM notifications for new orders.
- Run the project using the command flutter run –dart-define-from-file=configs/flavor.json or from VSCode.
Features to Look Forward To
This app is packed with exciting features:
- Utilizes Riverpod for state management and integrates with Flutter Hooks.
- Employs Layered architecture simplifying error handling.
- Navigation 2.0 using GoRouter.
- Firebase Firestore as the backend with real-time updates.
- Local and FCM notifications on order updates.
- Live tracking and responsive UI.
Understanding the Code with an Analogy
Imagine your delivery app as an intricate machine, like a multi-level train station. Each section represents different functionalities of your app:
- The “features” folder is like the platforms of the station, where each platform serves particular trains (or features).
- The “presentation” folder is akin to the waiting area, where users interact with the schedules and train info (UI components).
- The “domain” folder embodies the engine of the train that drives the functionalities (business logic), ensuring everything runs smoothly.
- The “infrastructure” folder is the tracks that connect all parts of the station, enabling communication with the outside world, much like how the app interacts with APIs and databases.
Troubleshooting and Tips
Despite following the steps above, you might encounter a few hiccups. Here are some troubleshooting tips:
- Ensure your Firebase project is correctly set up and linked to your Flutter app.
- Double-check that the Google Maps APIs are enabled in your project settings.
- If you face any issues, visit the official documentation for Flutter and Firebase for in-depth guides.
- Check your Cloud Functions logs if you’re not receiving FCM notifications.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.