{"id":17981441,"url":"https://github.com/andremion/theatre","last_synced_at":"2025-04-05T01:08:12.168Z","repository":{"id":47175091,"uuid":"122661183","full_name":"andremion/Theatre","owner":"andremion","description":"Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components. The data are fetched from LondonTheatreDirect API. 🎭","archived":false,"fork":false,"pushed_at":"2021-10-11T16:50:34.000Z","size":4772,"stargazers_count":640,"open_issues_count":5,"forks_count":96,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-29T00:11:13.010Z","etag":null,"topics":["android","android-architecture-components","clean-architecture","dagger","dagger2","dagger2-android","data-binding","kotlin","mvvm","reactive-extensions","rxjava2","rxkotlin","view-model","viewmodel"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andremion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-23T19:01:21.000Z","updated_at":"2025-03-21T06:40:05.000Z","dependencies_parsed_at":"2022-08-28T13:11:09.851Z","dependency_job_id":null,"html_url":"https://github.com/andremion/Theatre","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/andremion%2FTheatre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FTheatre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FTheatre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FTheatre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andremion","download_url":"https://codeload.github.com/andremion/Theatre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"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":["android","android-architecture-components","clean-architecture","dagger","dagger2","dagger2-android","data-binding","kotlin","mvvm","reactive-extensions","rxjava2","rxkotlin","view-model","viewmodel"],"created_at":"2024-10-29T18:09:54.640Z","updated_at":"2025-04-05T01:08:12.152Z","avatar_url":"https://github.com/andremion.png","language":"Kotlin","funding_links":["https://ko-fi.com/T6T05M4O'"],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"Icon\" src=\"presentation/src/main/res/mipmap-xxhdpi/ic_launcher.png?raw=true\" align=\"left\" hspace=\"1\" vspace=\"1\"\u003e\n\n\u003ca alt='Buy Me a Coffee at ko-fi.com' href='https://ko-fi.com/T6T05M4O' target='_blank' align='right'\u003e\u003cimg align='right' height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=0' border='0' /\u003e\u003c/a\u003e\n\u003ca alt='Try it on Google Play' href='https://play.google.com/store/apps/details?id=com.andremion.theatre' target='_blank' align='right'\u003e\u003cimg \nalign='right' height='36' style='border:0px;height:36px;' src='https://developer.android.com/images/brand/en_generic_rgb_wo_60.png' border='0' /\u003e\u003c/a\u003e\n# Theatre\n\nPet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components.\u003c/br\u003e\nThe data is fetched from [LondonTheatreDirect API].\u003c/br\u003e\n\n#### The main purpose is using the latest practices and libraries.\n\n\u003c/br\u003e\n\n[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=true)](http://www.apache.org/licenses/LICENSE-2.0)\n![minSdkVersion 16](https://img.shields.io/badge/minSdkVersion-16-red.svg?style=true)\n![compileSdkVersion 27](https://img.shields.io/badge/compileSdkVersion-27-yellow.svg?style=true)\n[![CircleCI](https://circleci.com/gh/andremion/Theatre.svg?style=svg)](https://circleci.com/gh/andremion/Theatre)\n[![codecov](https://codecov.io/gh/andremion/Theatre/graph/badge.svg)](https://codecov.io/gh/andremion/Theatre)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt='Sample' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/sample.gif\"\u003e\u003c/br\u003e\n  \u003ci\u003e*Data from \u003ca href='https://www.londontheatredirect.com/'\u003eLondon Theatre Direct\u003c/a\u003e\u003c/i\u003e\u003c/br\u003e\n  \u003ci\u003e**UI inspired by \u003ca href='https://www.uplabs.com/posts/cinema-club-interface'\u003eYaroslav Zubko\u003c/a\u003e's design\u003c/i\u003e\n\u003c/p\u003e\n\n## Architecture\n\nUses concepts of the notorious Uncle Bob's architecture called [Clean Architecture].\u003c/br\u003e\nThe software produced by this architecture is going to be:\n\n* Independent of Frameworks.\n* Testable.\n* Independent of UI.\n* Independent of Database.\n\n\u003cimg alt='Clean' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/clean.png\" align=\"right\" width=\"50%\"/\u003e\n\n### The Dependency Rule\n\nThe overriding rule of this architecture says that the source code dependencies always point inwards.\u003c/br\u003e\nThe outer tiers can only dependent of inner tiers. Therefore, the inner tiers know nothing about the outer tiers.\u003c/br\u003e\nThe more further you go through the concentric circles, the higher level the software becomes. Which means that the level of abstraction increases.\n\n### Entities\n\nAn entity is a set of data structures. These entities are the business objects of the application and encapsulate the most general and high-level rules, such as [Event] or [Rating].\n\n### Use Cases\n\nThey are the operations of the application and may contain specific business rules.\u003c/br\u003e\nThis layer is isolated from database, UI, or any of the common frameworks.\u003c/br\u003e\nAll use case classes extends [UseCase] abstract class that sets up the schedulers of Reactive Extensions.\u003c/br\u003e\n\n### Adapters\n\nIt is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the UI or Database.\u003c/br\u003e\nIt is this layer that will wholly contain the ViewModels of [MVVM] architectural pattern.\u003c/br\u003e\nThe models are likely just data structures that are passed from the view to the use cases, and vice versa.\u003c/br\u003e\nSimilarly, data is converted, in this layer, from the form most convenient for entities and use cases, into the form most convenient for whatever persistence framework is being used.\n\n### Frameworks\n\nThe outermost layer is composed of frameworks and tools such as the Database and the Android Framework.\u003c/br\u003e\nThe Repository pattern is used to encapsulate the details about caching mechanism.\n\n### The Dependency Inversion\n\nIn order to not violate the Dependency Rule, the [Dependency Inversion principle] must be used whenever complex data needs to be passed across a boundary to an inward layer. Instead of expecting and directly referencing a low-level component (e.g. as a function parameter), the high-level layer provides and references an interface that must be implemented and inherited from by the caller. This way, the conventional dependency relationship is inverted and the high-level layer is decoupled from the low-level component.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt='Inversion of Control' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/inversion_of_control.png\"\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n### The Dependency Injection\n\nTo make the application more testable and avoid having to deal with object instantiations in many points, the [Dependency Injection technique] is used. \n\n\u003e Dependency injection is one form of the broader technique of inversion of control. As with other forms of inversion of control, dependency injection supports the dependency inversion principle.\n \n[Dagger] is the tool used for managing and injection of our dependencies. \n\n### Modules: WIP\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt='Modules' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/modules.png\"\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n#### Data\n\nThe **LondonTheatreDirect API** groups the data into:\n\n* __System API:__\n_Obtain information about enum data types._\n\nSince the data is basically static, a Repository with database caching is used by Gateway.\n\n* __Inventory API:__\n_Obtain realtime information about events on sale, venues, prices and availability._\n\nDue the data volatility, it is used a Repository that caches in memory.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt='Data' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/data.png\"\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n#### Presentation: WIP\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt='Presentation' src=\"https://raw.githubusercontent.com/andremion/Theatre/master/art/presentation.png\"\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n## Credentials\n\nRegister your account [here] to get your developer key and put it into [gradle.properties] file\n\n## References\n\n* [Android Clean Architecture](https://github.com/android10/Android-CleanArchitecture)\nSample app that is part of a series of blog posts about how to architect an android application using Uncle Bob's clean architecture approach.\n* [Android Architecture Blueprints](https://github.com/googlesamples/android-architecture)\nDemonstrate possible ways to help with testing, maintaining and extending of an Android app using different architectural concepts and tools.\n\n## Libraries and tools used in the project\n\n### Android\n\n* [Android Support Library](https://developer.android.com/topic/libraries/support-library/index.html)\nProvides additional convenience classes and features not available in the standard Framework API for easier development and support across more devices.\n* [Data Binding](https://developer.android.com/topic/libraries/data-binding)\nWrite declarative layouts and minimize the glue code necessary to bind application logic and layouts.\n* [Android KTX](https://github.com/android/android-ktx)\nA set of Kotlin extensions for Android app development.\n\n### Architecture and Design\n\n* [Android Architecture Components](https://developer.android.com/topic/libraries/architecture/index.html)\nA collection of libraries that help you design robust, testable, and maintainable apps.\nStart with classes for managing your UI component lifecycle and handling data persistence.\n* [Dagger]\nA fully static, compile-time dependency injection framework for both Java and Android.\n\n### Reactive\n\n* [RX Java](https://github.com/ReactiveX/RxJava)\nA library for composing asynchronous and event-based programs using observable sequences for the Java VM.\n* [RX Kotlin](https://github.com/ReactiveX/RxKotlin)\nRxJava bindings for Kotlin.\n* [RX Android](https://github.com/ReactiveX/RxAndroid)\nRxJava bindings for Android.\n\n### View and Image\n\n* [ConstraintLayout](https://developer.android.com/training/constraint-layout/index.html)\nAllows you to create large and complex layouts with a flat view hierarchy (no nested view groups).\n* [RecyclerView](http://developer.android.com/reference/android/support/v7/widget/RecyclerView.html)\nA flexible view for providing a limited window into a large data set.\n* [Glide](https://github.com/bumptech/glide)\nAn image loading and caching library for Android focused on smooth scrolling\n\n### Data Request\n\n* [Retrofit](http://square.github.io/retrofit/)\nA type-safe HTTP client for Android and Java.\n* [OkHttp](http://square.github.io/okhttp/)\nAn HTTP \u0026 HTTP/2 client for Android and Java applications.\n* [Moshi](https://github.com/square/moshi)\nA modern JSON library for Android and Java.\n\n### Persistence\n\n* [Room](https://developer.android.com/topic/libraries/architecture/room.html)\nThe Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.\n\n### Debugging and tests\n\n* [Stetho](http://facebook.github.io/stetho/)\nA debug bridge for Android applications.\n\n## TODO\n\n* [Explain more about the architecture diagrams in README file.](https://github.com/andremion/Theatre/issues/2)\n* [Improve and add more unit tests](https://github.com/andremion/Theatre/issues/4)\n* [Add pagging on event list](https://github.com/andremion/Theatre/issues/5)\n\n## Contributing\n\nContributions are always welcome!\n\n**Issues:**\nFell free to open a new issue. Follow the [ISSUE_TEMPLATE.MD](https://github.com/andremion/Theatre/tree/master/ISSUE_TEMPLATE.md)\n\nFollow the \"fork-and-pull\" Git workflow.\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Commit** changes to your own branch\n 4. **Merge** with current *development* branch\n 5. **Push** your work back up to your fork\n 7. Submit a **Pull request** your changes can be reviewed (please refere the issue if reported)\n\n**Prevent** code-style related changes. Format the code before commiting.\n\n## License\n\n    Copyright 2018 André Mion\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n    \n    \n[LondonTheatreDirect API]: https://developer.londontheatredirect.com/ \"LondonTheatreDirect API\"\n[Clean Architecture]: https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html \"The Clean Architecture by Robert C. Martin\"\n[UseCase]: domain/src/main/kotlin/com/andremion/domain/UseCase.kt \"Use Case class\"\n[Event]: domain/src/main/kotlin/com/andremion/domain/entity/Event.kt \"Event entity\"\n[Rating]: domain/src/main/kotlin/com/andremion/domain/entity/Rating.kt \"Rating entity\"\n[MVVM]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel \"Model–View–ViewModel (MVVM) on Wikipedia\"\n[Dependency Inversion principle]: https://en.wikipedia.org/wiki/Dependency_inversion_principle \"Dependency Inversion principle on Wikipedia\"\n[Dependency Injection technique]: https://en.wikipedia.org/wiki/Dependency_injection \"Dependency Injection technique on Wikipedia\"\n[Dagger]: https://google.github.io/dagger/ \"Dagger\"\n[here]: https://iodocs.londontheatredirect.com/member/register \"Register Account on LondonTheatreDirect API\"\n[gradle.properties]: data/gradle.properties \"gradle.properties file\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandremion%2Ftheatre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandremion%2Ftheatre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandremion%2Ftheatre/lists"}