Skip to content

Metecode/TOYOTA-32bit-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 

Repository files navigation

Markdownify
Markdownify

Toyota Modernizasyon Projesi

This is a React project written using React.js, Context API, and hooks. It allows the user to enter and record a vehicle's error detection and keeps a list of these errors.

Vscode json git React react-router react-img-mapper react-simple-keyboard formik i18n Axios material MIT License

Demo

You can find the live demo here : https://toyota32bit.netlify.app Registration number: 99619 body no: 222 body no(defectlist): 55555 password: toyota

🚩 Contents

πŸ—ƒ Project Structure

TOYOTA-32bit-project
β”œβ”€ README.md
└─ toyota-web
   β”œβ”€ LICENCE
   β”œβ”€ package-lock.json
   β”œβ”€ package.json
   β”œβ”€ public
   β”‚  β”œβ”€ assets
   β”‚  β”‚  β”œβ”€ img
   β”‚  β”‚  β”‚  β”œβ”€ 87897.jpg
   β”‚  β”‚  β”‚  β”œβ”€ car.jpg
   β”‚  β”‚  β”‚  └─ cursor.gif
   β”‚  β”‚  └─ sound
   β”‚  β”‚     └─ AlertSirenSound.mp3
   β”‚  β”œβ”€ db
   β”‚  β”‚  β”œβ”€ 87897.json
   β”‚  β”‚  β”œβ”€ defectScreen.json
   β”‚  β”‚  β”œβ”€ HAT.json
   β”‚  β”‚  β”œβ”€ hataData.json
   β”‚  β”‚  β”œβ”€ hataDetay.json
   β”‚  β”‚  β”œβ”€ hataDetay2.json
   β”‚  β”‚  β”œβ”€ hataListesiData.json
   β”‚  β”‚  β”œβ”€ headerData.json
   β”‚  β”‚  β”œβ”€ largeFont.json
   β”‚  β”‚  β”œβ”€ largeFont2.json
   β”‚  β”‚  β”œβ”€ shiftInfo.json
   β”‚  β”‚  β”œβ”€ shifts.json
   β”‚  β”‚  └─ terminal.json
   β”‚  β”œβ”€ favicon.ico
   β”‚  └─ index.html
   └─ src
      β”œβ”€ App.css
      β”œβ”€ App.js
      β”œβ”€ components
      β”‚  β”œβ”€ form
      β”‚  β”‚  β”œβ”€ DatePicker.js
      β”‚  β”‚  β”œβ”€ Input.js
      β”‚  β”‚  β”œβ”€ InputPassword.js
      β”‚  β”‚  β”œβ”€ Select.js
      β”‚  β”‚  └─ Textarea.js
      β”‚  β”œβ”€ LangSwitcher
      β”‚  β”‚  β”œβ”€ index.css
      β”‚  β”‚  └─ index.js
      β”‚  β”œβ”€ PrivateRoute.js
      β”‚  β”œβ”€ TerminalTable.js
      β”‚  └─ VirtualKeyboard
      β”‚     β”œβ”€ index.css
      β”‚     └─ VirtualKeyboard.js
      β”œβ”€ context
      β”‚  β”œβ”€ AuthContext.js
      β”‚  β”œβ”€ defaultContext.js
      β”‚  └─ index.js
      β”œβ”€ fonts
      β”‚  β”œβ”€ 404.css
      β”‚  β”œβ”€ carMapper.css
      β”‚  β”œβ”€ hataGiris.css
      β”‚  └─ hataListesi.css
      β”œβ”€ index.js
      β”œβ”€ localeStorage.js
      β”œβ”€ pages
      β”‚  β”œβ”€ 404.js
      β”‚  β”œβ”€ Auth
      β”‚  β”‚  β”œβ”€ AuthLayout.js
      β”‚  β”‚  β”œβ”€ login.css
      β”‚  β”‚  └─ Login.js
      β”‚  β”œβ”€ ErrorEntry
      β”‚  β”‚  β”œβ”€ CarMapper.js
      β”‚  β”‚  β”œβ”€ ErrorEntryPage.js
      β”‚  β”‚  β”œβ”€ ErrorHeaderBar.js
      β”‚  β”‚  └─ LargeFont.js
      β”‚  β”œβ”€ ErrorList.js
      β”‚  β”œβ”€ Terminal.js
      β”‚  └─ TerminalLayout.js
      β”œβ”€ routes.js
      β”œβ”€ translation
      β”‚  β”œβ”€ index.js
      β”‚  β”œβ”€ locales.js
      β”‚  β”œβ”€ messages
      β”‚  β”‚  β”œβ”€ de-DE.js
      β”‚  β”‚  β”œβ”€ en-US.js
      β”‚  β”‚  β”œβ”€ fr-CA.js
      β”‚  β”‚  β”œβ”€ index.js
      β”‚  β”‚  β”œβ”€ ru-RU.js
      β”‚  β”‚  └─ tr-TR.js
      β”‚  β”œβ”€ provider.js
      β”‚  └─ translate.js
      β”œβ”€ utils.js
      └─ validations
         β”œβ”€ index.js
         β”œβ”€ LoginSchema.js
         β”œβ”€ LoginSchema2.js
         └─ Validation.js

