Skip to content
MesutBE edited this page Jul 28, 2020 · 7 revisions

Welcome to the Driving-Licence-App wiki!

This place is our sharing place about tips and tricks, helpful links...

Follow us...

About wireframing

Wireframe

A wireframe is a low-fidelity way of showing a design. It’s the graphic representation of an app or a website containing the most essential elements and the content. A wireframe is like a blueprint of a building. When someone wants to build a massive building, they don’t start right away, right. Instead, they sketch, draw, make the blueprints, calculate, etc.

Mockup

A mockup is a visual way of representing a product. While a wireframe mostly represents a product’s structure, a mockup shows how the product is going to look like. But still, a mockup is not clickable (just like the wireframe). As opposed to a wireframe, a mockup is either a mid or high-fidelity display of design.

Prototype

A prototype is often a high fidelity representation of the final product which is meant to simulate user interaction. Unlike the previous two, a prototype is clickable and thus allows the user to experience content and interactions in the interface. In fact, a prototype is very much like the final product itself.

source: https://uxplanet.org/wireframe-mockup-prototype-what-is-what-8cf2966e5a8b

Databases

https://app.lucidchart.com

https://www.youtube.com/watch?v=ZS_kXvOeQ5Y

Sqlite

Datatypes In SQLite Version 3

Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:

NULL. The value is a NULL value.

INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.

TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).

BLOB. The value is a blob of data, stored exactly as it was input.

source: https://www.sqlite.org/datatype3.html

Starting Project

Starting from backend..

  • Because of .gitignore (see .gitignore file on the root folder) file you need to install manually the dependencies.
{
  "name": "cooool",
  "version": "1.0.0",
  "scripts": {
    "dev": "concurrently \"npm run dev-api\" \"npm run dev-client\"",
    "dev-api": "nodemon api/dev.js",
    "dev-client": "cd client && npm run start",
    "start": "node index.js",
    "heroku-postbuild": "cd client && npm install && npm run build",
    "test": "cd api && jest --collectCoverage=true --forceExit",
    "test:watch": "cd api && jest --watch --collectCoverage=true --runInBand --detectOpenHandles"
  },
  "license": "MIT",
  "dependencies": {
    "bcrypt": "^4.0.1",
    "body-parser": "^1.19.0",
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^5.9.7"
  },
  "devDependencies": {
    "concurrently": "^5.1.0",
    "nodemon": "^2.0.2",
    "jest": "^25.1.0",
    "supertest": "^4.0.2"
  }
}
  • Under root folder .../Driving-Licence-App$
  • write in terminal npm install (if it fails)
  • write in terminal npm install bcrypt npm install body-parser and all the other dependencies...

after completing installation of the dependencies, you can enter npm run dev-api to work only on your backend. You can test your codes with postman in this case.

Starting frontend..

{
  "name": "phht",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^3.4.0"
  },
  "scripts": {
    "start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
    "build": "SKIP_PREFLIGHT_CHECK=true react-scripts build",
    "test": "SKIP_PREFLIGHT_CHECK=true react-scripts test  --collectCoverage=true",
    "test:watch": "SKIP_PREFLIGHT_CHECK=true react-scripts test --watch  --collectCoverage=true",
    "eject": "SKIP_PREFLIGHT_CHECK=true react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "proxy": "http://localhost:5000"
}
  • Under client folder .../Driving-Licence-App/client$
  • write in terminal npm run build or npm run-script build
  • after building completed. First you need to start serving your backend and then make request from frontend to see welcome message.
  • you can write in terminal on the root folder .../Driving-Licence-App$ npm run dev, it will automatically done "concurrently \"npm run dev-api\" \"npm run dev-client\"" so you will see your frontend page.

React Helpful Resources

https://reactrouter.com/web/example/preventing-transitions

React Async/Await

https://www.robinwieruch.de/react-hooks-fetch-data