|
1 | | -# Django-CRM |
2 | | - |
3 | | -============ |
4 | | - |
5 | | -Django CRM is opensource CRM developed on django framework. It has all |
6 | | -the basic features of CRM to start with. We welcome code contributions |
7 | | -and feature requests via github. |
8 | | - |
9 | | -## Project Status and Future Direction |
10 | | - |
11 | | -### Background |
12 | | - |
13 | | -9 years ago, I launched this project with a mission to provide startups with a free, open-source, and customizable CRM solution, addressing the high subscription costs of commercial alternatives. Initially developed as a Django full-stack application, the project evolved significantly with the support of a dedicated team. However, maintaining the team and covering salaries depleted resources, and I was unable to renew the domain. Recognizing the need for a modernized user experience, I explored updating the frontend with React but ultimately faced financial and team constraints. |
14 | | - |
15 | | -### Moving Forward |
16 | | - |
17 | | -To align with the project’s vision and address these challenges, I’ve shifted development to a new repository using **SvelteKit** and **Prisma** for a robust, fast, and feature-rich framework. A Minimum Viable Product (MVP) was released last week at [MicroPyramid/Django-CRM](https://github.com/MicroPyramid/Django-CRM). |
18 | | - |
19 | | -#### Key Updates: |
20 | | - |
21 | | -- **Current Repository:** No further updates will be made to this repository. |
22 | | - |
23 | | -- **New Repository:** Development will continue in the new SvelteKit-based repository. |
24 | | - |
25 | | -- **Mobile App:** Enhancements to the Flutter-based mobile app [MicroPyramid/flutter-crm](https://github.com/MicroPyramid/flutter-crm) will depend on increased user engagement or support from a paying client. |
26 | | - |
27 | | - |
28 | | -### Future Vision |
29 | | - |
30 | | -This project is far from dead, it’s evolving. I’m committed to its growth and open to discussions about its direction, contributions, or potential collaborations. Feel free to reach out with ideas or feedback. |
31 | | - |
32 | | -Thank you for your support and understanding. |
33 | | - |
34 | | -## Runcode |
35 | | - |
36 | | - Runcode is online developer workspace. It is cloud based simple, secure and ready to code workspaces, assuring high performance & fully configurable coding environment. With runcode you can run django-crm(API) with one-click. |
| 1 | +# BottleCRM |
| 2 | + |
| 3 | +A modern, open-source CRM platform built with Django REST Framework and SvelteKit. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +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. |
| 14 | + |
| 15 | +**Try it free**: [bottlecrm.io](https://bottlecrm.io/) |
| 16 | + |
| 17 | +## Features |
| 18 | + |
| 19 | +### Core CRM Modules |
| 20 | +- **Leads** - Track and manage sales leads through your pipeline |
| 21 | +- **Accounts** - Manage company/organization records |
| 22 | +- **Contacts** - Store and organize contact information |
| 23 | +- **Opportunities** - Track deals and sales opportunities |
| 24 | +- **Cases** - Customer support case management |
| 25 | +- **Tasks** - Task management with calendar and Kanban board views |
| 26 | +- **Invoices** - Create and manage invoices |
| 27 | + |
| 28 | +### Platform Features |
| 29 | +- **Multi-Tenant Architecture** - PostgreSQL RLS for secure data isolation between organizations |
| 30 | +- **JWT Authentication** - Secure token-based authentication |
| 31 | +- **Team Management** - Organize users into teams with role-based access |
| 32 | +- **Activity Tracking** - Comprehensive audit logs and activity history |
| 33 | +- **Comments & Attachments** - Collaborate with comments and file attachments on any record |
| 34 | +- **Tags** - Flexible tagging system for organizing records |
| 35 | +- **Email Integration** - AWS SES integration for transactional emails |
| 36 | +- **Background Tasks** - Celery + Redis for async task processing |
| 37 | + |
| 38 | +## Tech Stack |
| 39 | + |
| 40 | +### Backend |
| 41 | +- **Django 5.x** with Django REST Framework |
| 42 | +- **PostgreSQL** with Row-Level Security (RLS) |
| 43 | +- **Redis** for caching and Celery broker |
| 44 | +- **Celery** for background task processing |
| 45 | +- **JWT** for authentication |
| 46 | +- **AWS S3** for file storage |
| 47 | +- **AWS SES** for email delivery |
| 48 | + |
| 49 | +### Frontend |
| 50 | +- **SvelteKit 2.x** with Svelte 5 (runes) |
| 51 | +- **TailwindCSS 4** for styling |
| 52 | +- **shadcn-svelte** UI components |
| 53 | +- **Zod** for schema validation |
| 54 | +- **Axios** for API communication |
| 55 | +- **Lucide** icons |
| 56 | + |
| 57 | +## Quick Start |
| 58 | + |
| 59 | +### Prerequisites |
| 60 | +- Python 3.10+ |
| 61 | +- Node.js 18+ with pnpm |
| 62 | +- PostgreSQL 14+ |
| 63 | +- Redis |
| 64 | + |
| 65 | +### Backend Setup |
| 66 | + |
| 67 | +```bash |
| 68 | +# Clone the repository |
| 69 | +git clone https://github.com/MicroPyramid/Django-CRM.git |
| 70 | +cd Django-CRM |
| 71 | + |
| 72 | +# Create and activate virtual environment |
| 73 | +cd backend |
| 74 | +python -m venv venv |
| 75 | +source venv/bin/activate # On Windows: venv\Scripts\activate |
| 76 | + |
| 77 | +# Install dependencies |
| 78 | +pip install -r requirements.txt |
37 | 79 |
|
| 80 | +# Set up environment variables (see env.md for details) |
| 81 | +cp .env.example .env |
| 82 | +# Edit .env with your database and other settings |
38 | 83 |
|
39 | | -- Open below link to create django-crm workspace on [RunCode](https://runcode.io/ "RunCode"). It will create django-crm API |
| 84 | +# Run migrations |
| 85 | +python manage.py migrate |
40 | 86 |
|
41 | | - [](https://runcode.io) |
| 87 | +# Create a superuser |
| 88 | +python manage.py createsuperuser |
42 | 89 |
|
43 | | -- After running API, Go to Frontend UI [React CRM](https://github.com/MicroPyramid/react-crm "React CRM") project to create new workspace with runcode. |
| 90 | +# Start the development server |
| 91 | +python manage.py runserver |
| 92 | +``` |
44 | 93 |
|
45 | | -## Docs |
| 94 | +### Frontend Setup |
46 | 95 |
|
47 | | -Please [Click Here](http://django-crm.readthedocs.io "Click Here") for latest documentation. |
| 96 | +```bash |
| 97 | +# In a new terminal, from the project root |
| 98 | +cd frontend |
48 | 99 |
|
49 | | -## Project Modules |
50 | | -This project contains the following modules: |
51 | | -- Contacts |
52 | | -- Companies |
53 | | -- Leads |
54 | | -- Accounts |
55 | | -- Invoices (todo) |
56 | | -- Cases (todo) |
57 | | -- Opportunity (todo) |
| 100 | +# Install dependencies |
| 101 | +pnpm install |
58 | 102 |
|
59 | | -## Try for free [here](https://bottlecrm.io/) |
| 103 | +# Start the development server |
| 104 | +pnpm run dev |
| 105 | +``` |
60 | 106 |
|
61 | | -## Installation Guide |
| 107 | +### Start Celery Worker |
62 | 108 |
|
63 | | -We recommend ubuntu 20.04. These instructions are verified for ubuntu 20.04. |
| 109 | +```bash |
| 110 | +# In a new terminal |
| 111 | +cd backend |
| 112 | +source venv/bin/activate |
| 113 | +celery -A crm worker --loglevel=INFO |
| 114 | +``` |
64 | 115 |
|
65 | | -#### To install system requirements |
| 116 | +### Access the Application |
| 117 | +- **Frontend**: http://localhost:5173 |
| 118 | +- **API Documentation**: http://localhost:8000/swagger-ui/ |
| 119 | +- **Admin Panel**: http://localhost:8000/admin/ |
66 | 120 |
|
67 | | -``` |
68 | | -sudo apt update && sudo apt upgrade -y |
| 121 | +## Docker Setup |
69 | 122 |
|
70 | | -sudo apt install python-is-python3 xvfb libfontconfig wkhtmltopdf python3-dev python3-pip build-essential libssl-dev libffi-dev python3-venv redis-server redis-tools virtualenv -y |
| 123 | +```bash |
| 124 | +# Build and run with Docker Compose |
| 125 | +docker build -t bottlecrm:latest -f docker/dockerfile . |
| 126 | +docker-compose -f docker/docker-compose.yml up |
71 | 127 | ``` |
72 | 128 |
|
73 | | -#### Install dependencies |
74 | | - |
75 | | -##### Optional (based on personal choice) |
| 129 | +## Project Structure |
76 | 130 |
|
77 | 131 | ``` |
78 | | -sudo apt update && sudo apt upgrade -y && sudo apt install zsh python3-virtualenv |
| 132 | +Django-CRM/ |
| 133 | +├── backend/ # Django REST API |
| 134 | +│ ├── accounts/ # Accounts module |
| 135 | +│ ├── cases/ # Cases module |
| 136 | +│ ├── common/ # Shared models, utilities, RLS |
| 137 | +│ ├── contacts/ # Contacts module |
| 138 | +│ ├── invoices/ # Invoices module |
| 139 | +│ ├── leads/ # Leads module |
| 140 | +│ ├── opportunity/ # Opportunities module |
| 141 | +│ ├── tasks/ # Tasks module |
| 142 | +│ └── crm/ # Django project settings |
| 143 | +├── frontend/ # SvelteKit frontend |
| 144 | +│ ├── src/ |
| 145 | +│ │ ├── lib/ # Components, stores, utilities |
| 146 | +│ │ └── routes/ # SvelteKit routes |
| 147 | +│ │ ├── (app)/ # Authenticated app routes |
| 148 | +│ │ └── (no-layout)/ # Auth pages (login, etc.) |
| 149 | +│ └── static/ # Static assets |
| 150 | +└── docker/ # Docker configuration |
| 151 | +``` |
79 | 152 |
|
80 | | -sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
| 153 | +## Multi-Tenancy & Security |
81 | 154 |
|
82 | | -pip install virtualenvwrapper |
| 155 | +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. |
83 | 156 |
|
84 | | -echo "source /home/ubuntu/.local/bin/virtualenvwrapper.sh" >> ~/.zshrc |
85 | | -``` |
| 157 | +```bash |
| 158 | +# Check RLS status |
| 159 | +python manage.py manage_rls --status |
86 | 160 |
|
87 | | -If you want to install postgres, follow https://www.postgresql.org/download/ |
88 | | -#### To modify postgresql root password |
| 161 | +# Verify RLS user configuration |
| 162 | +python manage.py manage_rls --verify-user |
89 | 163 |
|
90 | | -``` |
91 | | -sudo -u postgres psql |
92 | | -ALTER USER postgres WITH PASSWORD 'root'; |
| 164 | +# Test data isolation |
| 165 | +python manage.py manage_rls --test |
93 | 166 | ``` |
94 | 167 |
|
95 | | -#### Create and activate a virtual environment. |
96 | | -if you installed and configured virtualenv wrapper then use the following |
97 | | -``` |
98 | | -mkvirtualenv <env_name> |
99 | | -workon <env_name> |
100 | | -``` |
101 | | -or else |
102 | | -``` |
103 | | -virtualenv venv |
104 | | -source venv/bin/activate |
105 | | -``` |
106 | | -Install the project's dependency after activating env |
107 | | - |
108 | | -``` |
109 | | -pip install -r requirements.txt |
110 | | -``` |
| 168 | +## Development |
111 | 169 |
|
112 | | -### Env variables |
| 170 | +### Backend Commands |
113 | 171 |
|
114 | | -* Then refer to `env.md` for environment variables and keep those in the `.env` file in the current folder as your project is in. |
| 172 | +```bash |
| 173 | +# Run tests |
| 174 | +cd backend && pytest |
115 | 175 |
|
| 176 | +# Format code |
| 177 | +black . && isort . |
116 | 178 |
|
117 | | -### Docker / docker-compose |
118 | | -in order to use docker, please run the next commands after cloning repo: |
119 | | -``` |
120 | | -docker build -t djcrm:1 -f docker/dockerfile . |
121 | | -docker-compose -f docker/docker-compose.yml up |
| 179 | +# Check dependencies |
| 180 | +pipdeptree |
| 181 | +pip-check -H |
122 | 182 | ``` |
123 | 183 |
|
124 | | -**Note**: you must have docker/docker-compose installed on your host. |
125 | | -### next steps |
| 184 | +### Frontend Commands |
126 | 185 |
|
| 186 | +```bash |
| 187 | +cd frontend |
127 | 188 |
|
128 | | -``` |
129 | | -python manage.py migrate |
130 | | -python manage.py runserver |
131 | | -``` |
132 | | -- Then open http://localhost:8000/swagger-ui/ in your browser to explore API. |
133 | | - |
134 | | -- After running API, Go to Frontend UI [React CRM](https://github.com/MicroPyramid/react-crm "React CRM") project to configure Fronted UI to interact with API. |
| 189 | +# Type checking |
| 190 | +pnpm run check |
135 | 191 |
|
| 192 | +# Linting |
| 193 | +pnpm run lint |
136 | 194 |
|
137 | | -## Start celery worker in another terminal window |
| 195 | +# Formatting |
| 196 | +pnpm run format |
| 197 | +``` |
138 | 198 |
|
139 | | -celery -A crm worker --loglevel=INFO |
| 199 | +## API Documentation |
140 | 200 |
|
141 | | -### Useful tools and packages |
| 201 | +The API follows RESTful conventions: |
142 | 202 |
|
143 | 203 | ``` |
144 | | -pipdeptree # to see pip dependency tree |
145 | | -black # to format code to meet python coding standards |
146 | | -pip-check -H # to see upgradable packages |
147 | | -isort # to sort imports in python |
| 204 | +GET/POST /api/<module>/ # List/Create |
| 205 | +GET/PUT/DELETE /api/<module>/<pk>/ # Detail/Update/Delete |
| 206 | +GET/POST /api/<module>/comment/<pk>/ # Comments |
| 207 | +GET/POST /api/<module>/attachment/<pk>/ # Attachments |
148 | 208 | ``` |
149 | 209 |
|
150 | | -### Community |
| 210 | +Interactive API documentation is available at `/swagger-ui/` when running the backend. |
151 | 211 |
|
152 | | -**Note: This repository is no longer actively maintained.** For the latest development and community support, please visit our new SvelteKit-based CRM project: |
| 212 | +## Contributing |
153 | 213 |
|
154 | | -- **New Project**: [MicroPyramid/Django-CRM](https://github.com/MicroPyramid/Django-CRM) |
155 | | -- Follow [@micropyramid](<https://twitter.com/micropyramid>) on Twitter |
156 | | -- For questions about the legacy Django CRM, check [past issues](<https://github.com/MicroPyramid/Django-CRM/issues>) |
157 | | -- For new feature requests and active development, visit the [new repository](https://github.com/MicroPyramid/Django-CRM) |
158 | | -- For commercial support [Contact us](https://micropyramid.com/contact-us/) |
| 214 | +We welcome contributions! Please see our contributing guidelines for details. |
159 | 215 |
|
160 | | -## Credits |
| 216 | +1. Fork the repository |
| 217 | +2. Create a feature branch (`git checkout -b feature/amazing-feature`) |
| 218 | +3. Commit your changes (`git commit -m 'Add amazing feature'`) |
| 219 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 220 | +5. Open a Pull Request |
161 | 221 |
|
162 | | -### Contributors |
| 222 | +## Community |
163 | 223 |
|
164 | | -This project exists thanks to all the people who contributed during its active development! |
| 224 | +- **Issues**: [GitHub Issues](https://github.com/MicroPyramid/Django-CRM/issues) |
| 225 | +- **Twitter**: [@micropyramid](https://twitter.com/micropyramid) |
| 226 | +- **Commercial Support**: [Contact us](https://micropyramid.com/contact-us/) |
165 | 227 |
|
166 | | - |
| 228 | +## License |
167 | 229 |
|
168 | | -### Legacy Project Notice |
| 230 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
169 | 231 |
|
170 | | -This Django CRM repository is now in maintenance mode. While we welcome your feedback and appreciate past contributions, active development has moved to our new SvelteKit-based CRM solution at [MicroPyramid/Django-CRM](https://github.com/MicroPyramid/Django-CRM). |
| 232 | +## Contributors |
171 | 233 |
|
172 | | -For commercial support [Contact us](https://micropyramid.com/contact-us/) |
| 234 | +This project exists thanks to all the people who contributed. |
173 | 235 |
|
174 | | -# Trigger deploy |
| 236 | + |
175 | 237 |
|
0 commit comments