(πŸ”)

🧰 Getting Started

‼️ Prerequisites

This project uses Npm as the package manager.

 npm install npm@latest -g

βš™οΈ Installation

Install my-project with npm

  npm install my-project
  cd my-project

πŸ§ͺ Running Tests

To run tests, run the following command.

  npm test

πŸƒ Run Locally

Clone the project

  git clone https://github.com/Metecode/TOYOTA-32bit-project.git

Go to the project directory

  cd my-project

Install dependencies

  npm install

Start the server

  npm start

Pull Request

Before uploading your PR, run test one last time to check if there are any errors. If it has no errors, commit and then push it!

For more information on PR's steps, please see links in the Contributing section.

(πŸ”)

πŸ’» Pages

Terminal Page

  • This is a page that lists all terminals. It is dynamically populated based on the data received from the service.
  • In the top left corner, there is a language switch button. By default, the Turkish language option is selected.

image

Login Page

  • My application starts with a login page upon initial entry.
  • With a minimal mock service, it displays alert snackbars to warn about unsuccessful or incorrect login attempts.
  • Shift data is dynamically fetched from the service and initially comes with a pre-selected shift, which changes the background color accordingly.
  • The terminal list is fetched based on the selected filter, and the terminal list is prominently displayed to the user when the page is first opened.
  • The date is always up-to-date and represents the current day.
  • It features a multilingual virtual keyboard.
  • Paths dynamically change based on the selected filter.

image

Defect Login Page

  • Based on the data received from the service, the boxes on the car are dynamically positioned.
  • If the user doesn't perform any action for 80 seconds, a disruptive alarm sound is played.
  • When a box is clicked and it is blue, it transitions to a lower image.

image

  • After selecting the area where the error is located in the lower image, a list of error types opens dynamically.

screen-recording-5

  • After selecting the error type, the error recording button becomes active.
  • Error location selection is made.

screen-recording-6

  • When the user clicks on the error recording button, a error recording form appears on the screen and the user enters the error information there.
  • When the save button is clicked, UI blocking is activated, and the user cannot click the save button again until the recording process is completed. After the recording is finished, the user exits the form and returns to the main page of the error entry screen.
  • The user is informed about the successful completion of the process through snackbars.

screen-recording-7

Large Font Page

  • It is a screen with a responsive design that displays information about the vehicle and the unresolved errors on it.
  • It is the same screen but with a different presentation according to the operating conditions.

image

Defect Listing Page

  • It is a page where all relevant errors in the shift are listed.
  • Errors can be deleted and updated.
  • Errors can be sorted, filtered, and updated.
  • A large amount of data is efficiently displayed on a single page, allowing users to smoothly scroll through the information.

resim_2023-06-18_225845856

(πŸ”)

πŸ€– Features

  • The project supports Turkish, English, German, French, and Russian languages, and it is suitable for adding more language support.
  • For language change, I have designed a switcher component using the Context API. By using the Context structure, I made all components accessible through a structure provided by parent components, instead of repeatedly rendering the pages. This made the application more efficient and manageable.
  • To improve the user experience, I stored the user's selected language preference in Locale Storage. This way, it is preserved even when the page is refreshed and can be accessed later on.

screen-recording

  • I added support for a virtual keyboard for users using touchscreen devices.
  • The virtual keyboard supports 6 languages: Turkish, Russian, Japanese, English, Czech, and French. Users can change the language by using the button right below the virtual keyboard.
  • It features large button designs to accommodate users wearing gloves.

screen-recording2

  • The virtual keyboard dynamically changes to the numpad type based on the input type.

screen-recording-2

  • UI blocking is a technique that prevents other actions from taking place in the user interface until a certain process is completed. This allows the user to observe the progress of the operation and successfully complete it. Therefore, in the error entry page, I used UI blocking to prevent the user from pressing other buttons repeatedly after saving an error, or to prevent consecutive form submissions during login processes.
  • UI Blocking used in the login page.

screen-recording3

  • UI Blocking used in the defet list page.

