Github-Search-Repository-By-Organization-Clean it's a sample project to demonstrate how a clean architecure app could be. The goal of the project is to demonstrate good practices, provide a set of guidelines, and present modern Android application architecture that is modular, scalable, maintainable and testable that is the most important when you develop and app.
- Dagger2 --> For dependency injection
- Coroutines --> For reactive programming
- Retrofit --> To do API calls
- Gson --> To parse the results from Retrofit
- Glide --> Image loader
- Lottie --> Render After effects images
- Room --> Data base
- MockK --> For testing purposes
- MockWebServer --> For integration tests
- Espresso --> For UI tests
This app is developed following this image of clean architecture
Each layer has a distinct set of responsibilities:
Presentation layer
- presents data to a screen and handle user interactionsDomain layer
- contains business logicData layer
- access, retrieve and manage application data
Data layer contains the Webservice
and the Local Storage
, this project uses the network strategy, it means, it will always check if there's data in remote, if there are, updates the local storage and then show the data. If there's internet problems, or something wrong with the server it will try to find the data on local storage, if it finds it then it shows the data, otherwise it shows an Internet error message.
There's different modules
- buildSrc(Kotlin + buildSrc) --> To have well organised all of the libraries of the project
- app --> Contains all of the Application and all the setup for the Dagger
- library_base --> It contains all of the core of the application
- networking --> It contains in this case the
Retrofit
module with all the interceptors likeErrorInterceptor
- persistence --> It contains the database and dao's
- organization_searcher --> It's a feature module, where contains the list and the detail of the repositories.
There are a few ways to open this project.
- Android Studio -> File -> New -> From Version control -> Git
- Enter
https://github.com/joancolmenerodev/Github-Search-Repository-By-Organization-Clean.git
into URL field
- Run
git clone https://github.com/joancolmenerodev/Github-Search-Repository-By-Organization-Clean.git
- Android Studio -> File -> Open
./gradlew test
- Improve UI tests with Espresso
- Add pagination
- Add more features
Feel free to create a Pull request to improve the code. Let's create a basic simple app together!
- @Hassan Sadeghi for the no network animation.
- @shinan for the 404 not found animation
- Github Api