{"id":14987499,"url":"https://github.com/pdovhomilja/nextcrm-app","last_synced_at":"2026-04-08T22:02:59.656Z","repository":{"id":179284986,"uuid":"663249691","full_name":"pdovhomilja/nextcrm-app","owner":"pdovhomilja","description":"NextCRM — Open-source CRM built with Next.js 16, React 19, PostgreSQL, Prisma 7, and shadcn/ui. CRM, projects, invoicing, documents, email client \u0026 AI features.","archived":false,"fork":false,"pushed_at":"2026-04-03T07:21:38.000Z","size":4778,"stargazers_count":567,"open_issues_count":2,"forks_count":189,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-04-03T14:18:40.744Z","etag":null,"topics":["crm","e2b","inngest","next-auth","nextjs","open-source","openai","postgresql","prisma","react","resend","shadcn-ui","tailwindcss","tremor","typescript"],"latest_commit_sha":null,"homepage":"https://demo.nextcrm.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdovhomilja.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"pdovhomilja"}},"created_at":"2023-07-06T22:25:52.000Z","updated_at":"2026-04-03T07:21:32.000Z","dependencies_parsed_at":"2023-11-29T11:27:34.311Z","dependency_job_id":"98c1e6d2-b6a0-4c6f-9bc2-cf7d38f8b91f","html_url":"https://github.com/pdovhomilja/nextcrm-app","commit_stats":{"total_commits":361,"total_committers":10,"mean_commits":36.1,"dds":0.3850415512465374,"last_synced_commit":"79714bbc940930d1da324594d675781d89f1f762"},"previous_names":["pdovhomilja/nextcrm-app"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pdovhomilja/nextcrm-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdovhomilja%2Fnextcrm-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdovhomilja%2Fnextcrm-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdovhomilja%2Fnextcrm-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdovhomilja%2Fnextcrm-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdovhomilja","download_url":"https://codeload.github.com/pdovhomilja/nextcrm-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdovhomilja%2Fnextcrm-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crm","e2b","inngest","next-auth","nextjs","open-source","openai","postgresql","prisma","react","resend","shadcn-ui","tailwindcss","tremor","typescript"],"created_at":"2024-09-24T14:14:50.176Z","updated_at":"2026-04-08T22:02:59.645Z","avatar_url":"https://github.com/pdovhomilja.png","language":"TypeScript","funding_links":["https://github.com/sponsors/pdovhomilja"],"categories":["TypeScript","CLIs","Lightweight CRM","Platforms \u0026 Applications"],"sub_categories":[],"readme":"\u003ca href=\"https://nextcrm.app/\"\u003e\n  \u003ch1 align=\"center\"\u003eNextCRM\u003c/h1\u003e\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"OG\" src=\"public/images/opengraph-image.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nNextCRM is an open-source CRM built with Next.js 16, React 19, TypeScript, PostgreSQL (Prisma 7), and shadcn/ui. Features CRM, project management, document storage, email client, AI-powered features, vector search, and MCP server for AI agent access.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://twitter.com/nextcrmapp\"\u003e\n\u003cimg alt=\"X (formerly Twitter) URL\" src=\"https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fnextcrmapp\"\u003e\n\u003c/a\u003e\n  \u003ca href=\"https://github.com/pdovhomilja/nextcrm-app/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/pdovhomilja/nextcrm-app\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"#online-demo\"\u003e\u003cstrong\u003eIntroduction\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#whats-new\"\u003e\u003cstrong\u003eWhat's New\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#tech-stack--features\"\u003e\u003cstrong\u003eTech Stack + Features\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#roadmap\"\u003e\u003cstrong\u003eRoadmap\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#installation\"\u003e\u003cstrong\u003eInstallation\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#repo-activity\"\u003e\u003cstrong\u003eRepo activity\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"#license\"\u003e\u003cstrong\u003eLicense\u003c/strong\u003e\u003c/a\u003e ·\n   \u003ca href=\"https://discord.gg/dHyxhTEyUb\"\u003e\u003cstrong\u003eDiscord\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n## Online Demo\n\nYou can try it here [demo.nextcrm.io](https://demo.nextcrm.io), login via Google account or create new user and password.\n\n---\n\n## What's New\n\n### 📋 CRM Activities — Full Activity Tracking *(NEW)*\n\nAll 5 CRM entity detail pages (Accounts, Contacts, Leads, Opportunities, Contracts) now have an **Activities** tab with a live paginated feed of interactions:\n\n- **Activity types** — Notes, Calls, Emails, Meetings, Tasks\n- **Create / edit / delete** — inline Sheet form on every CRM entity detail page\n- **Paginated feed** — compound cursor pagination with `createdAt + id` for stable ordering\n- **Linked records** — activities attach to multiple entities via `crm_ActivityLinks` (e.g. a call can reference both a Contact and an Opportunity)\n- **Real-time revalidation** — server actions revalidate the correct path after every mutation\n\n---\n\n### 🕵️ Audit Log \u0026 History — Full Change Trail *(NEW)*\n\nEvery CRM entity (Accounts, Contacts, Leads, Opportunities, Contracts) now tracks its full change history:\n\n- **History tab** — per-entity timeline of all field changes, shown on every detail page with `AuditTimeline` + `AuditEntry` components\n- **Soft delete** — records are never hard-deleted; `deletedAt` column preserves data while hiding it from normal queries\n- **Admin audit log** — `/admin/audit-log` shows a global filterable table of every change across all entities, with restore support for soft-deleted records\n- **Diff engine** — `diffObjects` utility computes before/after diffs and stores structured JSON in the audit record\n\n---\n\n### 🧠 AI Enrichment — E2B Sandboxed Agent + Flexible API Key Management *(NEW)*\n\nTarget and Contact enrichment now runs inside an **[E2B](https://e2b.dev/) cloud sandbox** — a full Linux environment with a real browser (Chrome) — replacing the previous Firecrawl API path:\n\n- **Real-browser research** — the agent navigates JS-heavy sites, LinkedIn public profiles, and paginated results that a simple API call cannot reach\n- **LLM tool-use loop** — Claude Sonnet 4.6 drives the research with tools: `browser_open`, `browser_snapshot`, `browser_click`, `browser_extract`, `web_search`\n- **C-level contact discovery** — given only a company name, the agent finds all discoverable C-level contacts and creates `crm_Target_Contact` records automatically\n- **Context-aware strategy** — agent skips research it doesn't need (e.g. already has a website → skips domain discovery)\n- **Confidence scoring** — fields below 0.6 confidence are discarded; only empty target fields are overwritten\n- **5-minute timeout per target** — partial results are applied even if the agent times out\n- **Fan-out** — after company enrichment, each discovered contact is enriched independently via a separate Inngest job\n\n**API keys** are managed through a **3-tier priority system** so the app runs without any keys in `.env`:\n\n```\nENV variable  →  Admin system-wide  →  User profile\n(highest)                              (lowest)\n```\n\n- **Admin panel** (`/admin/llm-keys`) — set system-wide keys for OpenAI, Firecrawl, Anthropic, and Groq. Keys are encrypted at rest (AES-256-GCM).\n- **Profile settings** (`/profile?tab=llms`) — users configure their own keys as a fallback.\n- **Graceful degradation** — enrichment buttons show an informative dialog when no key is available at any tier.\n\n\u003e **Migration note:** The old `openAi_keys` table is replaced by the new `ApiKeys` table. Run `pnpm prisma migrate deploy` to apply the migration.\n\n---\n\n### 🤖 MCP Server — AI Agent Access to CRM Data *(NEW)*\n\nNextCRM now ships with a built-in [Model Context Protocol](https://modelcontextprotocol.io/) server, letting AI agents (Claude, Cursor, custom agents) read and write CRM data directly.\n\n**127 tools across 15 modules:**\n\n| Module | Tools | Operations |\n|--------|-------|------------|\n| Accounts | 6 | list, get, search, create, update, delete |\n| Contacts | 6 | list, get, search, create, update, delete |\n| Leads | 6 | list, get, search, create, update, delete |\n| Opportunities | 6 | list, get, search, create, update, delete |\n| Targets | 6 | list, get, search, create, update, delete |\n| Products | 5 | list, get, create, update, delete |\n| Contracts | 5 | list, get, create, update, delete |\n| Activities | 5 | list, get, create, update, delete |\n| Documents | 8 | list, get, create, upload, download, link, unlink, delete |\n| Target Lists | 7 | list, get, create, update, delete, add members, remove members |\n| Enrichment | 4 | enrich contact, enrich target, bulk contact, bulk target |\n| Email Accounts | 1 | list |\n| Campaigns | 18 | full lifecycle: CRUD, send, pause, resume, templates, steps, stats |\n| Projects | 18 | boards, sections, tasks, comments, documents, watch |\n| Reports | 2 | list, run |\n\n**Authentication:** Generate Bearer tokens (`nxtc__...`) from your profile page. Tokens are SHA-256 hashed — the raw value is shown only once and never stored.\n\n**Connect your MCP client:**\n```json\n{\n  \"mcpServers\": {\n    \"nextcrm\": {\n      \"url\": \"https://your-nextcrm.com/api/mcp/sse\",\n      \"headers\": { \"Authorization\": \"Bearer nxtc__your_token_here\" }\n    }\n  }\n}\n```\n\nBoth SSE (`/api/mcp/sse`) and HTTP (`/api/mcp/http`) transports are supported.\n\n**Claude Code Skill:** Download the [SKILL.md](/en/profile?tab=developer) from your Developer profile tab for a ready-to-use Claude Code skill with full tool documentation.\n\n---\n\n### 🔍 Vector Search + Semantic Similarity *(NEW)*\n\nCRM records (Accounts, Contacts, Leads, Opportunities) are automatically embedded using **OpenAI `text-embedding-3-small`** via [Inngest](https://www.inngest.com/) background jobs.\n\n- **Unified search** — combines keyword (full-text) + semantic (pgvector cosine similarity) results in a single grouped UI\n- **Find Similar** — every CRM detail page has a \"Find Similar\" button that surfaces semantically related records across the same module\n- **Backfill** — Inngest function to embed all existing records on demand\n- **Auto-embed** — new and updated records are embedded automatically\n\nPowered by **pgvector** (PostgreSQL extension) with HNSW indexes for fast approximate nearest-neighbor search.\n\n---\n\n### 🎯 CRM Targets *(NEW)*\n\nNew **Targets** module for managing sales targets and target lists — full CRUD, detail view, list management, and MCP tools included.\n\n---\n\n### 🔎 Unified Search *(NEW)*\n\nGlobal search across all CRM entities from a single search bar — grouped results by entity type, loading skeleton, collapsible sections, and combined keyword + semantic scoring.\n\n---\n\n## Tech Stack + Features\n\n### Frameworks\n\n- [Next.js 16](https://nextjs.org/) – React framework for building performant apps with the best developer experience (App Router)\n- [Better Auth 1.5.x](https://www.better-auth.com/) – TypeScript-first authentication framework with email OTP, OAuth (Google), admin plugin, and session management\n- [Prisma 7.5](https://www.prisma.io/) – TypeScript-first ORM for PostgreSQL\n- [React Email 2.x](https://react.email/) – Versatile email framework for efficient and flexible email development\n\n### Platforms\n\n- [PostgreSQL 17+](https://www.postgresql.org/) – Powerful open-source relational database with **pgvector** extension for AI embeddings\n- [Resend](https://resend.com/) – A powerful email framework for streamlined email development together with [react.email](https://react.email)\n- [UploadThing](https://uploadthing.com/) + S3-compatible storage (DigitalOcean Spaces) – for document file storage\n- [Inngest](https://www.inngest.com/) – Background job queue for async embedding and AI workflows\n\n### AI \u0026 MCP\n\n- [OpenAI API](https://openai.com/blog/openai-api) – `text-embedding-3-small` for vector embeddings; GPT for project management assistant\n- [Anthropic API](https://www.anthropic.com/) – Claude Sonnet 4.6 drives the E2B enrichment agent tool-use loop\n- [Vercel AI SDK 6.x](https://sdk.vercel.ai/) – Unified AI interface\n- [pgvector](https://github.com/pgvector/pgvector) – PostgreSQL vector extension for similarity search (HNSW indexes)\n- [E2B](https://e2b.dev/) – Cloud sandboxes with real Chrome browser for AI-driven web research and contact enrichment\n- [MCP Server](https://modelcontextprotocol.io/) – 127 tools across 15 modules via `@vercel/mcp-adapter`, Bearer token auth, SSE + HTTP transports\n\n### Data fetching\n\n- [SWR](https://swr.vercel.app/) – React Hooks library for remote data fetching\n- [Axios](https://axios-http.com/) – Promise based HTTP client for the browser and node.js\n- [Server Actions]() – for server side data fetching and mutations\n- [TanStack React Table](https://tanstack.com/table) – for data tables and server/client side data fetching\n\n### UI\n\n- [Tailwind CSS v4](https://tailwindcss.com/) – Utility-first CSS framework for rapid UI development\n- [shadcn/ui](https://ui.shadcn.com/) – Re-usable components built using Radix UI and Tailwind CSS\n- [Tremor](https://www.tremor.so/) – A platform for creating charts\n- [Lucide React](https://lucide.dev/) – Beautiful and consistent open-source icons\n\n### i18n\n\n- [next-intl](https://next-intl-docs.vercel.app/) – Internationalization for Next.js — English, Czech, German, Ukrainian\n\n![hero](/public/og.png)\n\n## Roadmap\n\n1. ✅ Docker version — complete bundle to run NextCRM on-premise\n2. ✅ Upgrade to Next.js 16 — running on Next.js 16 with React 19\n3. ✅ i18n / localization — 4 languages (English, Czech, German, Ukrainian)\n4. ✅ Email client — IMAP/SMTP email client built in\n5. ✅ PostgreSQL migration — migrated from MongoDB to PostgreSQL 17+\n6. ✅ pgvector embeddings — automatic semantic embeddings via Inngest + OpenAI\n7. ✅ Vector similarity search — \"Find Similar\" on all CRM entity detail pages\n8. ✅ Unified search — keyword + semantic search across all CRM modules\n9. ✅ CRM Targets module — sales target and target list management\n10. ✅ MCP server — 25 CRM tools for AI agent access via Bearer token auth\n11. ✅ AI enrichment — E2B sandboxed agent (real browser + Claude Sonnet) for target/contact enrichment; C-level contact discovery; 3-tier API key management (ENV → admin → user)\n12. ✅ Audit log \u0026 history — soft delete + full field-level change trail on all CRM entities; global admin audit log page\n13. ✅ CRM Activities — notes, calls, emails, meetings, tasks linked to any CRM entity; paginated feed on all detail pages\n14. 🔄 More AI powered features — daily summary of tasks and projects\n15. 📋 Email campaigns management — integration with MailChimp and Listmonk\n16. 📋 Testing expansion — Jest + Playwright coverage (contributions welcome!)\n17. 🔄 Fix all TypeScript `any` types — ongoing cleanup\n\n## Emails\n\nWe use [resend.com](https://resend.com) + [react.email](https://react.email) as primary email sender and email templates.\n\n## Reports\n\nWe use Tremor charts as a tool for creating charts in NextCRM\n\n![hero](/public/reports.png)\n\n## Video (YouTube channel with functions showcase)\n\n[Youtube Channel](https://www.youtube.com/@NextCRM_IO) \u003c/br\u003e\n[Invoice module (video)](https://youtu.be/NSMsBMy07Pg)\n\n## Documentation\n\nAvailable soon at: http://docs.nextcrm.io\n\n## Installation\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eShow instructions\u003c/b\u003e\u003c/summary\u003e\n\n1. Clone the repository:\n\n   ```sh\n   git clone https://github.com/pdovhomilja/nextcrm-app.git\n   cd nextcrm-app\n   ```\n\n1. Install the preset:\n\n   ```sh\n   pnpm install\n   ```\n\n1. Copy the environment variables to .env\n\n   ```sh\n   cp .env.example .env\n   ```\n\n   ```sh\n   cp .env.local.example .env.local\n   ```\n\n   **.env**\n\n   \u003e \u003e - You will need a PostgreSQL connection string for Prisma ORM\n   \u003e \u003e - Example: `DATABASE_URL=\"postgresql://user:pass@localhost:5432/nextcrm?schema=public\"`\n   \u003e \u003e - Requires PostgreSQL 17+ with the **pgvector** extension enabled\n\n   **.env.local**\n\n   \u003e \u003e - BETTER_AUTH_SECRET - for auth\n   \u003e \u003e - uploadthings - for storing files\n   \u003e \u003e - openAI - for embeddings and project management assistant *(optional — can be set via admin panel instead)*\n   \u003e \u003e - Firecrawl - for contact/target enrichment *(optional — can be set via admin panel instead)*\n   \u003e \u003e - SMTP and IMAP for emails\n   \u003e \u003e - Inngest - for background embedding jobs\n   \u003e \u003e - `EMAIL_ENCRYPTION_KEY` - required for encrypting API keys stored in the database\n\n1. Init Prisma\n\n   ```sh\n    pnpm prisma generate\n    pnpm prisma migrate deploy\n   ```\n\n1. Import initial data from initial-data folder\n\n   ```sh\n   pnpm prisma db seed\n   ```\n\n1. Run app on local\n\n   ```sh\n   pnpm run dev\n   ```\n\n1. http://localhost:3000\n\n\u003c/details\u003e\n\n## Docker installation\n\n[Link to Docker HUB](https://hub.docker.com/repository/docker/nextcrmio/nextcrm/general)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eShow instructions\u003c/b\u003e\u003c/summary\u003e\n\n1. Make sure you have docker and docker-compose installed\n\n2. Prepare .env and .env.local files\n\n   ```create\n   .env (for Prisma URI string) and .env.local (all others ENVs) file inside docker folder\n   ```\n\n3. build docker image\n\n   ```sh\n   docker build -t nextcrm .\n   ```\n\n4. Run docker container\n\n   ```sh\n   docker run -p 3000:3000 nextcrm\n   ```\n\n5. http://localhost:3000\n\u003c/details\u003e\n\n## Contact\n\n[www.dovhomilja.cz](https://www.dovhomilja.cz)\n\u003c/br\u003e\n[\u003cimg alt=\"X (formerly Twitter) URL\" src=\"https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fdovhomilja\"\u003e\n](https://twitter.com/dovhomilja)\n\n## Contributing\n\nWe are open to the NextCRM community contributions. Every contribution is welcome.\n\n### Issues\n\n- [Open an issue](https://github.com/pdovhomilja/nextcrm-app/issues) if you find a bug or have a suggestion for improvements.\n\n### NextCRM Super heroes\n\n\u003ca href=\"https://github.com/pdovhomilja/nextcrm-app/graphs/contributors\"\u003e\n\u003cimg src=\"https://contrib.rocks/image?repo=pdovhomilja/nextcrm-app\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n\n## Repo Activity\n\n![Alt](https://repobeats.axiom.co/api/embed/e6bed6e15724f38c278ad2edcf0573a1bb24bed6.svg \"Repobeats analytics image\")\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=pdovhomilja/nextcrm-app\u0026type=Timeline)](https://star-history.com/#pdovhomilja/nextcrm-app\u0026Timeline)\n\n## License\n\nLicensed under the [MIT license](https://github.com/pdovhomilja/nextcrm-app/blob/main/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdovhomilja%2Fnextcrm-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdovhomilja%2Fnextcrm-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdovhomilja%2Fnextcrm-app/lists"}