Code Monkey home page Code Monkey logo

breedapp's Introduction

Dog Breed App

This app fetches and displays information about dog breeds using the Dog API.

Getting Started

  1. Clone the repository:
    git clone [...]

Open the project in Xcode. Run the app in a simulator or device.

BreedApp Project Overview

Project Structure

The app's codebase is organized into distinct sections, each serving a specific purpose:

  • Utils/: Utilities like CacheManager.swift for caching, aiming to improve performance and support offline usage.

  • Models/: Defines DogBreed and other models, central to our app's data handling.

  • ViewModels/: Implements the MVVM pattern with classes such as DogBreedListViewModel, ensuring a clear separation between our app's logic and its presentation.

  • Views/: SwiftUI views (DogBreedListView, etc.) that render the user interface, designed to be both functional and intuitive.

  • Services/: The DogBreedService class and others encapsulate all networking logic, keeping it separate from UI code.

  • BreedAppTests/: Contains unit tests, including mocks and test cases for ViewModels and Services, to verify the app's reliability and behavior.

Key Features and Decisions

  • Caching: We opted for UserDefaults with a simple cache invalidation strategy to enhance data retrieval speed and offer basic offline functionality.

  • Concurrency: Embraced Swift's async/await for network communication, aiming for cleaner and more readable asynchronous code.

  • Architecture: Chose the MVVM design pattern to promote a clean separation of concerns across our app's structure.

Our Approach to Quality

We've strived to maintain high code quality by:

  • Prioritizing essential features and robust implementations.
  • Adhering to Swift and SwiftUI best practices.
  • Designing with future extensibility in mind.

Core Functionality

  • Show a screen with a list of dog breeds images.
    • Implemented in DogBreedListView.
  • Show a screen with a list of dog breeds when you search by breed name.
    • Implemented in DogBreedSearchView with live search functionality.
  • Show a screen with the detailed view of a breed.
    • Implemented in DogBreedDetailView.

UI/UX Requirements

  • Use a Tab Bar to switch between the list of dog breeds and the search screen.
    • Implemented with a TabView at the root level.
  • Ability to move from a list view into a grid view and take use of pagination.
    • Implemented in DogBreedListView with a toggle for list/grid view and pagination.
  • Ability to order alphabetically.
    • Implemented in DogBreedListView with a sort button.
  • Show only the dog breed image and the name in the list/grid view.
    • Implemented in DogBreedView.
  • Pressing on one of the list elements goes to the details view.
    • Implemented with NavigationLink in DogBreedListView and DogBreedSearchView.

Additional Features

  • Search Bar to search by breed name.
    • Implemented in DogBreedSearchView with debouncing.
  • List of results in search shows Breed Name, Group, Origin.
    • Assuming implementation based on available data. Display customization might be needed based on the actual model and UI design.
  • Details view contains Breed Name, Category (assuming 'group' or 'designation'), Origin, and Temperament.
    • Implemented in DogBreedDetailView.

Bonus Points

  • Unit tests coverage.
    • Provided examples for testing view models: DogBreedListViewModelTests, DogBreedDetailViewModelTests, and DogBreedSearchViewModelTests.
  • [Partialy] Offline functionality.
    • Covered with a cache strategy and UserDefault. Consider implementing caching with Core Data or UserDefaults. **ps found a bug on image-cache 🐞
  • Error Handling.
    • Basic error handling implemented in view models with loading and error message states.

Deliverable

  • Create a complete project in a version-controlled repository.
    • Ensure the project is committed to a Git repository.
  • Perform several commits to show progress.
    • Commit history should reflect the development progress and implementation details.
  • Share the repository link.
    • Make the repository public and prepare to share the link.

Final Steps

  • Review and refine the UI/UX design. Ensure the app's interface is intuitive and visually appealing.
  • Conduct thorough testing on different devices and OS versions. Ensure compatibility and smooth operation across a range of conditions.
  • Optimize performance. Ensure that the app runs smoothly, especially when handling large lists and performing searches.
  • Prepare documentation. Include a README with setup instructions, features, and any other relevant information.

linkedin.com/in/fredericobezerra [email protected] freddneos

breedapp's People

Contributors

freddneos avatar

Stargazers

 avatar  avatar

Watchers

 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.