Git Product home page Git Product logo

bsa-2023-towhub's Introduction

TowHub

ℹ️ General Info

This is the repository responsible for TowHub apps.

🏭 Applications

  • Backend — TowHub application backend.

    To work properly, fill in the .env file. Use the .env.example file as an example.

  • Frontend — TowHub application frontend.

    To work properly, fill in the .env file. Use the .env.example file as an example.

  • Shared — TowHub application common modules for reuse.

🖍 Requirements

  • NodeJS (18.x.x);
  • NPM (9.x.x);
  • PostgreSQL (15.4)
  • run npx simple-git-hooks at the root of the project, before the start (it will set the pre-commit hook for any commits).

🏃‍♂️ Simple Start

  1. npm run install:all at the root
  2. Fill ENVs
  3. npx simple-git-hooks at the root
  4. cd backend && npm run migrate:dev
  5. cd frontend && npm run start:dev then cd backend && npm run start:dev
  6. Enjoy <3

🏗 Architecture

🛖 Application Schema

TBA

💽 DB Schema

db schema

erDiagram

    users {
        id serial PK "not null"
        phone varchar "not null, unique"
        email varchar "not null, unique"
        first_name varchar "not null"
        last_name varchar "not null"
        password_hash varchar "not null"
        password_salt varchar "not null"
        group_id integer FK "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
    }
    groups {
        id serial PK "not null"
        name varchar "not null"
        key varchar "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
    }
    driver_details {
        id serial PK "not null"
        driverLicenseNumber varchar "not null, unique"
        user_id integer FK "not null"
        business_id integer FK "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
    }
    users_trucks {
        id serial PK "not null"
        user_id integer FK "not null"
        truck_id integer FK "not null"
    }
    trucks {
        id serial PK "not null"
        manufacturer varchar "not null"
        capacity integer "not null"
        price_per_km real "not null"
        license_plate_number varchar "not null"
        year integer "not null"
        tow_type varchar "not null"
        business_id integer FK "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
        business_id integer FK "not null"
    }
    business_details {
        id serial PK "not null"
        company_name varchar "not null, unique"
        tax_number varchar "not null, unique"
        owner_id integer FK "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
    }
    orders {
        id serial PK "not null"
        price integer "not null"
        scheduled_time timestamp "not null"
        start_point varchar "not null"
        end_point varchar "not null"
        status enum "not null"
        user_id integer FK "nullable"
        business_id integer FK "nullable"
        shift_id integer FK "nullable"
        customer_name varchar "nullable"
        customer_phone varchar "nullable"
        cars_qty integer "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
    }
    files {
      id serial PK "not null"
      key varchar "not null, unique"
      name varchar "not null"
      content_type varchar "not null"
      created_at timestamp "not null"
      updated_at timestamp "not null"
    }
    shifts {
        id serial PK "not null"
        start_date timestamp "not null"
        end_date timestamp "nullable"
        driver_id integer FK "not null"
        truck_id integer FK "not null"
        created_at timestamp "not null"
        updated_at timestamp "not null"
        deleted_at timestamp "nullable"
    }
    users_trucks one or many -- one trucks: "users_trucks(truck_id) belongs to trucks(id)"
    users_trucks one or many -- one users: "users_trucks(user_id) belongs to users(id)"
    users one or many -- one groups: "users(group_id) belongs to groups(id)"
    business_details zero or one -- one users: "business_details(owner_id) belongs to users(id)"
    driver_details zero or one -- one users: "driver_details(user_id) belongs to users(id)"
    trucks one or many -- one business_details: "trucks(business_id) belongs to business_details(id)"
    driver_details one or many -- one business_details: "driver_details(business_id) belongs to business_details(id)"
    users one -- zero or many orders: "users(id) has orders(user_id)"
    users one -- zero or many orders: "users(id) has orders(user_id)"
    business_details one -- zero or many orders: "business_details(id) has orders(business_id)"
    shifts one -- zero or many orders: "shifts(id) has orders(shift_id)"
    users zero or one -- one or many shifts: "users(id) has shifts(driver_id)"
    trucks one -- zero or many shifts: "shifts(truck_id) has trucks(id)"
Loading

🌑 Backend

🌕 Frontend

🥊 Code quality

  • simple-git-hooks — a tool that lets you easily manage git hooks.
  • lint-staged — run linters on git staged files.
  • dangerjs — automate common code review chores.
  • commitlint — helps your team adhere to a commit convention.
  • editorconfig — helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
  • prettier — an opinionated code formatter.
  • ls-lint — file and directory name linter.
  • eslint — find problems in your JS code.
  • stylelint — find and fix problems in your CSS code.

🧑‍💻 CI

🗞 Git

🏅 Pull Request flow

<project-prefix>-<issue-number>: <ticket-title>
Example
  • th-5: Add Clinician Dashboard

🌳 Branch flow

<type>/<project-prefix>-<issue-number>-<short-desc>
Types
  • task
  • fix
Examples
  • task/th-5-add-clinician-dashboard
  • task/th-12-add-clinician-flow
  • fix/th-16-fix-clinician-flow

🗂 Commit flow

<project-prefix>-<issue-number>: <modifier> <description>
Modifiers
  • + (add)
  • * (edit)
  • - (remove)
Examples
  • th-5: + title for dashboard
  • th-12: * dashboard title
  • th-16: - dashboard title

📦 CD

Handled by GitHub Actions.

bsa-2023-towhub's People

Contributors

h0wter avatar alexvlaso avatar dmytrovoronkov avatar denred avatar kalinkaaaa14 avatar tetianadoroshko avatar pavlosukhinin avatar mv22110702 avatar some14u avatar albsbz avatar maxhopaytsa avatar druxight avatar akymenko-m avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.