This is a showcase android application written in Kotlin and follows Clean Code architecture to showcase Characters from the StarWar movies
Get Sample app
Welcome 👋 This repo is a showcase of an android application which uses Clean Architecture and manages states using a FSM(Finite state machine) This repo implements a small but scalable (!) app which interacts with the open Star Wars API at https://swapi.dev/
The app contains 2 main areas:
- Character Search (Home Screen)
- Character Details (Details Screen)
The following attributes are displayed for the character details:
- name
- birth_year
- height (in cm and feet/inches)
- name
- language
- homeworld
- population (planets)
- films (movies the character appeared in)
- opening_crawl (detailed description of each movie)
- Screen - Represents a layer to react to State presented by domain layer for UI to show or update UI elements
- State - State representation of a finite system based on business logic
- Event - Event representation for UI layer to react to in a finite approach.
- Multi modular architecture and feature module driven architecture
- Choose navigation components to show that we don't need a single fragment however reuse a Custom view if needed as a destination
- Breaking down core deps and structuring a scalable but highly adaptable modular code base.
- Adds a design system module to help with showcasing theming support as well Epoxy driven UI layer where needed
- Showcasing design principles by breaking down core requirements for building the aforementioned design layer.
- Writing BaseJunit test to ensure all tests followed same coding standards.
- Did not have time to invest into UI testing
- Use of Clean architecture helped ensure SOC for each feature and testability
- Core/Common Classes - could not cover any test coverage in these modules for now
- Built custom architecture to break down into unit components in each layer
- Ensured packaging for readability.
- 📝 Despite writing tests at the end - did not follow TDD per say , chose this path for a reason - architecture shown in this app has been used by my team for some time now and that allowed control over components to verify at the end
- Due to bad time crunch over week days , asked for an extension Day to ensure i delivered with satisfaction of completing all checkboxes i had set forth to complete in this submission.
- Added a error view at the end to first solve core challenges and tackle UI towards end.
- Ensured wrote granular commits to help understand thought-process from get-go.
Clone the project and review the code or simply download the apk.
Android Studio 4.2.1 Java 1.8
- Clone the repo
- Clean build and then Run with Android Studio
See the open issues for a list of proposed features (and known issues).
-
Tech-stack
- Kotlin - a cross-platform, statically typed, general-purpose programming language with type inference.
- RxJava 2 - perform background operations.
- Dagger Hilt - a pragmatic lightweight dependency injection framework.
- Retrofit - a type-safe REST client for Android.
- Jetpack
- LiveData - is an observable data holder.
- Lifecycle - perform action when lifecycle state changes.
- ViewModel - store and manage UI-related data in a lifecycle conscious way.
- Navigation - Android navigation components helps connect different UI components
- Chucker - Netowrking debugging tool.
- Timber - a highly extensible android logger.
- Andromeda - a Design System module to help build components for UI layer
-
Architecture
- MVVM - Model View View Model
-
Tests
-
Gradle
- Gradle Grovy DSL - For reference purposes, here's an article explaining the migration.
- Plugins
- Json To Kotlin Data Class - Plugin generates Kotlin data classes from JSON text.
- SOLID - SOLID principle
- Design Principles - Mostly Builder pattern
All the dependencies (external libraries) are defined in the single place - Gradle dependencies.gradle folder. This approach allows to easily manage dependencies and use the same dependency version across all modules.
Details
Search
This sections mentions some of the issues not covered in this code submission:
-
Have not covered any UI tests in this project.
-
UI layer is barebones but can be improved upon on further enchancements.
-
The Error representation on UI is not covered , but is handled in other layers as states.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache License 2.0 License. See LICENSE
for more information.
Adit Lal - @aditlal - https://aditlal.dev
Open calendar : calendar