Skip to content

Frontend web app for forecast traffic accident via backend with ML model on the weather conditions at Moscow north

License

Notifications You must be signed in to change notification settings

jsinkx/traffic-accident-frontend

Repository files navigation

Traffic accident frontend app

Create traffic accident forecast wia weather conditions in Moscow at north


Stack

  • Typescript
  • React 18
  • Context API / hooks
  • axios
  • react-window
  • react-helmet
  • react-i18next
  • react-chartjs-2
  • react-router-dom
  • styled-components
  • MUI

Lighthouse & Web Vitals

LightHouse

Web Vitals

Config app

An example of the config is in .env.example, but to use it you need to create .env

Integration of the config from .env into javascript variables and all constants are in ./src/shared/constants.ts

Production mode

By docker

Way without create .env

docker build -t traffic-accident-frontend-build --build-arg GENERATE_SOURCEMAP=false --build-arg VITE_API_URL=<API_URL>  .

Warning: don't forget to create .env

docker build -t traffic-accident-frontend-build .

Run build container

docker run --name traffic-accident-frontend-build --restart=always -d -p 80:80 traffic-accident-frontend-build

By package manage (don't recommended)

Check installation part

pn build
pn serve

Dev mode & installation

Via system

  1. git
  2. Node.js
  3. pnpm
  4. Install all dependencies package.json

Warning: before use pn command, need to read alias in .bashrc or alias.bat, also instead pn can called pnpm

Terminal

source .bashrc

Cmd

alias.bat

Install all dependencies

cd traffic-accident-frontend
pn i

Run pn dev

Releases

No releases published

Packages

No packages published