Giter Site home page Giter Site logo

dcard-reader's Introduction

This project was bootstrapped with Create React App and TypeScript template.

Dcard Reader

A webapp that imitate Dcard app. Using Virtualized List and lazy data-loading to enhance app performance. code style: prettier FOSSA Status

image

Installation

$ git clone https://github.com/kylemocode/dcard-reader.git
$ cd dcard-reader
$ npm install && npm start (or using yarn instead)

Features:

  • Virtualized List
  • Infinite Scroll
  • Lazy Load
  • Performance
  • Proxy Server

Virtualized List

Use react-window to achieve virtualized list which is a react components for efficiently rendering large lists and tabular data.As the Chrome Performance Monitor, It took less than 4.2MB JS heap size, 350 DOM nodes on initial renderer, and of course, it's responsive.

Infinite Scroll && Lazy Load

Use IntersectionObserver API to achieve infinite scroll and only load more data while scrolling to current bottom boundary.

Performance

In addition to lazy-loading data, dcard-reader also use react core functions to enhance app performance, such as React.memoใ€useCallbackใ€useMemo...etc.

Proxy server

To solve CORS problem in dcard 3rd-party-API, I choose to build my own backend proxy server which powered by express.

Source Code File Structure

src
โ”œโ”€โ”€ api
โ”‚   โ””โ”€โ”€ proxy.ts
โ”œโ”€โ”€ constant
โ”‚   โ””โ”€โ”€ api.ts
โ”œโ”€โ”€ hook
โ”‚   โ””โ”€โ”€ useFetchPost.tsx
โ”œโ”€โ”€ utils
โ”‚   โ””โ”€โ”€ media.ts
โ”œโ”€โ”€ components
โ”‚   โ””โ”€โ”€ LoadingPlaceHolder
โ”‚   โ””โ”€โ”€ PostItem
โ”‚   โ””โ”€โ”€ PostModal
โ”‚   โ””โ”€โ”€ PostContainer
โ”‚   โ””โ”€โ”€ ResponseInfo
โ”‚   โ””โ”€โ”€ TopicLabel
โ””โ”€โ”€ App.tsx
โ””โ”€โ”€ index.css
โ””โ”€โ”€ index.tsx
โ””โ”€โ”€ serviceWorker.ts

Roadmap

  • UI/UX (More Features)
  • Increase Unit Test Coverage
  • CICD Pipeline

FOSSA Status

dcard-reader's People

Contributors

oldmo860617 avatar kylemocode 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.