Giter VIP home page Giter VIP logo

foodybite's Introduction

CI-iOS

Foodybite

๐Ÿ’ก My vision for this project is centered around a simple yet powerful way to create a user-friendly app that helps you find the best restaurant near you based on location, radius, and number of stars. Additionally, users can see details, like opening hours, address, reviews, or photos for each restaurant found and give a review. The app allows users to search directly for a restaurant and enables them to give a review right away.

  1. Motivation
  2. Installation Guide
  3. Demo Videos
  4. Tools
  5. Frameworks
  6. Concepts
  7. Architecture
    1. Overview
    2. Domain
      1. User Session Feature
      2. Update/Delete Account Feature
      3. Store/Retrieve User Preferences Feature
      4. Nearby Restaurants Feature
      5. Fetch Restaurant Photo Feature
      6. Restaurant Details Feature
      7. Autocomplete Restaurants Feature
      8. Add Review Feature
      9. Get Reviews Feature
      10. Location Feature
    3. Networking
      1. Refresh Token Strategy
      2. Network Request Flow
      3. Endpoint Creation
      4. Testing Data to Decodable Mapping
      5. Parsing JSON Response
    4. Places
    5. API Infra
      1. Mock Network Requests
    6. Persistence
      1. Cache Domain Models
      2. Infrastructure
      3. Store User Preferences
    7. Location
      1. From delegation to async/await
      2. Get current location using TDD
    8. Presentation
    9. UI
    10. Main
      1. Adding caching by intercepting network requests (Decorator Pattern)
      2. Adding fallback strategies when network requests fail (Composite Pattern)
      3. Handling navigation (flat and hierarchical navigation)
  8. Testing Strategy
    1. Summary Table
    2. Methodology
    3. Unit Tests
    4. Integration Tests
      1. End-to-End Tests
      2. Cache Integration Tests
    5. Snapshot Tests
  9. CI/CD
  10. Security
    1. API key for Google Places API
    2. Store Tokens from FoodybiteServer in Keychain
    3. Password Hashing
  11. Metrics
    1. Test lines of code per production lines of code
    2. Count of files changed
    3. Code coverage
  12. Credits
  13. References

Motivation

The initial spark of this project originated from my desire to dive deeper into SwiftUI since I had already been using the framework for testing purposes and was intrigued to use it in a larger project.

Once I had completed the UI, I challenged myself to design the app in the best possible way using all the best practices in order to create a high-quality, polished project and sharpen my skills. At the same time, my interest in TDD and modular design were emerging, that's the reason I only used TDD for all modules besides the UI, which I later used for snapshot tests. ๐Ÿ˜€

Through this process, I was able to significantly improve my TDD skills and acknowledge its value. First of all, it helped me understand better what I was trying to achieve and have a clear picture of what I wanted to test first before writing production code. On the other hand, the architecture seemed to materialize while I was writing the tests, and by using TDD, I could further improve the initial design.

You can find below the entire process I've gone through while designing this project, the decisions and trade-offs regarding the architecture, testing pyramid and security issues. Additionally, I've included some really cool metrics about the evolution of the codebase.

Thank you for reading and enjoy! ๐Ÿš€

Installation Guide

1. Setup Foodybite backend

2. Get your unique API_Key from Google Places

  • Go to Google Maps Platform to create a project
  • Create the API_KEY following the Use API Keys with Places API documentation page (make sure you restrict your key to only be used with Places API)
  • Create a property list called GooglePlaces-Info.plist in the FoodybitePlaces framework
  • Add a row with API_KEY and the value of your key

3. (Optionally) Install SwiftLint

  • run the following command in the terminal to install swiftlint
brew install swiftlint 

4. Validate the setup

Test that everything is wired up correctly by running tests for the FoodybiteAPIEndtoEndTests and CI targets to check the communication with both backends and validate that all tests pass.

Tools

  • โœ… Xcode 14.2
  • โœ… Swift 5.7

Frameworks

  • โœ… SwiftUI
  • โœ… Combine
  • โœ… CoreData
  • โœ… CoreLocation

Concepts

  • โœ… MVVM, Clean Architecture
  • โœ… Modular Design
  • โœ… SOLID Principles
  • โœ… TDD, Unit Testing, Integration Testing, Snapshot Testing
  • โœ… Composite, Decorator Patterns
  • โœ… Domain-Driven Design

Credits

This beautiful design was made available by Yagnesh P for free here: Foodybite Design. You can also find him on dribbble.com: Yagnesh P. Thank you, Yagnesh. ๐Ÿ™

References

  1. The iOS Lead Essential Program
  2. Clean Architecture by Robert C. Martin
  3. Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
  4. Dependency Injection Principles, Practices, and Patterns by Mark Seemann and Steven van Deursen
  5. Domain-Driven Design: Tackling Complexity in the Heart of Software
  6. Design It! : Pragmatic Programmers: From Programmer to Software Architect by Michael Keeling

foodybite's People

Contributors

marian-stanciulica avatar

Stargazers

Lal Krishna avatar

Watchers

 avatar

Forkers

zeljkolucic

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.