screen-recording-20

(πŸ”)

  • UI blocking I used on the error login page.

screen-recording-1

  • I added scroll up and down buttons to allow users using touchscreen devices to easily scroll through the values of the select input. This helps to alleviate the inconvenience of scrolling on a touchscreen.
  • All functions have been written from scratch. No ready-made packages were used.
  • When creating the style of the select input, I used the material ui package.

screen-recording-2

  • The reason for choosing React Hooks is that it allows for easier and more readable code. Writing React applications with functional components using React Hooks is easier and requires less code compared to class components.
  • In particular, managing states is easier with React Hooks. I can define states as variables, making state management more intuitive.
  • Another advantage is that it is easier to use lifecycle methods in components. With the useEffect() function, I was able to utilize lifecycle methods during the mount, update, and unmount phases.

(πŸ”)

  • A Virtualized Table is capable of efficiently handling a large amount of data. Virtualization helps to address performance issues by rendering only the visible portion of the table.
  • Users can smoothly scroll through the table without any lag or performance hiccups.
  • For the virtualized table, the material ui library's virtualized table package was used.

screen-recording-18

  • If the user does not perform any action for 80 seconds on the error entry page, a disruptive alarm sound will play.
  • Similarly, on the large font page, if the user does not perform any action for 80 seconds, both an alarm sound will play and the background color will change to red.

For demonstration purposes, the interval has been set to 2 seconds.

screen-recording.1.webm
  • Appearance in large font page.
screen-recording.2.webm
  • Dynamic boxes can be created based on the coordinates obtained from the service.
  • I accomplished this task using the react-img-mapper package. This package allows for the creation of interactive image maps with dynamically positioned boxes.
  • If the boxes are blue, it means they transition to a sub-image. Similarly, the boxes on the sub-image are positioned based on the error coordinates.

screen-recording-3

  • I made an effort to make the error entry and error listing pages as responsive as possible, although it can be challenging to adhere to a responsive design.
  • Especially on the large font page, I paid great attention to ensuring responsiveness and adapting to different screen sizes.

resim_2023-06-18_230145506

  • Ipad view of the login page.

image

  • The purpose of this page is to provide users with accurate information in order to encourage them to stay on the website and improve its usability.

image

  • The paths change dynamically based on the selected terminal from the terminal list.
  • The paths are modified step by step according to the data on which the operations will be performed.

image2

image

image

Validation with Formic and Yup

  • When used together, Formik and Yup are utilized to ensure that form fields within Formik are correctly filled. Yup's validation schemas are used to validate the form data.
  • By using Formik and Yup together, defects in form operations can be prevented, and it helps to achieve more organized, accurate, and reliable data entry.

If the user leaves the input field empty on the login page, they will receive the following error message:

image

Sorting, Filtering and Updatable on the Defect Listing Page

  • When clicking on the column headers, sorting and filtering operations are successfully performed.
  • Sorting can be done based on the "Reported", "Body", and "Registration Number" columns. Filtering can be done based on the "Body" number.

Sorting: screen-recording-14

Filtering: screen-recording-16

Updatable: screen-recording-17

(πŸ”)

πŸ“– My Experiences and Difficulties

  • I faced several challenges throughout this project. I believe that with each commit, I gained new knowledge and skills.
  • One of the challenges I encountered was using Formik and Material UI libraries together, which was initially challenging for me. My knowledge of Material UI was limited at the beginning, but I learned and progressed along with this project. The Material UI documentation was sufficient for me during this process, and I found that Material UI was very helpful in terms of styling.
  • In particular, when implementing the virtual keyboard component and ensuring synchronization with the physical keyboard, I put in a lot of effort. I can say that the react-img-mapper library, which I used for the first time, was very helpful, thanks to the support provided in its GitHub repository. You can find solutions to many issues in the "Issues" section, and if you have a different problem, you can open a new issue.

(πŸ”)

🎨 Color Reference

  • This is the color palette I used in the project.
Color Hex
Primary Color #93BFCF #93BFCF
Secondary Color #6096B4 #6096B4
Accent Color #BDCDD6 #BDCDD6
Light Color #EEE9DA #EEE9DA

Color Hunt Palette 6096b493bfcfbdcdd6eee9da

🌏 Browser Support

Chrome Chrome IE Internet Explorer Edge Edge Safari Safari Firefox Firefox
Yes 11+ Yes Yes Yes

(πŸ”)

🀝 Contact

πŸ’Ž Acknowledgements

Useful resources and documents that I used in my project.

πŸ“œ License

This software is licensed under the MIT © İsmail Mete Uçar.