Giter VIP home page Giter VIP logo

advisor-list's Introduction

Advisor list

The application is developed from scratch (not using create-react-app tool that is deprecated by the React team).

For initial rendering content is generated on server side and then a client side script will be loaded to execute hydration and make web page interactive. This approach gives better initial load time and has better search engine optimization (SEO) compared to CSR.

The app can be easily changed to CSR via fetching advisor list from client side. To show loading state during asyncronous network reqests React provides a built-in React component Suspense.

What has been done

  • Sort advisors by number of reviews
  • Filter advisors by status and language
  • Nice look and feel
  • Basic testing
  • Use a node.js server to serve data to the client
  • Provide basic documentation: how to run the app, what trade-offs were made and why
  • Advanced tests: user interactions
  • Write in typescript in strict mode
  • Set up CI on Github Actions for PRs
  • Use faker.js to generate test data

Here is how the app looks like: app

Test coverage report: tests

Prerequisites

The application requires Node v18.0.0, npm v9.6.1, Docker Desktop, MongoDB Compass.

Installation

Install it from GitHub using the following commands

  • git clone [email protected]:allinne/advisor-list.git
  • cd advisor-list
  • npm i install all dependencies

Running / Development

  • docker-compose up start Docker with MongoDB
  • npm run dev:server launch the backend
  • open MongoDB Compass - optional, to check wheather DB is filled or not
  • npx tsnd src/dev/load-test-data.ts fill database with autogenerated data
  • npm run dev:bundler launch the frontend - optional, for local development
  • visit the app at http://0.0.0.0:8080

Running Tests

  • npm run test unit and integration tests
  • npm run cypress e2e tests

Linting

  • npm run lint:js

todo

  • add Reset filtering and sorting button;
  • add sorting by Advisor Name;
  • use renderToPipeableStream instead of renderToString. Streaming method can stream content in chunks as it resolves on the server so that the user sees the page being progressively filled in before the client code loads.
  • add infinity pagination using Intersection Observer API;
  • split CSS to critical and non-critical and set up in the Webpack config style-loaderand css-loader.

advisor-list's People

Contributors

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