Lotty A/B Platform

Service for managing A/B testing experiments. Drive your tests without breaking user experience!_)

🎨 Artifacts

ADR (Architecture Decision Record)

ADR

Runbook

RUNBOOK.md

Diagrams

C4 Context

C4 context

Source: C4 context

C4 Container

C4 container

Source: C4 container

C4 Component

C4 component

Source: C4 component

Testing report

Can be seen in GitLab CI/CD pipeline run

  1. Go to the pipelines page
  2. Click on the latest pipeline run pipeline run
  3. Testing report (Tests tab) testing report
  4. Tests coverage (Jobs tab) tests coverage

Here on screenshot you can see coverage percent (97%), for detailed coverage per file go to the test job log

tests coverage per file

Here we can see statements coverage per file, you can check out job run artifacts for html report.

tests coverage html report

Click here on index.html and you'll see complete coverage html report.

Repository map

MAP.md

Yep, artifacts content is written in Russian, but all other docs are in English, this is for judges' convenient experience.

📋 Instructions

Dedicated services setup

Backend

Setup with docker compose

Warning

Please note that by default containers will use port 80 (reverse proxy), so there is must be no listeners on this ports range. You can customize the ports in .env.template.

0. Prerequisites

1. Configuration

  • Docker compose configuration files are stored in deploy/compose.
  • Configuration files for containers are stored in infrastructure/configs. Env could be customized by creating .env file in each service config directory, it will automatically override the default values from .env.template.
  • Ports on which containers will be accessible are defined in .env.template. This could be customized by creating .env file in the root directory and patching the following lines compose you are running:
x-defaults: &defaults
  project_directory: ./
  env_file:
    - ./.env.template
    - ./.env # add this

2. Choosing compose configuration

  • compose.yaml - default configuration with base services included.
  • compose.prod.yaml - configuration for production environment with full observability stack.

3. Running compose configuration

To run the compose configuration, use the following command:

docker compose -f compose.yaml up
# OR
docker compose -f compose.prod.yaml --profile observability up

That's it, project is already preconfigured for running, so no changes before running this are required.

Linting && formatting

Instructions here.

Example run: style

Observability

Structured logs

logs

Health/ready endpoints (/health//ready)

health ready

Metrics (/metrics)

metrics

System metrics (gc, requests, etc.) and several business metrics (lotty_decide_requests_total, lotty_events_ingested_total).

OTEL

You can enable full observability for backend by setting OTEL_ENABLED=True in .env, also you need to run compose.prod.yaml with observability profile in order to deploy full observability stack.

Grafana Logs Grafana Traces Grafana Metrics

Also there is some other predefined dashboards for services.

Grafana (localhost/grafana/):

login: admin

password: prooooood

Load testing (k6)

Reproducible k6 profile for POST /api/v1/decide:

Demo data seed (HTTP)

One-command API seed for demo datasets:

Example:

BACKEND_BASE_URL='http://127.0.0.1' \
TG_BOT_TOKEN='<your_bot_token>' \
TG_CHAT_ID='<your_chat_id>' \
./infrastructure/http/seed-demo-data.sh

SMTP can be enabled with SMTP_ENABLED=true and SMTP env settings (see RUNBOOK.md).

Selected extra features

  • Notifications

Email: Mail

Telegram: Telegram

  • Learnings Library
  • Domain Conflicts
S
Description
No description provided
Readme 5.7 MiB
Languages
Python 95.8%
Shell 3.4%
JavaScript 0.4%
Just 0.2%
Dockerfile 0.2%