HiroHyun
中文
← All projects

HiroCRM

A self-hosted CRM for one small sales team: leads, follow-up touchpoints, and configurable response SLAs, all in a single SQLite file.

Next.js · React · SQLite · Drizzle ORM · TypeScript · Jul 2026 Source ↗

HiroCRM is a lead tracker for one small international sales team. It records each lead and its contact channels, logs every follow-up as a dated touchpoint, and measures each lead against a follow-up SLA you configure. The whole dataset lives in a single SQLite file, and the app runs as one Next.js process behind a reverse proxy.

What it tracks

A lead carries phone, email, and WhatsApp contacts, a rating, a status, and the rep it belongs to. A dedup check catches a buyer already in the system, so one contact stays one row. Every conversation becomes a touchpoint on that lead’s timeline, which reads top to bottom as the full contact history.

The dashboard groups leads by status, SLA state, and date range, with follow-up KPIs across the top. Three environment variables define the SLA: a first-response window (default 72 hours), a follow-up window (default 120 hours), and a response cap (default three touchpoints) after which the clock stops. Leads load in bulk from an xlsx spreadsheet, and chat or email screenshots attach to a lead through a session-guarded route that serves the files only to signed-in requests.

A deliberately small trust model

HiroCRM signs the whole team in through one shared admin credential. That is the design, and the project documents its consequences plainly: one login for everyone, so no per-person identity, no individual attribution on a change, no roles or permissions, and no way to revoke one person short of rotating the shared secret. Rep rows are labels for who owns a lead — names in a roster the app uses for assignment. The result fits one mutually trusting team that wants a shared workspace with light account overhead. A team that needs per-person audit trails will want a different tool.

Data in a single file

Everything persists to one dev.db file at the project root, with uploaded screenshots in a git-ignored data/uploads directory beside it. A backup is that file plus that directory, taken as one atomic set — capture only half and you get orphaned images, or leads pointing at missing files. An optional retention script sweeps in three phases: it deletes leads archived past a cutoff along with their touchpoints, strips old screenshots while keeping the lead row, and removes upload files no lead references. The script prints its plan and writes nothing until you pass --apply, so a dry run always comes first.

Stack and gate

The app is built on Next.js (App Router) and React, with better-sqlite3 and Drizzle ORM over the database, NextAuth for sessions, Base UI components, and Tailwind CSS v4. Every dependency resolves to an exact, locked version, and one npm run gate command runs the production build, ESLint, the vitest suite, a UI copy-and-token check, and an API smoke test against a scratch database before any change lands — the same command CI runs on every pull request. HiroCRM v0.1.1 is an early public preview, maintained by one person, built to run as a single instance on a persistent filesystem.