Coder Social home page Coder Social logo

hire-hoffee / news-list Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.06 MB

Приложение-агрегатор новостей

Home Page: https://news-list-app-six.vercel.app

JavaScript 0.55% TypeScript 66.41% CSS 33.04%
cssmodules frontend guardian-api nextjs react redux-toolkit ssr typescript

news-list's Introduction

Newsreader App

Simple two-page SPA application for news browsing using Guardian API.

Functionality:

  • Main page:

    • Display news cards.
    • Search for news by keyword.
    • Sort news by relevance and date.
    • Customize the number of displayed news items on the page.
    • Infinite scrolling (loading news when reaching the end of the page).
    • Storing the page state in Redux.
    • Loading data from backend via Redux async thunk.

Main page

  • News page:
    • Display full news text with correct formatting (headings, paragraphs, lists, quotes, images).
    • Display news date, illustration (if available), link to original article and back button.
    • Server Side Rendering.

News page

Technologies:

  • Frontend: Next.js, TypeScript, Redux Toolkit, CSS Modules

  • Backend: Guardian API: REST API for news content.

Layout Requirements:

  • Adaptive layout (up to 320px).

How it works:

  1. Main page:

    • When the page loads, the app makes a request to the Guardian API using the search, sort, news count and page number parameters stored in the Redux store.
    • The resulting data is stored in the Redux store and displayed as news cards.
    • Scrolling down the page triggers a handler that makes a request for the next chunk of data, if available.
    • The user can interact with UI elements (search, sorting, number of news items) by changing the state of the Redux store, which causes the component to re-render and update the data.
  2. News page:

    • When navigating to the news page, Next.js pre-requests server-side news data using the news id from the URL.
    • The resulting data is used to render the page on the server, making it load faster and improving SEO.
    • The page displays the full text of the news, formatted with HTML tags and CSS styles.

news-list's People

Contributors

hire-hoffee avatar

Watchers

 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.