π§ Early beta / work in progress. This is an ambitious full-stack CRM built as a portfolio project. The architecture and core flows are in place, but it is NOT production-ready β see Known Limitations below.
Pipey is a lightweight, multi-channel CRM. It brings conversations from Telegram, MAX, and Avito into a single inbox, links them to contacts and deals on a visual pipeline, and adds a layer of automation on top: AI reply suggestions, PDF quotes and invoices, a public booking page, and analytics. The frontend ships as a PWA with an experimental mobile build via Capacitor.
The product is built around one idea: connect a channel, see your conversations, take an action, and reply to the customer β without a steep learning curve.
Pipey is honest about its current state. Before relying on it for anything serious, be aware that:
- No automated tests yet. There is no meaningful test suite. Jest is configured in the backend, but there are zero
*.spec.ts/ test files in eitherbackend/orfrontend/. Treat all behavior as unverified. - Channel integrations are uneven. Telegram is the most complete path β incoming webhooks are processed end to end (contact upsert, conversation, message persistence). MAX and Avito are partially stubbed: their API clients (
MaxService,AvitoService) and webhook controllers exist and enqueue jobs, but the queue worker handlers (processMax,processAvitoinqueues/processors/webhook.processor.ts) are placeholders that only log and do not yet persist messages. - Email magic-link delivery is a TODO. Authentication itself works (passwordless magic-link tokens are issued and verified), but actually sending the email is stubbed β in development the link is returned in the API response (
// TODO: Send email with magic linkinauth/auth.service.ts). There is no SMTP/email provider wired up. - Observability is wired but not fully integrated. Prometheus, Grafana, and Sentry/GlitchTip are defined in
docker-compose.monitoring.yml/docker-compose.sentry.yml, and a/metricsendpoint plus a Sentryinstrument.tsexist, but the dashboards, alerting, and end-to-end tracing are not finished. Sentry/GlitchTip is disabled unlessSENTRY_DSNis set. - The mobile (Capacitor) build is experimental and untested. A
capacitor.config.tsandmobile:*scripts exist and the app can be exported as a static bundle, but native iOS/Android builds have not been validated. - Not hardened for production. Default secrets in example files, in-memory AI response caching, and unfinished infrastructure mean this should be treated as a development/portfolio project, not a deployable product.
- Unified inbox β one place for conversations across Telegram, MAX, and Avito.
- Contacts β a lightweight contact database, automatically populated from incoming conversations and the booking form.
- Deals & pipeline β a visual, customizable pipeline with stages; drag deals through your sales process.
- AI reply suggestions β draft replies, suggested next actions (send quote, send invoice, send booking link, create deal, etc.), and conversation summaries, powered by OpenRouter. The default product model is
anthropic/claude-3-haikuwith an automatic fallback model. When no API key is configured, the service degrades gracefully to mock responses. - PDF artifacts β generate quotes and invoices as PDFs, plus reusable product cards and calendar links.
- Public booking page β share a public link; customers pick a slot from your configured working hours, and a contact + deal are created automatically. No authentication required for the customer.
- Analytics β dashboards over conversations, deals, and pipeline performance.
- Team & RBAC β organizations, memberships, and roles (
OWNER, plus additional roles) with an audit log. - PWA + mobile β installable progressive web app, with an experimental Capacitor wrapper for iOS/Android and web push notifications (VAPID).
Pipey is a monorepo with a NestJS backend and a Next.js frontend, backed by PostgreSQL, Redis, and MinIO, and orchestrated with Docker Compose.
ββββββββββββββββββββββββββββββββ
Telegram ββββββΆβ β
MAX ββββββΆβ NestJS API (backend) β
Avito ββββββΆβ webhooks β BullMQ queues β
β β
β Auth Β· Channels Β· Inbox β
β Contacts Β· Deals/Pipeline β
Next.js ββββββΆβ AI Β· Artifacts Β· Booking β
(PWA/ REST β Analytics Β· Team/RBAC β
Capacitor) β β
βββββ¬βββββββββββ¬βββββββββββ¬βββββ
β β β
PostgreSQL Redis MinIO
(Prisma) (BullMQ) (S3 files)
- Incoming messages arrive via per-channel webhook endpoints, which enqueue jobs onto a Redis-backed BullMQ queue (
webhook-processing). Workers process them asynchronously with retries and backoff. - AI and PDF generation are designed to run as background jobs as well, keeping request latency low.
- Files (generated PDFs, attachments) are stored in MinIO (S3-compatible).
- Data is modeled in Prisma over PostgreSQL (organizations, users, memberships, channels, conversations, messages, contacts, pipelines, stages, deals, artifacts, AI suggestions, audit logs, push subscriptions).
- NestJS (TypeScript)
- Prisma ORM over PostgreSQL
- Redis + BullMQ for queues and background jobs
- MinIO (S3-compatible object storage) for files
- JWT auth with passwordless magic links
- Optional Sentry / GlitchTip error tracking and a Prometheus
/metricsendpoint
- Next.js (App Router, TypeScript)
- Tailwind CSS
- Zustand for state management
- PWA support, with an experimental Capacitor build for iOS/Android
- OpenRouter as the model gateway (default model
anthropic/claude-3-haiku)
- Docker & Docker Compose
- Optional Prometheus + Grafana monitoring stack
- Optional Sentry / GlitchTip for error tracking
- Node.js >= 18
- npm >= 9
- Docker & Docker Compose
cp .env.example .envThen edit .env and set real values β at minimum POSTGRES_PASSWORD, JWT_SECRET, MAGIC_LINK_SECRET, ENCRYPTION_KEY, and MINIO_SECRET_KEY. Channel tokens (TELEGRAM_BOT_TOKEN, MAX_BOT_TOKEN, AVITO_CLIENT_ID / AVITO_CLIENT_SECRET) and OPENROUTER_API_KEY are optional β the app runs without them, and AI features fall back to mock responses when no key is set.
Builds and runs the entire stack (frontend, backend, PostgreSQL, Redis, MinIO) from local code:
./docker.sh start
# or
make startThe app will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001/api
- MinIO Console: http://localhost:9001
Useful commands:
./docker.sh dev # infrastructure only (PostgreSQL, Redis, MinIO)
./docker.sh stop # stop everything
./docker.sh status # service status
./docker.sh logs-f # follow logs
./docker.sh help # full command listSee DOCKER.md for details.
Run the infrastructure in Docker and the app processes locally:
# 1. Start infrastructure only
./docker.sh dev # or: make dev
# 2. Backend (in a separate terminal)
cd backend
npm install
npx prisma migrate dev
npm run start:dev
# 3. Frontend (in a separate terminal)
cd frontend
npm install
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- MinIO Console: http://localhost:9001
make db-migrate # apply migrations
make prisma-studio # open Prisma Studio
make db-reset # reset the database (destructive!)docker compose -f docker-compose.monitoring.yml up -d # Prometheus + Grafana
docker compose -f docker-compose.sentry.yml up -d # GlitchTip (Sentry-compatible)Note: these are wired into Compose but not fully integrated β see Known Limitations.
cd frontend
npm run mobile:build # static export + Capacitor sync
npm run mobile:ios # open the iOS project
npm run mobile:android # open the Android projectSee frontend/MOBILE.md. The mobile build is experimental and untested.
pipey/
βββ backend/ # NestJS API
β βββ prisma/ # Prisma schema & migrations
β βββ src/
β βββ auth/ # passwordless magic-link auth, JWT
β βββ channels/ # Telegram / MAX / Avito integrations
β βββ conversations/ # unified inbox
β βββ contacts/ # contact database
β βββ deals/ # deals
β βββ pipelines/ # pipelines & stages
β βββ ai/ # OpenRouter-backed AI suggestions
β βββ artifacts/ # PDF quotes/invoices, product cards, calendar links
β βββ booking/ # public booking page endpoints
β βββ analytics/ # dashboards & metrics
β βββ team/ # organizations, memberships, RBAC
β βββ settings/ # org settings
β βββ push/ # web push notifications
β βββ queues/ # BullMQ processors (webhook, ai, pdf, message)
β βββ common/ # guards, interceptors, health, metrics, logger
βββ frontend/ # Next.js (App Router) PWA
β βββ app/
β β βββ (dashboard)/ # inbox, pipeline, contacts, analytics, team, settingsβ¦
β β βββ auth/ # magic-link sign-in / verify
β β βββ book/ # public booking page
β β βββ onboarding/ # first-run onboarding
β βββ components/ # shared UI (AiPanel, MobileNav, pipeline, analyticsβ¦)
β βββ lib/ # API client & helpers
β βββ capacitor.config.ts # experimental mobile config
βββ docker/ # Docker service configs (postgres, redis, minio, nginx)
βββ docker-compose.yml # main stack
βββ docker-compose.monitoring.yml # Prometheus + Grafana (optional)
βββ docker-compose.sentry.yml # GlitchTip / Sentry (optional)
βββ docker.sh # convenience CLI
βββ Makefile # convenience targets
MIT Β© 2026 Alexander Zabrodin