Coder Social home page Coder Social logo

books-catalog's Introduction

Books Catalog

Getting started

  1. Navigate to the root of the repo
  2. Start books microservice with command: ./start.sh books
  3. Once you see, server ready message, you can navigate to GraphQL Explorer to query your server.
  4. Once your server is running, in a different terminal window, start react client: ./start.sh client and navigate to React Application

Other commands:

  1. Start db: ./start.sh db (note that ./start.sh books already handles this for you)
  2. Run lint for entire project: ./start.sh lint
  3. Run UTs + Snapshots for client, ITs for microservice: ./start.sh test

Problem Statement

Implement a books catalog. The website should contain two views:

The list of available books, on this page you should be able to view all available books, please skip pagination

  1. Book's page, on this page you can see extra books' fields.
  2. Book's fields:
    1. Title
    2. Year
    3. Description

Demo

App Demo

Goal

Build a books catalog covering as much of the following :

  • React
  • TypeScript
  • NodeJS
  • Express
  • Jest
  • Styled Components (using TailwindCSS instead)
  • gRpc
  • Type-GraphQL
  • Lerna
  • Antd
  • PostCSS
  • SSR (using Next.JS)
  • MongoDB
  • Docker
  • Nginx
  • RabbitMQ
  • Redis

Important Notes

Kubernetes and Skaffold for Orchestration

Since this was also built with a microservices (msvcs) first approach - some orchestration mechanism was required. Given that the project needed to be portable (i.e. self-contained and no provisioning of AWS resources or other such costs):

  • I've gone with local k8s (docker desktop with k8s enabled)
  • Skaffold for management of resources and hot reloading of containers

It's important to note that local development with this setup was incredibly heavy (90+% of memory consumption on my local machine). Both for end-to-end development of msvcs, and for automated CICD provisioning of PR environments, we should prefer cloud k8s like EKS with GitOps based provisioning of resources.

After some experimentation, I finally set up an alternative, much easier setup which can be readily containerized if need be.

State Management Layer

Options for state management:

  1. Redux (Redux Toolkit) + Saga - Redux DevTools is a big plus here
  2. RxJS Subjects - personal preference for mid-sized project, esp. because cleaner paradigm

Having worked with React and Angular in the past, the state management solution takes inspiration from the best of both worlds and uses RxJS subjects at its core.

Microservices Communication (EventBus Integrations)

As we start adding more msvcs, we need to integrate some eventing mechanism for cross msvc communication.

Options:

  1. AWS SQS - past experience + comfort pick
  2. NATS Streaming Server - Easy to integrate as a self-contained k8s resource
  3. RabbitMQ - need to try
  4. Kafka - need to try

books-catalog's People

Stargazers

 avatar

Watchers

 avatar  avatar

books-catalog's Issues

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.