Giter Site home page Giter Site logo

hophiphip / bruh Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.39 MB

A sample platform implementation for publishing and accessing insurance services.

License: MIT License

Dockerfile 3.13% Shell 2.66% PHP 79.95% Blade 10.63% Vue 3.58% Procfile 0.04%
laravel docker-compose

bruh's Introduction

Bruh

A sample platform implementation for publishing and accessing insurance services.

Try it

https://bruh-service.herokuapp.com/

Requirements

Quick start

Create a config file.

cp .env.example .env

Start the app in background

docker-compose -f docker-compose.yml up -d

Recommendations

Delete volumes between runs (e.g. update webapp files/configs)

docker-compose down -v

Tests

Unit/Feature tests

docker-compose -f docker-compose-unit.yml up --exit-code-from app

Possible issues


NOTE Docker memory cap might be exceeded because of Elasticsearch. Can be fixed with this:

Linux

sysctl -w vm.max_map_count=262144

Windows

wsl -d docker-desktop
sysctl -w vm.max_map_count=262144

bruh's People

Contributors

hophiphip avatar

Watchers

 avatar

bruh's Issues

Review

$submit = $request->validate([

Это можно в LoginRequest сбросить.

User::whereEmail($submit['email'])->first()->sendLoginLink();

Можешь установить "vladimir-yuldashev/laravel-queue-rabbitmq" для того чтобы он сгенерирует комменты необходимые

$tokenHash = hash('sha256', $plainToken);

Это надо перенести в Event>Listener::handle


Можешь брать юзера из $request->user().

public function signUp(Request $request): Redirector|Application|RedirectResponse

Можешь создать AuthService для бизнес-логики.

метод first()?

return $this->getInsurer()->get()->first()->company_name;

Тут не понятно зачем first, если у тебя один страховщик. По идее тут и не нужен метод этот.

CodeReview

public function updated(Offer $offer)
{
//
}

public function updated(OfferRequest $offerRequest)
{
//
}

  • пустой метод

public const CLIENT_LOCATION_COLLECTION_CONNECTION = 'mongodb';
public static function client_location_collection_connection(): string
{
return env('MONGO_DB_CONNECTION', self::CLIENT_LOCATION_COLLECTION_CONNECTION);
}
public const INSURER_TABLE = 'insurers';

  • метод заехал в константы

protected $connection = DatabaseTableNamesProvider::CLIENT_LOCATION_COLLECTION_CONNECTION;
/**
* Overwriting default constructor to set database connection dynamically.
*
* @param array $attributes
*/
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->connection = DatabaseTableNamesProvider::client_location_collection_connection();
}
/**
* @var string collection name
*/
protected $collection = DatabaseTableNamesProvider::CLIENT_LOCATION_COLLECTION;

  • методы, свойства в перемешку

if (array_key_exists($key, $_SERVER) === true){

  • сравнение с true избыточно

$perPage = $request->input('size') ?? 1000;

  • в input можно передать дефолтное значение input($key, $default)

public function home(): Factory|View|Application

  • здесь фабрика или инстанс приложения вряд ли вернутся

Общее

  • используй declare(strict_types=1)
  • можно освежить знания PSR-1, PSR-12

DB-ABS

<mxfile host="app.diagrams.net" modified="2022-02-03T14:32:07.250Z" agent="5.0 (X11)" etag="ulNTWaHHTTYQrOr-Z6e4" version="16.5.2" type="github">

Description можно TEXT делать. Уточни в PostgreSQL по поводу Varchar vs Text.

Как юзеру узнать, кто он (фирма или юзер)? Сейчас в задаче нет авторизации для обычных пользователей. Это конечно не значит что в будущем не будет личного кабинета для постоянных клиентов. Но и о том что он будет никто не говорит)

На мой взгляд, довольно запутанна абстракция с многие-ко-многим. У нас есть клиенты и фирмы, от фирм есть услуги. Услуги имеют категории. В юзере можно сделать полиморфную связь, но стоит ли это того? По идее можно хранить все заявки и транзакции клиентов. Как тебе такое?)

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.