Giter VIP home page Giter VIP logo

fresh-cup-of-joe's Introduction

☕️ Fresh cup o' joe

When you need that fresh cup of joe in the morning...

Goal

Build an auto-updating twitter-like feed.

Feature Requirements

I want to run an auto-updating twitter-like feed. Here is a rough mockup of the expected UI.

mockup

  1. The app should show the latest tweets after the first request
  2. The list of tweets should update automatically every two seconds
  3. The older tweets must be pushed down in the page
  4. The newer tweets should come at the top
  5. There should be no duplicate tweets on the page
  6. There should be no skipped or missed tweets on the page
  7. In case of any failure conditions, the tweet updates can pause or stop but should resume as soon as possible and no error messages should be shown to the user

Extra Credit

  1. The app should stop refreshing as soon as the user scrolls down
  2. The app should resume refreshing as soon as the user is back at the top
  3. The app should fetch older tweets when the user reaches the bottom

API Specification

API Info

  1. The API returns a JSON response and supports CORS
  2. The JSON response contains the username, id, timestamp, image and text
  3. The API is designed to fail randomly with HTTP 50X errors (e.g. 500, 503 etc.) and you must handle this in your code. If it fails just try to fetch the updates again.

API Endpoints

/api/tweets

Returns all tweets.

/api/reset

Regenerates all fake tweets.

Technical Requirements

  1. You don’t need to focus on the UI too much, a barebones version will do just fine
  2. You can choose any technology stack you are comfortable with
  3. Please don’t make any additional efforts on writing tests etc
  4. We will be reviewing your code on the following criteria:
    1. Architecture decisions made
    2. Readability of your code
    3. Handling of edge cases, performance issues, including request efficiency and stability of the web app

Running the app

# Build
docker compose build

# Start
docker compose up -d

# Shut down
docker compose down -v

The app will be available at http://localhost:3001 or http://localhost:1234 if you're updating the frontend.

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.