Skip to content

dreadnautxbuddha/symfony-log-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This project gives users the ability to import a log file and count logs based on a set of queries.

Setup

Environment Variables

⚠️ Before anything else, you need to setup your .env file first. Both Docker Compose and the project needs it in order to work properly

First, copy the .env file to yours:

cp .env .env.local

then in your .env.local file, supply the following environment variables:

  1. POSTGRES_USER example: myusername
  2. POSTGRES_PASSWORD example: mypassword
  3. POSTGRES_DB example: mydatabase
  4. SERVER_NAME example: analytics.logging-system.localhost

After that, you can proceed with the next steps.

Docker Compose

This project uses Docker Compose for development, and can be started up by simply running the following:

docker compose --env-file ./.env.local build
docker compose --env-file ./.env.local up -d

Install dependencies

Once the containers are up and running, you can now install the dependencies by entering the php container:

docker compose exec -it php /bin/bash

and installing the Composer packages:

composer install

Database

Create the test database

Once you have installed the Composer packages, you can start creating the test database for the unit tests to work.

php bin/console doctrine:database:create --env=test

💡️ Since our compose file already created our local database for us, we won't have to run this command for it.

Then, we can start running the migrations

php bin/console doctrine:migrations:migrate
php bin/console doctrine:migrations:migrate --env=test

Unit Tests

Tests can be run by entering the php container again:

docker compose exec -it php /bin/bash

and running:

php bin/phpunit

Code Sniffing

We have PHP_CodeSniffer installed to ensure that our code always matches our standards. You can run it by:

vendor/bin/phpcs

and fix any errors automatically by running:

vendor/bin/phpcbf

Static Code Analysis

We have installed PHPStan to help with our code reviews! Simply run this command in order to check for bugs earlier in the code review pipeline:

vendor/bin/phpstan

Usage

The page can be accessed at the SERVER_NAME environment variable you supplied in your .env.local file.

Find out more about how this command is used here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published