esteros Svelte Themes

Esteros

Simple online ice cream shop with 3 microservices showcasing the power of Redis Stack.

Esteros

Esteros is a microservices demo application. Esteros consists of 4 microservices applications and a front-end. This app is a web-based online ice cream shop where users can search for the ice cream they like, add it to their cart, and purchase it.

This app was created to demonstrate the use of Redis and Minio in modern microservices based web development.

Click here for more screenshots.

How it works

Architecture

Esteros is composed of 4 microservices written in TypeScript (Node.js) that talk to each other over Redis Pub/Sub.

Service Language Description
front-end Svelte (TypeScript) Exposes an HTTP server to serve the website. Does not require signup/login and generates cookie-based session IDs for all users automatically.
api-gateway Node.js (TypeScript) Connecting all back-end microservices into one REST API.
product-service Node.js (TypeScript) Provides the list of products from a RedisJSON and ability to search products and get individual products.
cart-service Node.js (TypeScript) Add the product to the Redis Cache for a user with a specific session ID, then make it available for that user.
order-service Node.js (TypeScript) Create an order from an existing cart with a mocked data.

How to run it locally?

To run this app in local environment, you can use below method.

Prerequisites

  • Git - Latest stable version is recommended.
  • Node.js - v16 or higher
  • pnpm - v7.8.0 or higher
  • Docker Compose (or Podman Compose) - v1 or higher

I personally use Podman Compose to manage all the Containers, but you should also be able to use Docker Compose as they both have similar APIs.

Local installation

  1. Using the terminal of your choice, please move to the directory you want to run this application.

    cd <your-dicrectory>
    
  2. Clone this repository, and move to the cloned folder.

    git clone -b main --depth 1 --single-branch https://github.com/hapakaien/esteros.git && cd esteros
    
  3. Run all necessary containers with Docker Compose.

    docker-compose up -d
    
  4. Create a bucket named "local" in Minio by visiting http://localhost:8900, and make it public access.

  5. Upload all initial data to Redis and Minio.

    pnpm run setup
    
  6. Install all dependencies in this monorepo.

    pnpm install
    
  7. Build all code.

    pnpm build
    
  8. Run the application that you built earlier.

    pnpm start:prod
    
  9. Now you can visit http://localhost:8080 to try this app.

More Information about Redis Stack

Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.

Getting Started

  1. Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. Redis Stack getting started page - Lists all the Redis Stack features. From there you can find relevant docs and tutorials for all the capabilities of Redis Stack.
  3. Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
  4. RedisInsight - Desktop GUI tool - Use this to connect to Redis to visually see the data. It also has a CLI inside it that lets you send Redis CLI commands. It also has a profiler so you can see commands that are run on your Redis instance in real-time
  5. Youtube Videos

Top categories

Loading Svelte Themes