Repurchase CRM
Manufacturing · Sales and customer relationships
A CRM that brings customers back at the right time and measures every campaign by its coupon.
- Client
- Cosmetics manufacturer
- Status
- In use, in production since July 2026
- Technology
- Next.js · PostgreSQL · Docker on our own server

The sales CRM of a manufacturer. It receives the ERP's orders every day, calculates each customer's repurchase cycle and fills the pipeline by itself with whoever is due to buy again. Each salesperson sees their own book, and every campaign is measured by its coupon.
The AI writes the draft. The salesperson talks to the customer.
- screens
39
screens
- database migrations
49
database migrations
- integration test suites
8
integration test suites
- commits
213
commits
What the system does | |
|---|---|
| 01 | Repurchase cycle calculated for each customer, with an RFM matrix and churn risks |
| 02 | Kanban pipeline that refills itself every night |
| 03 | 360° customer record, with data masked outside each salesperson's book |
| 04 | Campaigns measured by coupon, relationship cadences and prepaid orders with approval |
| 05 | WhatsApp inbox with several numbers, ready for the official account |
| 06 | Targets, commissions and a course track linked to campaigns |
Where AI comes in | |
|---|---|
| 01 | Editable AI skills: how the AI behaves at each point and what it knows by topic |
| 02 | Summary of the 360° record and a draft WhatsApp message for the salesperson |
| 03 | Provider and model switched on screen, without touching the code |
| 04 | If a skill is turned off, the default text comes back: the AI never goes silent |
Why custom-built
A CRM that follows the company's process, not the other way around.
Off-the-shelf CRMs cover the basics: contacts, pipeline and email. What brings customers back in this business is something else: each person's buying rhythm, the orders already in the ERP and the coupon that proves the sale. The system was built around that.
01ERP
Orders arrive on their own
Every night the system reads the ERP's orders and merges them into one record per tax ID.
02Cycle
Each customer has their own rhythm
The average gap between each person's purchases becomes the expected date of the next one.
03Queue
The pipeline builds itself by risk and value
Whoever is past their own cycle enters the queue, ordered by what there is to lose.
04Salesperson
The AI drafts, the salesperson talks
The card brings the history and a WhatsApp draft. The person decides and sends.
The coupon used on the invoice confirms the return and restarts the cycle.
A fixed rule against each customer's cycle
Three fictitious customers stop buying. The off-the-shelf rule flags all of them after 90 days of silence. The customer's own cycle flags each one at the right time.
Customer Abuys every 30 days
the fixed rule flags 60 days late
Customer Bbuys every 60 days
the fixed rule flags 30 days late
Customer Cbuys every 120 days
the fixed rule flags 30 days early
- purchase
- right time, by the customer's cycle
- fixed-rule alert, 90 days
An off-the-shelf CRM and this CRM, side by side
Sales data
Reads the ERP's orders every night
Off-the-shelf CRM: Manual import or a separate integration
When to reach out
Each customer's buying cycle
Off-the-shelf CRM: One rule for everyone
Pipeline
Fills itself, by risk and value
Off-the-shelf CRM: The salesperson builds it
Campaign results
The coupon that made it onto the invoice
Off-the-shelf CRM: Opens and clicks
House rules
Channels, prepaid and courses the company's way
Off-the-shelf CRM: The process adapts to the tool
Data access
Each salesperson sees their own book; the rest is masked
Off-the-shelf CRM: Permissions per screen
Compared with typical use of a ready-made CRM, without a custom integration.
The hours
How long it took to build
57h29
billed for the whole CRM, from the first line to daily use in production.
A little over seven eight-hour days, spread across five weeks.
One week for the first version. Then five rounds of changes requested by the sales team, already using the system every day. The lists shrank from 108 to 36 items over the first three.
16h20
First version
Initial build, in one week
12h23
Round 1
108 change items
7h14
Round 2
65 change items
4h57
Round 3
36 change items
9h17
Round 4
Requests from the sales team
7h19
Round 5
Finishing touches before handover
How an hour is counted
- 01Each gap between two commits counts for 40 minutes at most. A longer pause is left out.
- 02Plus 45 minutes of warm-up, once a day, to get back into the system.
- 03A commit that fixes a defect is not billed: our mistakes never become client hours.
Left out of the bill
- Meetings with the client's team
- 21h39
- Measurement tool and hour reports
- 11h43
Hours measured from the repository history between July 17 and August 20, 2026. On this project the rule was leaner than our standard one: no per-session minimum and no 10% buffer.

