Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mohaphez/bugloos-assessment

service helps you to import your logs into the database
https://github.com/mohaphez/bugloos-assessment

Last synced: about 1 month ago
JSON representation

service helps you to import your logs into the database

Awesome Lists containing this project

README

        

# Laravel Log Service

## Introduction

This service helps you to import your logs into the database using commands, and filter them with different queries.

## Problem Description:

### Problem 1:
We have a very large file that we need to parse and import into the database.

#### solution :
First, we create a command (log:import), then read it line by line, fetch the required items from each line and enter it into the database.
In order not to face the problem of memory leak, we use lazycollection
which helps us to divide the data into smaller parts and enter the database.

### Problem 2:
We need an endpoint that filters the data with the parameters it receives and displays their count.

#### solution :
We create a controller and refer the received parameters to the LogService for filtering and get the total.

Notes :

- Strategy and factory design patterns are used to read and parse the file.
- Inversion dependence has been observed in the classes.
- Test writing has been done for endpoint and command.
- The project is Dockerized and you can launch it with docker-compose.