A modern, open-source CRM platform built with Django REST Framework and SvelteKit.
BottleCRM is a full-featured Customer Relationship Management system designed for startups and small businesses. It combines a powerful Django REST API backend with a modern SvelteKit frontend, featuring multi-tenant architecture with PostgreSQL Row-Level Security (RLS) for enterprise-grade data isolation.
Try it free: bottlecrm.io
- Leads - Track and manage sales leads through your pipeline
- Accounts - Manage company/organization records
- Contacts - Store and organize contact information
- Opportunities - Track deals and sales opportunities
- Cases - Customer support case management
- Tasks - Task management with calendar and Kanban board views
- Invoices - Create and manage invoices
- Multi-Tenant Architecture - PostgreSQL RLS for secure data isolation between organizations
- JWT Authentication - Secure token-based authentication
- Team Management - Organize users into teams with role-based access
- Activity Tracking - Comprehensive audit logs and activity history
- Comments & Attachments - Collaborate with comments and file attachments on any record
- Tags - Flexible tagging system for organizing records
- Email Integration - AWS SES integration for transactional emails
- Background Tasks - Celery + Redis for async task processing
- Django 5.x with Django REST Framework
- PostgreSQL with Row-Level Security (RLS)
- Redis for caching and Celery broker
- Celery for background task processing
- JWT for authentication
- AWS S3 for file storage
- AWS SES for email delivery
- SvelteKit 2.x with Svelte 5 (runes)
- TailwindCSS 4 for styling
- shadcn-svelte UI components
- Zod for schema validation
- Axios for API communication
- Lucide icons
- Python 3.10+
- Node.js 18+ with pnpm
- PostgreSQL 14+
- Redis
# Clone the repository
git clone https://github.com/MicroPyramid/Django-CRM.git
cd Django-CRM
# Create and activate virtual environment
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables (see env.md for details)
cp .env.example .env
# Edit .env with your database and other settings
# Run migrations
python manage.py migrate
# Create a superuser
python manage.py createsuperuser
# Start the development server
python manage.py runserver# In a new terminal, from the project root
cd frontend
# Install dependencies
pnpm install
# Start the development server
pnpm run dev# In a new terminal
cd backend
source venv/bin/activate
celery -A crm worker --loglevel=INFO- Frontend: http://localhost:5173
- API Documentation: http://localhost:8000/swagger-ui/
- Admin Panel: http://localhost:8000/admin/
# Build and run with Docker Compose
docker build -t bottlecrm:latest -f docker/dockerfile .
docker-compose -f docker/docker-compose.yml upDjango-CRM/
├── backend/ # Django REST API
│ ├── accounts/ # Accounts module
│ ├── cases/ # Cases module
│ ├── common/ # Shared models, utilities, RLS
│ ├── contacts/ # Contacts module
│ ├── invoices/ # Invoices module
│ ├── leads/ # Leads module
│ ├── opportunity/ # Opportunities module
│ ├── tasks/ # Tasks module
│ └── crm/ # Django project settings
├── frontend/ # SvelteKit frontend
│ ├── src/
│ │ ├── lib/ # Components, stores, utilities
│ │ └── routes/ # SvelteKit routes
│ │ ├── (app)/ # Authenticated app routes
│ │ └── (no-layout)/ # Auth pages (login, etc.)
│ └── static/ # Static assets
└── docker/ # Docker configuration
BottleCRM uses PostgreSQL Row-Level Security (RLS) to ensure complete data isolation between organizations. Every database query is automatically filtered by organization context, providing enterprise-grade security.
# Check RLS status
python manage.py manage_rls --status
# Verify RLS user configuration
python manage.py manage_rls --verify-user
# Test data isolation
python manage.py manage_rls --test# Run tests
cd backend && pytest
# Format code
black . && isort .
# Check dependencies
pipdeptree
pip-check -Hcd frontend
# Type checking
pnpm run check
# Linting
pnpm run lint
# Formatting
pnpm run formatThe API follows RESTful conventions:
GET/POST /api/<module>/ # List/Create
GET/PUT/DELETE /api/<module>/<pk>/ # Detail/Update/Delete
GET/POST /api/<module>/comment/<pk>/ # Comments
GET/POST /api/<module>/attachment/<pk>/ # Attachments
Interactive API documentation is available at /swagger-ui/ when running the backend.
We welcome contributions! Please see our contributing guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Issues: GitHub Issues
- Twitter: @micropyramid
- Commercial Support: Contact us
This project is licensed under the MIT License - see the LICENSE file for details.
This project exists thanks to all the people who contributed.