/xengine-frontend

Frontend for a full-stack e-commerce project - off-road equipment store. PERN stack.

Primary LanguageTypeScript

🛞 XEngine Store Project – Frontend

This is my full-stack e-commerce shop project. Backend is located in this repository. I've used PERN (PostgreSQL + Express + ReactJS + NodeJS) stack with some additional technologies (TypeScript, Tanstack Query, MobX, JWT Authorization etc.) which will be mentioned later in this document.

Introduction

This is a full-fledged shop project, here I've implemented JWT authentification (token stored in the browser's local storage) and two user roles - ADMIN and USER. As an unauthorized user you can:

  • Navigate to main page and take a look at the popular vehicles or check the whole vehicles list.
  • Navigate to vehicle page by pressing on it on the main page and checking its characteristics.
  • Sort vehicles by type, brand, name or price.

Anauthorized user shop view

As an authorized USER you can:

  • Add and remove items from cart, navigate to cart page where all added vehicles are presented (+ total amount of $ is calculated).

Item added to cart

Cart page

  • Rate vehicles (by the way, vehicle rating is calculated as an average value of different users rates).

Vehicle page, setting rating

  • Logout to end the session (also worth noticing, that JWT token is stored in the local storage and it's valid for 1H, so even if user refreshes the page he will not have to log in again, whereas when logout button pressed -> token gets deleted and seesion is ended).

Small video which shows how user can basically interact with this app:

Overview.mp4

As an ADMIN you can:

  • Navigate to AdminPanel and add new brands, types and vehicles.

Navigate to Admin Panel controls

Admin Panel

Create vehicle pop-up

This is how this process looks like:

CreateTypeAsAdmin.mp4

To optimize image loading process I've created <LoadableImage /> component, it will load image only if it is visible, if it is visible but not fully loaded - it will show skeleton loading animation:

ImageLoading

Moreover, there are lots of smooth animations and dialog / info pop-ups to make better UX. To read more information about technical side of this app check README.md in the backend repository.

Animations

Tech stack

  • Vite
  • MobX as a state manager
  • React
  • TypeScript
  • React Query (Tanstack query) + axios
  • SCSS
  • Iconify