Giter VIP home page Giter VIP logo

essentialfeed_updated's Introduction

Essential Feed App – Image Feed Feature

Build Status

BDD Specs

Story: Customer requests to see their image feed

Narrative #1

As an online customer
I want the app to automatically load my latest image feed
So I can always enjoy the newest images of my friends

Scenarios (Acceptance criteria)

Given the customer has connectivity
 When the customer requests to see their feed
 Then the app should display the latest feed from remote
  And replace the cache with the new feed

Narrative #2

As an offline customer
I want the app to show the latest saved version of my image feed
So I can always enjoy images of my friends

Scenarios (Acceptance criteria)

Given the customer doesn't have connectivity
  And there’s a cached version of the feed
  And the cache is less than seven days old
 When the customer requests to see the feed
 Then the app should display the latest feed saved

Given the customer doesn't have connectivity
  And there’s a cached version of the feed
  And the cache is seven days old or more
 When the customer requests to see the feed
 Then the app should display an error message

Given the customer doesn't have connectivity
  And the cache is empty
 When the customer requests to see the feed
 Then the app should display an error message

Use Cases

Load Feed From Remote Use Case

Data:

  • URL

Primary course (happy path):

  1. Execute "Load Image Feed" command with above data.
  2. System downloads data from the URL.
  3. System validates downloaded data.
  4. System creates image feed from valid data.
  5. System delivers image feed.

Invalid data – error course (sad path):

  1. System delivers invalid data error.

No connectivity – error course (sad path):

  1. System delivers connectivity error.

Load Feed From Cache Use Case

Primary course:

  1. Execute "Load Image Feed" command with above data.
  2. System retrieves feed data from cache.
  3. System validates cache is less than seven days old.
  4. System creates image feed from cached data.
  5. System delivers image feed.

Retrieval error course (sad path):

  1. System delivers error.

Expired cache course (sad path):

  1. System delivers no feed images.

Empty cache course (sad path):

  1. System delivers no feed images.

Validate Feed Cache Use Case

Primary course:

  1. Execute "Validate Cache" command with above data.
  2. System retrieves feed data from cache.
  3. System validates cache is less than seven days old.

Retrieval error course (sad path):

  1. System deletes cache.

Expired cache course (sad path):

  1. System deletes cache.

Cache Feed Use Case

Data:

  • Image Feed

Primary course (happy path):

  1. Execute "Save Image Feed" command with above data.
  2. System deletes old cache data.
  3. System encodes image feed.
  4. System timestamps the new cache.
  5. System saves new cache data.
  6. System delivers success message.

Deleting error course (sad path):

  1. System delivers error.

Saving error course (sad path):

  1. System delivers error.

Flowchart

Feed Loading Feature

Architecture

Feed Loading Feature

Model Specs

Feed Image

Property Type
id UUID
description String (optional)
location String (optional)
url URL

Payload contract

GET *url* (TBD)

200 RESPONSE

{
    "items": [
        {
            "id": "a UUID",
            "description": "a description",
            "location": "a location",
            "image": "https://a-image.url",
        },
        {
            "id": "another UUID",
            "description": "another description",
            "image": "https://another-image.url"
        },
        {
            "id": "even another UUID",
            "location": "even another location",
            "image": "https://even-another-image.url"
        },
        {
            "id": "yet another UUID",
            "image": "https://yet-another-image.url"
        }
        ...
    ]
}

essentialfeed_updated's People

Contributors

hopsaheysa 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.