Shlizer / recruit-car_customization

Car customization UI program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Car customization

screen

Usage

To start project simply clone it on your disc: git clone https://github.com/Shlizer/car_customization.git

Then go to project directory and install all dependencies using npm or yarn: npm instal yarn

At last to start project simply use npm run start or yarn start

It's possible also to run both frontend and backend parts separately using prefixes like so: npm run start:frontend or npm run start:backend yarn start:frontend or yarn start:backend

It's important to have port 4000 opened for backend app. If it's impossible please change it in backend/src/index.js express listening port and in proxy line in frontend/package.json.

Project requirements

  • Project should use React and Redux
  • Data should be provided asynchronously from external source
  • Dynamic layout from given data
  • Fetching car list and car parts
  • Each car can have different compatibility with other parts
  • Each gearbox have different compatibility with gearboxes
  • Calculating price for all selected parts and presenting summary

How it's made

Front- and backend

Project is divided into two separate elements, that can be even further split into two repositories and developed separately. First one - backend, is just regular Express server that provides all needed data from our fixed database. Second, frontend that is, fulfill the representation of data. It's made of React+Redux with HMR.

Layout creation

Page layout is created from provided DB data. I'm using simple component manager to load proper react components where given scheme puts them. There is even possibility to add own attributes to those elements such as style, className and so on.

Part compatibility

Each parts (and I'm counting car model as parts too) has it's own 'noFit' array of elements that can reduce visible parts in the output screen and prevent selecting them alongside with this part.

Price calculation

Every part has it's own prop called 'price'. After selecting each element I'm just summing up all selected parts, so user can see final result. I also provided on hover all part costs individually.

Possibilities

This project have some easy to upgrade parts such as all layout colors are stored in css variables so making basic color theming is easy. Also it's possible to add new part types - just add new entry in backend/src/db/parts.js and equivalent file with types in backend/src/db/parts/*.

Author and license

Author: Krzysztof 'Shlizer' Hinc License: MIT

About

Car customization UI program

License:MIT License


Languages

Language:JavaScript 61.8%Language:CSS 36.7%Language:HTML 1.5%