Skip to content

Latest commit

 

History

History
165 lines (106 loc) · 4.89 KB

readme.md

File metadata and controls

165 lines (106 loc) · 4.89 KB

BSA 2019 | PHP | Metrica

Build Status Codacy Badge StyleCI License: MIT

Description

Metrica is an analog of Google Analytics. The main purpose is to collect data from web pages, handle it and visualize.

Metrica

Installation. Unix

cp docker-compose.override.yml.general docker-compose.override.yml
cp .env.example .env

docker-compose run --rm frontend npm install

docker-compose up -d

cp backend/.env.example backend/.env
docker-compose exec app composer install
docker-compose exec app php artisan key:generate
docker-compose exec app php artisan jwt:secret
docker-compose exec app php artisan migrate --seed

cp frontend/.env.example frontend/.env

Open browser:

https://localhost:8443

Installation. Windows

First of all make sure you have installed node:12.7.

cp docker-compose.override.yml.windows docker-compose.override.yml
cp .env.example .env
docker-compose up -d

docker-compose exec app composer install

docker-compose exec app php artisan key:generate
docker-compose exec app php artisan jwt:secret
docker-compose exec app php artisan migrate --seed

cp frontend/.env.example frontend/.env

cd frontend
npm install

npm run serve

Open browser:

http://localhost:3000

Setup pusher

Sign up Pusher.

Create application.

Fill backend/.env variables:

BROADCAST_DRIVER=pusher
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=

Fill frontend/.env variables:

PUSHER_APP_KEY=
PUSHER_CLUSTER=
PUSHER_AUTH_ENDPOINT=/broadcasting/auth

Build tracking JS script

Setup .env file in the frontend directory

VUE_APP_API_URL=
VUE_APP_URL=

then run command

docker-compose exec frontend npm run build:script

Contributors

Elasticsearch troubleshoot

The vm.max_map_count kernel setting needs to be set to at least 262144 for production use. Depending on your platform:

Linux

$ sysctl -w vm.max_map_count=262144

macOS with Docker for Mac

$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

sysctl -w vm.max_map_count=262144

Windows and macOS with Docker Toolbox

docker-machine ssh sudo sysctl -w vm.max_map_count=262144

or

docker-machine ssh

tce-load -w -i nano.tcz

sudo sysctl -w vm.max_map_count=262144

cat /proc/sys/vm/max_map_count

sudo nano /mnt/sda1/var/lib/boot2docker/profile

# put this line in the end of file
sudo sysctl -w vm.max_map_count=262144

# save it

Ctrl+O

exit

docker-machine restart default

Copyright and License

Metrica was written by PHP team of Binary Studio Academy in 2019 and is released under the MIT License.

Copyright (c) 2019 Binary Studio Academy