Giter Club home page Giter Club logo

clean_architecture's Introduction

YTS Mobile

A simple mobile client app for browsing movies listed under YTS website.

Content

App Architecture and Folder Structure

The code of the app implements clean architecture to separate the UI, domain and data layers with a features-first approach for folder structure.

Folder Structure

lib
├── app
├── core
│   ├── animations
│   ├── app_state
│   ├── configs
│   ├── errors
│   ├── extensions
│   ├── models
│   ├── routes
│   ├── services
│   │   ├── http
│   │   └── storage
│   ├── theme
│   ├── utils
│   ├── widgets
│   │   └── loaders
├── features
│   ├── auth
│   │   ├── application
│   │   ├── infrastructure
│   │   │    ├── models
│   │   │    └── repositories
│   │   └── presentation
│   │       ├── pages
│   │       └── widgets
│   ├── movies
│   │   ├── application
│   │   ├── infrastructure
│   │   │    ├── models
│   │   │    └── repositories
│   │   └── presentation
│   │       ├── pages
│   │       └── widgets
├── firebase_options.dart
└── main.dart
  • main.dart file has services initialization code and wraps the root YtsApp with a ProviderScope.

  • firebase_options.dart is auto-generated file by flutterfire CLI which contains all the nessary configuration for firebase. integration.

  • The app folder with yts_app has the root MaterialApp which injects the theme data and navigation data entire all the widget tree.

  • The core folder contains code shared across features :

    • animations folder contains the code to animate the widgets.

    • app_state folder contains the model that represents the state of app during api call i.e initial, loading, loaded, success, error.

    • configs contains the configuration of app such as base_url for api call.

    • constants folder is where all the constant values used across the app such as app_assets with list of the path for assets are declared.

    • errors folder contains the model that parses exceptions and dio_error and returns failure object.

    • extensions folder contains all the extension methods such as snackbar_extension that shows snackbar when called like context.showSnackbar().

    • models folder contains the core models for pagination and caching the api response.

    • routes folders contains the list of route_paths and go_router navigation configurations.

    • services folder abstract app-level services with their implementations

      • http service is implemented with Dio and uses a CacheInterceptor to achieve caching by using the StorageService.
      • storage service is implemented with Hive * Service locator pattern and Riverpod are used to abstract services when used in other layers.
    • theme folder contain general styles (colors, themes & text styles)

    • utilsfolder contain the helper methods such as validators for forms.

    • widgets folder contains all the core-widgets that are rendered in similar state across the app, such as shimmer, error_view, buttons, text-fields, loading-indicators, etc.

  • The features folder: the repository pattern is used to decouple logic required to access data sources from the domain layer.

    • application folder also known as domain layer that contains all the business logic of the particular feature for example latest_movie_provider controls the app state from loading to success or error based on API response and sends it back to UI where the listeners and builders renders the components based on data provided.
    • intrastructure folder also known as data layer: The repository pattern is used to decouple logic required to access data sources from the domain layer.
      • models folder contains all the data class model generated using Freezed with support for parsing json to dart object, copy-with method, and more.
      • repositories folder contains the abstract-class and it's implementation which interact with network calls parses data and sends back to domain layer.
  • The presentation folder also known as presentation layer which contains all the UI components.

Authentication :

Plugins and Packages used :

HTTPs & Connectivity :
State Management and Dependency Injection :
Navigation :
Firebase :
Icons, Theme and animations :
Code generation and testing :
Local storage :
Others utilities :

Previews

Light Mode Dark Mode

How to contribute

🚧 This project is still under development phase 🚧

  • If encountered any bugs feel free to report here
  • If you want to contribute to the project you can send Pull request.

clean_architecture's People

Contributors

roshandroids avatar kirandroid avatar muhammadhassamriaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.