A modern, full-featured Client Management System built with Django, designed for freelancers and small businesses to manage their clients and projects efficiently.
- User Authentication - Secure signup, login, and logout
- Client Management - Full CRUD operations with clickable names and detail modals
- Project Management - Track projects with status, rates, and clickable details
- Live Search - HTMX-powered real-time search for clients
- Status Filtering - Filter projects by status (Active, Completed, On Hold)
- Dashboard - Visual statistics with Chart.js (responsive bar/doughnut charts)
- Responsive Tables - Mobile-friendly card layout with data-labels
- Mobile Side Menu - Slide-in navigation from right with dimmed overlay
- Performance Optimized - Database indexes, query optimization, and smart caching
- Git Workflow - Professional branch-per-phase development workflow
- Python 3.12+
- pip
- Virtual environment (venv)
-
Clone the repository
git clone https://github.com/AhmadMWaddah/crm.git cd crm -
Create and activate virtual environment
python3 -m venv .env_crm source .env_crm/bin/activate # On Windows: .env_crm\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env with your settings -
Run migrations
python manage.py migrate
-
Create a superuser
python manage.py createsuperuser
-
Start the development server
python manage.py runserver
-
Access the application
- Main App: http://127.0.0.1:8000/
- Admin Panel: http://127.0.0.1:8000/admin/
crm/
βββ accounts/ # User authentication app
βββ clients/ # Client management app
βββ projects/ # Project management app
βββ crm_project/ # Django project settings
βββ scripts/ # Automation scripts
β βββ dev.sh # Development server
β βββ setup.sh # Initial setup
β βββ test.sh # Run tests
β βββ clean.sh # Cleanup
β βββ git-commit-phase.sh # Git commit helper
β βββ git-merge-phase.sh # Git merge helper
βββ static/ # Custom static files (CSS, JS)
βββ staticfiles/ # Collected static files
βββ .env # Environment variables (not committed)
βββ .env.example # Environment template
βββ requirements.txt # Production dependencies
βββ requirements-dev.txt # Development dependencies
βββ manage.py # Django management script
# Run development server
./scripts/dev.sh
# Run tests
./scripts/test.sh
# Clean project
./scripts/clean.sh
# Commit phase changes
./scripts/git-commit-phase.sh <phase_number> "<message>"
# Merge phase to master
./scripts/git-merge-phase.sh <phase_number>This project uses a branch-per-phase workflow:
- Each phase is developed in its own branch (
phase-1,phase-2, etc.) - Completed phases are merged into
master - All work is tracked and pushed to GitHub
- Backend: Django 6.0
- Database: SQLite (dev) / PostgreSQL (production)
- Frontend: HTML5, CSS3, JavaScript
- Libraries:
- HTMX for dynamic interactions
- Chart.js for data visualization (responsive charts)
- WhiteNoise for static file serving
- Development:
- Pre-commit hooks (Black, Flake8, isort)
- Django Debug Toolbar
- GitHub CLI integration
Part 1: Create Supabase Database
- Sign up at Supabase (no credit card needed)
- Click "New Project"
- Fill in:
- Organization: Your name
- Project name:
django-crm - Database password: Choose a strong password (save this!)
- Region: Choose closest to you
- Click "Create new project"
- Wait 2-3 minutes for database to be ready
- Go to Settings β Database
- Under "Connection string", select URI tab
- Copy the connection string (looks like):
postgresql://postgres:[YOUR-PASSWORD]@db.xxxxx.supabase.co:5432/postgres - Replace
[YOUR-PASSWORD]with your actual database password
Part 2: Create Render Web Service
- Sign up at Render (use GitHub for easiest setup)
- Click "New +" β "Web Service"
- Connect your repository:
- Choose "Connect a repository"
- Select your CRM repository from GitHub
- Configure the service:
Name: django-crm Region: Choose closest to you Branch: master Root Directory: (leave blank) Runtime: Python Build Command: pip install -r requirements.txt Start Command: gunicorn crm_project.wsgi:application Instance Type: Free - Add Environment Variables (click "Advanced" β "Add Environment Variable"):
Key: SECRET_KEY Value: (generate from Python: python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())") Key: DEBUG Value: False Key: ALLOWED_HOSTS Value: <your-app-name>.onrender.com Key: DATABASE_URL Value: postgresql://postgres:YourPassword123@db.xxxxx.supabase.co:5432/postgres?sslmode=require - Click "Create Web Service"
- Wait 5-10 minutes for deployment
- Your app is live at:
https://<your-app-name>.onrender.com
Part 3: Final Setup
After deployment, access the Render dashboard β Logs to see the deployment logs.
To create a superuser, use the Render Shell:
- Go to your service dashboard
- Click "Shell" tab
- Run:
python manage.py createsuperuser
SECRET_KEY=your-production-secret-key
DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
DATABASE_URL=postgresql://user:password@host:port/dbname| Endpoint | Description | Auth Required |
|---|---|---|
/ |
Dashboard redirect | Yes |
/dashboard/ |
User dashboard with stats & charts | Yes |
/accounts/login/ |
Login page | No |
/accounts/signup/ |
Registration page | No |
/accounts/logout/ |
Logout | Yes |
/clients/ |
Client list (responsive cards on mobile) | Yes |
/clients/new/ |
Create client | Yes |
/clients/<id>/ |
Edit client | Yes |
/clients/<id>/delete/ |
Delete client | Yes |
/projects/ |
Project list with status filter | Yes |
/projects/new/ |
Create project | Yes |
/projects/<id>/ |
Edit project | Yes |
/projects/<id>/delete/ |
Delete project | Yes |
/admin/ |
Admin panel | Superuser |
Type in the client search box to filter clients in real-time using HTMX. No page reloads! Filters by name, email, or phone.
- Desktop: Full table with all columns
- Mobile: Transforms to card layout with data-labels
- Priority Hiding: Less important columns hidden on mobile
- Clickable Names: Tap client/project name to see full details in modal
- Slide-in from right with smooth animation
- Dimmed overlay (50% opacity) covers page
- Direct logout button (big red button, impossible to miss)
- Close options: Γ button, tap overlay, or ESC key
Projects can be marked as Active, Completed, or On Hold. Filter by status using the dropdown. Color-coded indicators.
View your business metrics at a glance:
- Total clients and projects
- Active projects count
- Responsive Chart: Doughnut on desktop, horizontal bar on mobile
- Legend shows all statuses with color coding
- Recent clients and projects
- Quick actions grid (2x2 on mobile, row on desktop)
- Dashboard cached per user (5 minutes)
- Cache automatically cleared when data changes
- No need to logout/login to see updated stats
Each user can only see and manage their own clients and projects. Data is completely isolated with database-level security.
| Feature | Desktop | Mobile |
|---|---|---|
| Navigation | Horizontal menu | Side slide-in menu (from right) |
| Tables | Full table view | Card layout with labels |
| Chart | Doughnut chart | Horizontal bar chart |
| Quick Actions | Single row | 2x2 grid |
| Data Display | All columns visible | Priority columns + modal for details |
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
Ahmad MWaddah
- GitHub: @AhmadMWaddah
- Project: Django CRM
- Django community
- HTMX contributors
- All open-source contributors
Built with β€οΈ using Django