Giter Site home page Giter Site logo

server-side-cache-tutorial's Introduction

Server-Side Cache Example with ExpressJS and React

This project demonstrates the implementation of a server-side cache to enhance the performance of a web application that interacts with an external API to fetch and display data. In this example, we've built a simple application using ExpressJS and React that fetches Pokémon data from an API and displays it using a React frontend.

Introduction

Implementing a server-side cache can significantly reduce the load times and enhance the performance of applications dealing with large volumes of data or frequent data access. This example showcases a basic file-based caching system that stores JSON responses for Pokémon data fetched from the PokeAPI.

Prerequisites

Before you start, ensure you have the following installed:

  • Node.js
  • npm (Node Package Manager)

Installation

To set up the project on your local machine:

  1. Clone the repository:

    git clone https://github.com/latitude-dev/server-side-cache-tutorial.git
    cd server-side-cache-tutorial
  2. Install dependencies for the server:

    cd server
    npm install
  3. Install dependencies for the client:

    cd ../client
    npm install

Running the Application

To run the server and the client applications:

  1. Start the server:

    cd server
    npm run start
  2. In a new terminal, start the client:

    cd client
    npm run start

The server will be running on http://localhost:4000, and the client will be accessible through http://localhost:3000.

Usage

Once both the server and client are running:

  • Navigate to http://localhost:3000 in your web browser.
  • You can view Pokémon data by entering a Pokémon ID into the input field and clicking the search icon.

The application will display the Pokémon data fetched from the server, utilizing the server-side cache to speed up subsequent requests for the same data.

Acknowledgements

  • This project utilizes data from PokeAPI.

Tutorial

For more information about this project, check out the tutorial.

server-side-cache-tutorial's People

Contributors

csansoon avatar

Watchers

Andrés 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.