Giter VIP home page Giter VIP logo

podcasts-app's Introduction

podcasts-app-ts

React / Typescript SPA - Showing the latest popular podcasts


Description

This is a simple React / Typescript SPA that shows the latest popular podcasts in iTunes. The app uses the iTunes RSS Api to fetch the data.


Features

  • The app shows the top 100 podcasts in the iTunes API
  • The user can filter the podcasts by title
  • The user can click on a podcast to see more details
  • The user can see the podcast's author, title, image, and summary
  • The user can see the podcast's episode list
  • The user can play directly the podcast from the app

Technologies

  • React 18
  • Typescript
  • Next.js (for server-side rendering, routing and image optimization)
  • React-query (for data fetching, cache, and disabling unnecessary fetching)
    • Using cache on data fetches the app feels more responsive specially when returning to previously visited pages. The cache is set to 24 hours (1 day).
  • Eslint (for linting on local development)
  • Prettier (for code formatting)

Architecture

The project is structured in a modular way, with separate directories for components, constants, contexts, hooks, providers, screens, services, and utilities.

This makes the codebase easier to navigate and maintain. This also allows for better separation of concerns, reusability and easier testing.

All of this will help for future expansion (scalability) or for changing technologies / implementations if needed.

For state management I'm only using React Context API with useState hook combined with React-Query, this is enough for the size of the project by now, but if the project keeps growing we could combine it with useReducer hook or an external state management library like Redux.

For fetching data I'm only using the Fetch API as a HTTP client, but again, if the project keeps growing or for better compatibility in older browsers I would recommend using Axios. The cache is handled by React-Query, allowing for better performance and less unnecessary fetching.

Routing, Navigation handled by Next.js using the App router and the useRouter hook. The App router allows setting layouts for the whole app like the header, or for specific sections like the podcast detail sidebar.

Testing is done with Jest and React Testing Library. The tests are located in the same directory as the component they are testing, this makes it easier to find and maintain the tests.


Room for improvements

  • Improve test coverage
  • Make use of full server side rendering without affecting the perceived performance
  • Show more information about the podcast like genre, release date, etc.
  • Add additional filters like by author, genre, etc.
  • Add filters to the episode list
  • Include other data sources like Spotify, Google Podcasts, etc.
  • Allow the user to add podcasts / episodes to a favorites list
  • Allow the user to create playlists
  • Create a player component that allows the user to play the podcast while navigating the app
  • Add a dark mode

>>> Try it out deployed here <<<


Installation

  1. Clone the repository
  2. Create a .env.local file in the root of the project following the structure of the .env.example file
    • A default config is already provided in the .env.example file
  3. You need Node.js installed. I recommend using NVM github repository
  4. Make sure you have yarn configured. If not, check the yarn getting-started guide
  5. Run yarn install to install the dependencies

Available Scripts

In the project directory, you can run:

yarn dev

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.

yarn test

Runs the tests in the project.

yarn lint

Runs the linter in the project.

yarn build

Builds the app for production to the ./next folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

yarn start

Runs the app in the production mode.
Requires the app to be built first with yarn build.
Open http://localhost:3000 to view it in the browser.

podcasts-app's People

Contributors

ianchez 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.