Code Monkey home page Code Monkey logo

twitter-bm-reader's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dinoopm

twitter-bm-reader's Issues

Error handling.

Error handling in the frontend if fetch fails.
Create 404 page.
Handle api errors with proper status code and message.

Basic plan for the app

This is a basic idea of the different routes and what should be handled.

  • /

    • New user(cookie username is unset)
      • Redirect to /connect/twitter/
    • Existing user (cookie username is set)
      • Redirect to /:username/ (:username is username)
  • /connect/twitter/

    • Redirect to /twitter/authorised/
  • /twitter/authorised/

    • If success
      • Fetch latest 50 tweets
      • get latestSyncedTweetId from first item in response
      • Save user object with tokens, latestSynceTweetId and tweets
    • If failed
      • Render error page with proper message

    Note: if direct hit from client, check for tokens in session. If not present, render error page.

  • /:username/

    • Check if username in db
      • If found
        • Set bmr_reader cookie to username.
        • Render the web app.
      • If not found
        • Redirect to /
  • /:username/profile/

    • Check if username in db
      • If found
        • Get profile from api
          • If success
            • Return
          • If failed
            • Respond with error.
      • If failed
        • Return with not authorized or proper error.
  • /:username/tweets/

    • Check if username in db
      • If found
        • Get last 50 tweets from db
          • If success
            • Return
          • If failed
            • Respond with error.
      • If failed
        • Return with not authorized or proper error.

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.