Giter Site home page Giter Site logo

okozolin / redux-toolkit-show-info-from-api Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 16.63 MB

Web app to fetch artists events data via public API. Managing global state with redux-toolkit. Responsive design with material-ui. Cool animations and transitions

HTML 4.41% CSS 1.03% JavaScript 94.56%
react redux redux-thunk createasyncthunk redux-toolkit createentityadapter data-normalization data-persistence performance-optimization animations material-ui responsive-design memoization

redux-toolkit-show-info-from-api's Introduction

Small web app to display Artists/Bands info & events”

🎸Try the app ⭐️

Home page preview

Requirenments

Home page:

  • Allow the user to search for an artist (Using ​this​ API. for app_id just use any random number)
  • Upon a good search result:
    • Display artist meta-data: name, image
    • Display a list of events that are related to the artist
    • Display the user’s “favorite” events

Upon selecting an event:

  • Navigate to a new page showing:
    • Event meta data
    • Event venue information
    • Special offers related to event
  • Add to favorites button
  • Display the venue location on a map

Upon selecting - add to favorites:

  • Add this event to the favorites list
  • Persist the favorites section, so that when the user refreshes he will see it again

Styling & UI

  • Styling with Material-ui
  • The app is responsive !

-

Here is a simple mock:

Home page

Home page preview

Events page

Home page preview

Implementation highlights

1. Code

  • Framework: React. Global state management : Redux-toolkit

  • Manage async API calls with redux-toolkit 'createAsyncThunk'

  • Use Data normalization pattern of { ids: [], entities: {}} with redux-toolkit 'createEntityAdapter'

  • Material-ui components composition

    • Read about caveats with inline function as an argument for the component prop here
    • Example: I used react-router-dom 'Navlink' componet as replacing component property with 'Button' , 'ListItem', 'CardActionArea'
  • Application flow is controled by URL. Meaning, you can fetch info by simply typing the correct url. e.g. "localhost:3000/beyonce"

  • Home page preview

  • Performance:

    • Built in selector function memoization with 'createEntityAdapter'
    • Use 'memo' to memoize components when needed
    • When possible, 'store' data is used instead of new fetch in cases where artist has not changed (e.g. back to artist page from event page)

2. Responsive UI

  • Menu buttons change shape when screen get smaller
  • Menu buttons turn to just icons in mobile
  • Search field size and position adjust to the change of screen size
  • Artist image size changes (smaller) in mobile
  • 'Ticket' button is not displayed in mobile
  • Home page preview

3. UI/UX

  • Show badge number of total exiting favorite items
  • Home button
  • Remove favorites button in favorites list
  • Go to event page from favorites list
  • Gradient color buttons style change on hover
  • Display an animated placeholder of artist image before it gets loaded
  • Home page preview

4. Animations

  • Hover my name...🤩
  • Beating heart as favorite, in event page
  • Display an animated placeholder of artist image before it gets loaded
  • Home page preview

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

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.