diff --git a/analytics/umami/.env.example b/analytics/umami/.env.example new file mode 100644 index 0000000..7305fce --- /dev/null +++ b/analytics/umami/.env.example @@ -0,0 +1,5 @@ +# PostgreSQL connection string +DATABASE_URL=postgresql://umami_user:umami_password@db:5432/umami + +# Secret key for Umami app +APP_SECRET=Insert_your_secure_secret_here diff --git a/analytics/umami/README.md b/analytics/umami/README.md new file mode 100644 index 0000000..fd2ee9e --- /dev/null +++ b/analytics/umami/README.md @@ -0,0 +1,71 @@ +# Umami Analytics Setup + +This repository contains a **self-hosted, privacy-first analytics setup using Umami**. +It allows your organization to track user behavior, analyze traffic, and make informed decisions while maintaining full visitor privacy and data ownership. + +--- + +## Requirements + +* Server with **Node.js ≥ 18.17** +* **PostgreSQL ≥ 12.14** (or MySQL ≥ 8.0) +* **Docker & Docker Compose** +* Minimum **1GB RAM** recommended + +> ⚠️ This setup should run on a separate server. Your main application server may not meet the Node.js/PostgreSQL requirements. + +--- + +## Setup Instructions + +### 1. Copy environment variables + +```bash +cp .env.example .env +``` + +### 2. Edit `.env` + +* Update the database credentials (`DATABASE_URL`) +* Set a secure `APP_SECRET` + +### 3. Start the services + +```bash +docker compose up -d +``` + +This will start: + +* **Umami app** +* **PostgreSQL database** + +### 4. Access the dashboard + +Open in your browser: + +``` +http://:3000 +``` + +* Create an **admin account** +* Add your **websites** to start tracking + +### 5. Add tracking script to your website + +```html + +``` + +* Replace `` with your server domain or IP +* Replace `YOUR_WEBSITE_ID` with the ID shown in the Umami dashboard + +--- + +## Notes + +* This setup runs **independently** of the main application server +* **All visitor data is private** and stored only in your database +* You can **scale or back up the database** as needed +* For production, consider using **HTTPS** and a **custom domain** +* This setup is ready for deployment once a server is available diff --git a/analytics/umami/docker-compose.yml b/analytics/umami/docker-compose.yml new file mode 100644 index 0000000..c854660 --- /dev/null +++ b/analytics/umami/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3.8" + +services: + db: + image: postgres:15 + container_name: umami-db + restart: always + environment: + POSTGRES_DB: umami + POSTGRES_USER: umami_user + POSTGRES_PASSWORD: umami_password + volumes: + - umami-db-data:/var/lib/postgresql/data + + umami: + image: umamisoftware/umami:postgresql-latest + container_name: umami + depends_on: + - db + ports: + - "3000:3000" + environment: + DATABASE_URL: postgresql://umami_user:umami_password@db:5432/umami + APP_SECRET: replace_with_secure_secret + restart: always + +volumes: + umami-db-data: