{"slug": "show-hn-self-hosted-crm-for-manufacturing-django-and-htmx", "title": "Show HN: Self-hosted CRM for manufacturing (Django and Htmx)", "summary": "A self-hosted CRM for manufacturing, built with Django 6.1 and HTMX, was released on Hacker News by developer Oleg Ushakov. The platform targets small manufacturing shops and engineering teams, offering project and task management, material tracking, file support for DXF/STEP/STL, and an AI assistant that integrates with providers like Ollama, Anthropic, OpenAI, and Google. It features automatic folder organization and a knowledge base, with deployment via a one-click install script.", "body_md": "Django 6.1 + Tailwind CSS 4 + Alpine.js + HTMX + AI Assistant\n\nA lightweight CRM/ERP platform designed for engineering and manufacturing teams. It brings projects, tasks, materials, technical drawings, documents, and internal knowledge together in one unified workspace. Ideal for small manufacturing shops, CNC workshops, engineering bureaus, and teams that need structure without heavy corporate systems.\n\nKey Features:\n\nProject and task management\n\nMaterial and BOM tracking\n\nSupport for engineering files (DXF, STEP, STL)\n\nCentralized document storage\n\nBuilt‑in knowledge library\n\nAI assistant for automation and team support\n\nFast HTMX‑based interface without a heavy frontend\n\nPurpose: To give small industrial companies a simple, fast, and local ERP‑level tool that can be deployed without complex infrastructure.\n\nEvery project gets its own dedicated space. As soon as a project is created, you can start adding everything related to it:\n\n- Photos\n- Drawings and technical documents\n- Notes\n- Any other supporting files\n\nOnce the project is saved to a chosen location, the system automatically generates a numbered project folder. All documents belonging to that project are neatly organized inside, each type kept in its own subfolder — no manual sorting required.\n\nWhen a project is finished, it can be archived and moved out of the active workspace, keeping the working area clean while preserving a complete, organized record for future reference.\n\nBeyond individual projects, the CRM also serves as a knowledge base for general documentation the business collects over time:\n\n- Documents\n- Videos\n- Articles\n\nArticles can be saved directly from the internet via a link, making it easy to build a personal reference library without manual copy-pasting. As with projects, all saved materials are automatically organized into clearly structured folders.\n\n**One place for everything**— no more hunting across folders, drives, and inboxes** Automatic organization**— numbered project folders and categorized subfolders are created without manual effort** Clean lifecycle management**— active projects stay easy to find; finished projects can be archived without losing structure** Built-in knowledge base**— a growing library of reference material, saved and organized alongside project work\n\nA project management, contractor and task tracking system featuring 14 custom apps, an AI assistant with a command mode, and a modular HTMX-driven UI.\n\n```\npython -m venv venv\nvenv\\Scripts\\activate\npip install -r requirements.txt\nnpm install\nnpm run build\npython manage.py migrate\npython manage.py seed_ai_providers   # seed AI provider list\npython manage.py collectstatic\npython manage.py createsuperuser\npython manage.py runserver\n```\n\nOr run [install.bat](https://github.com/OlegUshakov-pl/CRM/blob/main/install.bat) for one-click setup (creates venv, installs Python + Node dependencies, builds Tailwind, runs migrations, seeds AI providers, collects static files, and creates a superuser). Default credentials: `admin`\n\n/ `admin`\n\n.\n\nRun `update.bat`\n\nafter pulling new code to refresh dependencies and rebuild the frontend. Start the server anytime with `runserver.bat`\n\n.\n\n| Layer | Technology |\n|---|---|\n| Backend | Django 6.1, Python 3.14+, SQLite |\n| Frontend | Tailwind CSS 4 (CLI + CDN), Alpine.js 3.x, HTMX 2.0.4, Lucide Icons, Montserrat |\n| AI | Ollama, Anthropic, OpenAI, Google, Mistral, Groq, DeepSeek, OpenRouter, OpenCode |\n| Build | Tailwind CLI v4 (`npm run dev` / `npm run build` ) |\n\n| Module | Description |\n|---|---|\nDashboard |\nKey metrics, recent projects/tasks/notes, global search, settings panel |\nAccounts |\nLogin/logout, profile, password reset (console email) |\nCalendar |\nThree-month rolling calendar with task due dates |\n\n| Module | Description |\n|---|---|\nCompanies |\nCompany directory with contact info, logo, notes |\nContacts |\nPeople directory linked to companies |\nProjects |\nFull lifecycle: statuses, budget, dates, gallery, ZIP export/import |\nTasks |\nPrioritized tasks with statuses, due dates, per-project filtering |\nNotes |\nUniversal notes linkable to projects, companies, or contacts |\n\n| Module | Description |\n|---|---|\nMaterials / BOM |\nBill of Materials per project with categories, pricing, file attachments |\nDocuments |\nFile upload/preview (images, PDF, text) per project |\nParts |\nEngineering drawings (DXF) and 3D models (STEP, Inventor, SolidWorks, STL) |\n\n| Module | Description |\n|---|---|\nLibrary |\nKnowledge base with rich-text editor (Quill.js), articles auto-saved as `.md` files on disk with images, nested categories, tags, favorites, file attachments |\nAI Assistant |\nMulti-provider AI chat with CHAT/COMMANDS modes, browser agent, web search, file management |\n\n| Module | Description |\n|---|---|\nGenerator |\nModule scaffolding template with 12-step docs for rapid prototyping |\n\n**CHAT**— free conversation with any configured AI model** COMMANDS**— natural-language CRM operations via regex-based intent detection\n\nOllama (local), Anthropic, OpenAI, Google, Mistral, Groq, DeepSeek, OpenRouter, OpenCode — configurable via Settings panel. API keys encrypted with AES-GCM.\n\n```\nCreate project 001, Office Building on 2026-06-15\nAdd task Call client on 2026-06-10\nFind contact Ivan\nAdd material Bolt 50 to project Test\nUpload file drawing.pdf to project Test\nShow all drawings of project Test\nCreate note Meeting for project Test\nOpen bbc.com\nDownload file from https://example.com/image.png\nCreate file hello.py with content print(\"Hello, World!\")\nSearch for latest Python 3.14 features\nFind pdf on site https://example.com\n```\n\n- Install\n[Ollama](https://ollama.com) - Pull a model:\n`ollama pull llama3.2`\n\n- Start Ollama (port 11434)\n- Select model in CRM chat interface\n\nBrowser agent (SSRF protection), web search (DuckDuckGo), file management (50 MB/file, 1 GB quota), 10-second undo, audit logging, two-step confirmation for write operations.\n\n```\nCRM/\n  config/            Settings, URLs, WSGI, ASGI\n  core/              Dashboard, base models, activity log, search, AI config\n  accounts/          Authentication\n  companies/         Company directory\n  contacts/          Contact directory\n  projects/          Full project lifecycle + ZIP export/import\n  materials/         Bill of Materials\n  tasks/             Task management\n  notes/             Universal notes\n  documents/         File upload/preview\n  library/           Knowledge base (articles saved as .md on disk, categories, tags, files)\n  parts/             Drawings & 3D models\n  assistant/         AI chat, LLM, browser agent, command handlers\n  calendar_app/      Calendar view\n  generator/         Module scaffolding\n  templates/         Base layout, includes (sidebar, topbar, chat, pagination)\n  static/            Tailwind CSS source (src/) and dist/\n  media/             User-uploaded files\n  ai_files/          AI-downloaded files\n```\n\n| Prefix | App | Purpose |\n|---|---|---|\n`/` |\ncore | Dashboard, search, settings, AI API |\n`/accounts/` |\naccounts | Authentication |\n`/admin/` |\nadmin | Django Admin |\n`/companies/` |\ncompanies | Company CRUD |\n`/contacts/` |\ncontacts | Contact CRUD |\n`/projects/` |\nprojects | Project lifecycle |\n`/tasks/` |\ntasks | Task management |\n`/notes/` |\nnotes | Universal notes |\n`/materials/` |\nmaterials | BOM management |\n`/deals/` |\ngenerator | Deal CRUD (example scaffold) |\n`/documents/` |\ndocuments | File management |\n`/library/` |\nlibrary | Knowledge base |\n`/parts/` |\nparts | Engineering drawings |\n`/assistant/` |\nassistant | AI chat |\n`/calendar/` |\ncalendar_app | Calendar view |\n\nAll business models extend `TimeStampedModel`\n\n(`created_at`\n\n, `updated_at`\n\n, `created_by`\n\n, `is_active`\n\n).\n\n| Model | Key Fields | Relationships |\n|---|---|---|\nCompany |\nname, slug, email, phone, website, address, logo, notes | FK→Project, Contact, Note, Deal |\nContact |\nfirst_name, last_name, slug, email, phone, position, avatar, notes | FK→Company |\nProject |\nname, slug, number, description, status, dates, budget, image | FK→Company; M2M→Contact |\nProjectImage |\nimage, uploaded_at | FK→Project |\nMaterial |\nname, slug, quantity, unit, unit_price, notes | FK→Project, Category |\nTask |\ntitle, slug, description, status, priority, due_date | FK→Project |\nNote |\ntitle, slug, content, date | FK→Project / Company / Contact |\nDocument |\nnumber, size, file, file_type | FK→Project, Category |\nLibraryItem |\ntitle, slug, content (HTML), is_favorite, source_url, summary | FK→Category; M2M→Tag; auto-saved as `{slug}_{date}.md` on disk |\nPart |\nnumber, size, rev, file | FK→Project, Category |\nDeal (example) |\nname, slug, status, priority, value, due_date | FK→Company; M2M→Contact; FK→User |\nCategory |\nname, slug, color, icon, parent (self-referential) | Materials, Documents, Parts, Library |\nChatSession |\ntitle, is_active, last_message_at | FK→User |\nChatMessage |\nrole, kind, content, payload (JSON) | FK→Session |\nAIFile |\noriginal_name, source_url, size, category | FK→User |\nAILog |\naction, status, description, duration_ms | FK→User, Session |\nActivity |\naction, description, content_type, object_id | GenericForeignKey |\nAIProvider |\nname, type, encrypted API key, base_url, model | n/a |\nAIModel |\nmodel_id, name, tags (JSON) | FK→Provider |\n\n**Slide-over forms**— CRUD via HTMX without page navigation** Soft delete**—`is_active`\n\nflag on all business entities**Global search**— single page across all entity types** Activity logging**— all CRUD tracked via GenericForeignKey** Project export/import**— ZIP archives with JSON manifest** Dark mode**— localStorage-persisted, user-toggleable** Collapsible sidebar**— expandable/collapsible navigation** Settings panel**— configurable storage paths, naming, AI providers** AI undo**— 10-second undo window for write operations** Versioning**—`0.7.{git_commit_count}`\n\nvia`core/version.py`\n\n**Security**— path traversal, SSRF, and open redirect protection\n\n```\nnpm run dev       # Watch Tailwind\nnpm run build     # Production build\npython manage.py collectstatic\npython manage.py runserver\npython manage.py test core accounts assistant\n```\n\nCovers unit tests, navigation, and security (path traversal, SSRF, open redirects).\n\nProjects store files in organized directories:\n\n```\n{number}_{name}_Project/\n  documents/\n  drawings/\n  models/\n```\n\nSubfolder naming is configurable via `AppSetting`\n\n. Storage backend uses custom `ProjectFileSystemStorage`\n\n.\n\nArticles are auto-saved as Markdown (`.md`\n\n) files on disk for portability:\n\n```\n{library_root}/\n  {slug}_{YYYY-MM-DD}/\n    {slug}_{YYYY-MM-DD}.md    # Full article content in Markdown\n    images/                    # Downloaded/copied article images\n    attachments/               # Uploaded file attachments\n```\n\n- Content is stored both in the database (HTML) and as\n`.md`\n\non disk - Storage root is configurable via\n`AppSetting`\n\n(falls back to`MEDIA_ROOT/library/`\n\n) - Article folders are created on create/edit/import and recursively deleted on delete\n- Images are served via a dedicated\n`/library/{slug}/image/{path}`\n\nview with path traversal protection\n\nLicense: MIT", "url": "https://wpnews.pro/news/show-hn-self-hosted-crm-for-manufacturing-django-and-htmx", "canonical_source": "https://github.com/OlegUshakov-pl/CRM", "published_at": "2026-09-03 06:46:31+00:00", "updated_at": "2026-09-03 06:51:56.210943+00:00", "lang": "en", "topics": ["ai-products", "developer-tools", "artificial-intelligence"], "entities": ["Oleg Ushakov", "Django", "HTMX", "Tailwind CSS", "Alpine.js", "Ollama", "Anthropic", "OpenAI"], "alternates": {"html": "https://wpnews.pro/news/show-hn-self-hosted-crm-for-manufacturing-django-and-htmx", "markdown": "https://wpnews.pro/news/show-hn-self-hosted-crm-for-manufacturing-django-and-htmx.md", "text": "https://wpnews.pro/news/show-hn-self-hosted-crm-for-manufacturing-django-and-htmx.txt", "jsonld": "https://wpnews.pro/news/show-hn-self-hosted-crm-for-manufacturing-django-and-htmx.jsonld"}}