bash — ~/projects/lazy-crm
$cd ~/projects/lazy-crm && cat summary.txt
Full-featured CRM with workspace multi-tenancy — manage companies, contacts, leads, and deals through customizable pipelines with drag-and-drop. Track activities, tasks, and audit every mutation.
LAZY CRM
Full-Stack Developer · #f3a7c92 master
Next.js 16 · React 19 · Prisma · SQLite · NextAuth · Tailwind CSS v4
github.com/sleepyhead000/lazy-crm
~/projects/lazy-crm $
cat README.md
README.md
$cat overview.txt
A workspace-based CRM for sales teams: companies and contacts with owner assignment, lead tracking with qualification notes, deal pipelines with drag-and-drop stage management, activity logging, task assignment with priorities, tag-based categorization, custom field definitions per entity type, CSV import/export with job tracking, and a full audit trail of every mutation.
$cat architecture.txt
Next.js 16 App Router with React 19, server-side API routes, Prisma ORM on SQLite, NextAuth (beta) for session management with Prisma adapter, bcryptjs for password hashing. Frontend uses @dnd-kit for drag-and-drop pipeline management, @tanstack/react-table for data grids, Lucide React icons, Zod for validation, and Tailwind CSS v4 for styling.
$cat data.txt
15+ table schema: workspaces, users, workspace_members, companies, contacts, company_contacts, leads, pipelines, pipeline_stages, deals, deal_contacts, activities, tasks, tags, record_tags, custom_field_definitions, custom_field_values, import_jobs, export_jobs, audit_events. Workspace-scoped multi-tenancy with cascading deletes.
~/projects/lazy-crm $
ls -l features/
workspace
Multi-tenancy · workspace-scoped data isolation · role-based membership
companies
Full CRUD · industry, size, location · owner assignment · archiving
contacts
People management · linked to companies · lifecycle tracking · owner assignment
leads
Lead tracking · status pipeline · qualification notes · convert to company + contact + deal
deals
Pipeline management · drag-and-drop stages · value + currency · win/loss reasons
pipelines
Custom pipelines · multiple stages per pipeline · default pipeline flag
activities
Activity log · calls, meetings, emails · linked to any entity · duration tracking
tasks
Task management · priority levels · due dates · assign to users · linked to entities
tags
Categorization · color-coded tags · apply to companies, contacts, deals
custom fields
Extensible schema · define fields per entity type · text, select, date types
import/export
CSV I/O · background job tracking · success/error row counts
audit
Full audit trail · before/after snapshots · actor + IP tracking
~/projects/lazy-crm $
cat stack.yaml
framework
Next.js 16 (App Router) · React 19 · TypeScript
database
SQLite · Prisma ORM · 15+ table schema · workspace-scoped queries
auth
NextAuth 5 (beta) · Prisma adapter · bcryptjs password hashing
ui
Tailwind CSS v4 · Lucide React icons · @tanstack/react-table
dnd
@dnd-kit · core + sortable + utilities · drag-and-drop pipeline stages
validation
Zod · schema-first input validation on API routes
tooling
pnpm · ESLint · Prisma Migrate · Prisma Studio
~/projects/lazy-crm $
cat schema.prisma
prisma/schema.prisma — entity relationships
$cat entities.txt
Core entities: Workspace → (Companies, Contacts, Leads, Deals, Activities, Tasks, Tags, CustomFields)
Auth: User → WorkspaceMember (role-based) → Workspace
Relations: Company ↔ Contact (many-to-many), Deal ↔ Contact (many-to-many)
Pipeline: Pipeline → PipelineStage → Deal (stage-based progression)
Extensibility: CustomFieldDefinition → CustomFieldValue (polymorphic per entity)
Audit: AuditEvent captures before/after snapshots for every mutation
Auth: User → WorkspaceMember (role-based) → Workspace
Relations: Company ↔ Contact (many-to-many), Deal ↔ Contact (many-to-many)
Pipeline: Pipeline → PipelineStage → Deal (stage-based progression)
Extensibility: CustomFieldDefinition → CustomFieldValue (polymorphic per entity)
Audit: AuditEvent captures before/after snapshots for every mutation
$cat indexes.txt
Composite indexes on (workspaceId, ownerId), (workspaceId, status), (workspaceId, archivedAt) for filtered queries. Unique constraints on workspace slug, user email, workspace-member pairs, and tag names per workspace.
~/projects/lazy-crm $
git log --oneline
#f3a7c92feat/auth
Workspace multi-tenancy & authentication
NextAuth 5 · Prisma Adapter · bcryptjs · Zod
- Implemented NextAuth with Prisma adapter for session management — workspace-scoped membership with role-based access (admin, sales_rep).
- Built workspace isolation: every query filters by workspaceId, cascading deletes on workspace removal, unique slug constraints.
- Password hashing via bcryptjs with Zod-validated register/login routes.
#a8d2e15feat/crm
Companies, contacts & lead management
Prisma · SQLite · Next.js App Router · Lucide React
- Designed 15+ table Prisma schema with many-to-many relations (Company ↔ Contact, Deal ↔ Contact) via join tables.
- Full CRUD for companies (industry, size, location, owner) and contacts (lifecycle stage, linked companies).
- Lead tracking with conversion flow: qualify a lead → auto-create company + contact + deal in one transaction.
#b4c9f03feat/pipeline
Deal pipelines & drag-and-drop
@dnd-kit · @tanstack/react-table · Tailwind CSS v4
- Customizable deal pipelines with configurable stages — drag deals between stages via @dnd-kit sortable.
- Deal cards show value, currency, expected close date, owner, and probability — sortable and filterable via TanStack Table.
- Win/loss tracking: closing a deal requires a reason, archived deals retained for reporting.
#c7e1a58feat/ops
Activities, tasks & extensibility
Prisma · Zod · CSV import/export · Audit logging
- Activity logging linked to any entity (company, contact, lead, deal) with type, description, and duration.
- Task management with priority levels, due dates, and assignee tracking — completed tasks marked with timestamp and completer.
- Custom fields: define text/select/date fields per entity type, with per-record values. CSV import/export with background job tracking and error counts.