This project adopts Clean Architecture principles with a Feature First approach, designed for efficient and organized development. It integrates Yelp's GraphQL API to fetch restaurant data, complemented with a JSON containing preloaded information due to Yelp's daily request limits. Subsequent detail and review data for each restaurant are fetched in real-time.
The codebase is structured into several directories, reflecting the logical separation of concerns as per Clean Architecture guidelines:
core
: Contains core functionality and helpers likedio_helper.dart
for HTTP requests andhive_helper.dart
for local persistence.models
: Includes entity models such asrestaurant.dart
.navigation
: Manages app routing with files likeroute_navigator.dart
.services
: Provides initialization and service setup throughapp_init.dart
.features
: Organized by individual screens/pages, e.g.,home_page
andrestaurant_page
, with each feature containing its own domain, data, and presentation logic.repositories
: Containsyelp_repository.dart
for fetching data from the Yelp API.shared
: Houses reusable widgets such assingle_restaurant_card
and utility widgets likestatus_indicator.dart
.
Additionally, the project makes use of dotenv
to manage environment variables, enhancing security and configurability.
Prior to running the project, create or update the .env
file at the root of the project with the following key: YELP_API_KEY=thisISanApiKEYYouMUSTAdd
The application utilizes oxidized
for functional programming, promoting a more robust, error-resistant development experience.