GithubHelp home page GithubHelp logo

lauslim12 / countries-holidays Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 138 KB

Find out holidays from over 90 countries! React 18 features showcase: concurrency, transitions, deferred values, caching, suspense, suspense data fetching, prefetch, and error boundary.

Home Page: https://countries-holidays.vercel.app/

License: MIT License

TypeScript 94.96% JavaScript 5.04%
data-fetching material-ui nextjs react-testing-library reactjs swr typescript

countries-holidays's Introduction

Country Holidays

Find out holidays and special days from over 90 countries! Developed to showcase React 18 features: concurrency, transitions, deferred values, caching, suspense, suspense data fetching, prefetch, and error boundary. Tested with React Testing Library.

The application is intentionally kept simple and straightforward to focus on the core concepts. The design is made with MaterialUI to quickly bootstrap a new beautiful page. The project structure is inspired from React Redux's project structure, which is to separate everything by domain and place our required components inside the relevant folder. Files are in kebab-case, unless for React components, they are in PascalCase.

Features

For the user-facing side, these are the only features:

  • You can see a list of available countries.
  • You may click on the Detail text button to open a drawer describing the country's holidays and information.

In the technical side, it is quite more complicated than it seems.

  • Data fetching is done by using stale-while-revalidate for prefetch, real-time, polling, revalidation and caching.
  • Error boundaries are implemented to prevent unknown errors and to fallback gracefully.
  • Transitions and deferred values are used in the search bar to prevent lag when searching for a certain country.
  • Tests are done by React Testing Library to ensure reliability, integrity, and accuracy.
  • Concurrent React (React 18) is the normal mode of the application; we are always batching requests and performing optimizations whenever possible.

Requirements

Usage

To use this application, you have to:

  • Clone this repository and switch to it.
git clone [email protected]:lauslim12/countries-holidays.git
cd countries-holidays
  • Install all dependencies.
yarn --frozen-lockfile
  • Run application with the development mode.
yarn dev
  • If you need the production build, you can build by using a single command. Don't forget to run it to unleash the power of React 18!
yarn build
yarn start
  • Don't forget to look at tests! Use the below command to unleash the full tests.
yarn test-ci

Credits

License

MIT License.

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.