Context
Standard amoCRM analytics show "how things are now," but not "how they were a week ago." The client needed to see how pipeline states and traffic-source performance change over time.
Solution
Once an hour, a background service pulls leads through the amoCRM API v4, stores snapshots in amo_lead_snapshots, and maintains a pipeline registry in amo_pipelines. The dashboard aggregates the data by period, pipeline, stage, tags, and UTM fields. It shows not only current values but also history — changes by day and by week.
Stack and architecture
- Backend: Spring Boot 3.4.2, Spring Security OAuth2 (Google, Yandex, VK, Telegram, Steam), Spring Session on MongoDB.
- Frontend: Next.js (App Router), Recharts for charts, session-cookie auth.
- Data layer:
amo_lead_snapshots(history) ·amo_pipelines(registry) ·amo_sync_log(synchronization log). - Synchronization: hourly scheduler, error handling, and retries.
Role and outcome
We designed the storage layers, the scheduler-based synchronization, and the filter and chart pages. The client gained a historical view of pipelines and sources without any third-party BI tools.