Welcome to the project! The Alelo Challenge is a mobile application that aims to provide a solution for managing shopping activities, including product browsing, adding items to the shopping cart, and processing orders. The app is designed to enhance the user experience and simplify the shopping process.
The project is developed and documented by Samuel Brasileiro.
GitHub Account: https://github.com/samuelbrasileiro
- Video Simulation
- Running Locally
- Packages
- Modules
- Tests
- Visualizing Dependency Graph
- Coding Patterns
To run the project locally, follow the setup instructions below.
Before running the project, you need to set up the necessary tools and dependencies.
-
Install the latest version of XcodeGen using Homebrew:
brew instal xcodegen
-
Install the latest version of SwiftGen using Homebrew:
brew instal swiftgen
To create and run the project locally, perform the following steps:
-
Clone the project repository:
git clone https://github.com/samuelbrasileiro/Alelo.git
-
Navigate to the project directory:
cd AleloChallenge
-
Generate the AleloChallenge's xcodeproj using XcodeGen:
make project
-
Open the generated xcodeproj file and build and run the project.
The project uses some packages that provide different functionalities and features. Below are the descriptions of the packages:
-
Commons
The
Commons
package provides reusable code snippets for iOS development. It includes common utility functions, extensions, and custom UI components that can be used across different modules of the project. -
DependencyInjection
The
DependencyInjection
package is a custom implementation of a dependency injection framework for Swift. It provides a way to manage dependencies and promote modularity and testability in the project. The package includes components and protocols for defining and injecting dependencies in a decoupled manner. -
SDWebImage
The SDWebImage package is a widely used library for efficiently downloading and caching remote images asynchronously. It provides an easy-to-use API for loading images from URLs and handling caching and placeholder images.
-
UIView_Shimmer
The UIView_Shimmer package provides a shimmer effect animation for UIView components. It allows you to add a shimmering effect to any UIView, giving a smooth and eye-catching animation while data is loading or to indicate activity.
The Alelo Challenge project is organized into different modules, each serving a specific purpose and providing essential functionalities for the application. Below are the descriptions of the modules:
-
Service
The Service module provides a set of components and protocols for performing network requests. It includes networking utilities, request builders, and response handlers to simplify the process of making API calls and handling responses.
-
Core
The
Core
module provides essential functionalities and components to create the main structures of the project. It includes common UI components, coordinators, and utility classes that facilitate the implementation of the project's flow and navigation. -
Store
The
Store
is responsible for managing the shopping-related functionality of the application. It includes views, view controllers, coordinators, providers, and network requests necessary for handling the shopping flow. The module focuses on presenting and managing the user interface components related to shopping, such as product listings, shopping cart management, and order processing. -
ModuleIntegration
The
ModuleIntegration
module facilitates the integration of various modules within the Alelo Challenge application. It provides a centralized mechanism for coordinating the interactions between different modules, enabling seamless communication and data exchange. This module ensures proper integration and collaboration among different components of the application. -
Application
The
Application
module represents the main entry point of the application. It includes the app delegate, scene delegates, and other necessary configurations for initializing and setting up the application. This module acts as the glue that brings all other modules together and starts the application's execution.
The project includes various test suites to ensure the correctness and stability of the codebase. Below are the descriptions of the test suites:
-
ServiceTests
The
ServiceTests
suite contains unit tests for the Service module. It includes test cases to validate the networking fetch component. -
StoreTests
The
StoreTests
suite contains unit tests for the Store module. It includes test cases to validate the views, data view models and data manipulation layers. -
Dependency Injection
The
DependencyInjectionTests
suite contains unit tests for the DependencyInjection module. It includes test cases to ensure the correct configuration and injection of dependencies in the project.
To visualize the dependency graph of the Alelo Challenge project locally, follow the steps below:
-
Run the following command to generate the dependency graph image:
make graph
Note: It's necessary to have Graphviz visualization software installed on your machine to generate the graph image. If you don't have Graphviz installed, run the following command to install it using Homebrew:
brew instal graphviz
-
After running the command, the dependency graph image will be generated and displayed.
-
Modularity
The project is developed with a modular approach, where each module has a clearly defined responsibility and is independent from others. This allows for proper separation of functionalities and better code organization.
-
Architecture
Alelo Challenge follows an MVVM (Model-View-ViewModel) based architecture. The MVVM architecture is an approach that separates the presentation logic from the user interface, facilitating code testability, reusability, and maintainability. In this architecture, the Model layer represents the data and business rules, the View layer is responsible for displaying the user interface, and the ViewModel layer acts as a bridge between the data and the user interface.
-
Project Generation
XcodeGen is a tool used in the project to generate the .xcodeproj file from a YAML configuration file. It simplifies the project configuration process by automating the creation of targets, schemes, and other Xcode-related settings, making continuous collaboration easier.
-
Resources Generation
SwiftGen is a tool used in the project to generate typed Swift code for resources such as images, strings, fonts, and colors. It analyzes the project's resource files and generates a series of enums and extensions that facilitate safe and typo-free access to resources.
-
Protocol Oriented Programming
The project utilizes the Protocol-Oriented Programming code pattern. POP allows for the creation of more generic, reusable, and flexible code by promoting code composition and modularity.
-
Use Cases
Use cases (providers) are used to decouple the usage rules from the View Models, achieving a more flexible architecture.
-
Clean Code
The Alelo Challenge project is developed based on the principles of Clean Code, which emphasize the readability, simplicity, and maintainability of the code. The code have atomic and cohesive functions and classes, descriptive names for variables and methods, avoiding duplication, and maintaining an easily understandable structure.