A comprehensive dental clinic management system built with Django
- β¨ Features
- ποΈ Architecture
- π Quick Start
- π³ Docker Deployment
- βοΈ Configuration
- π Project Structure
- π§ Development
- π API Endpoints
- π€ Contributing
- π License
- Patient Management - Complete patient records and history
- Appointment Scheduling - Advanced booking system with calendar integration
- Doctor Dashboard - Comprehensive doctor profiles and schedules
- Service Management - Dental services catalog with detailed descriptions
- Gallery System - Before/after photos and clinic gallery
- Blog System - Educational content and news management
- Multi-level Authentication - Custom user system with role-based access
- Brute Force Protection - Django Axes integration
- reCAPTCHA Integration - Google reCAPTCHA v3 protection
- Secure Admin Panel - Randomized admin URLs
- Password Reset System - Secure OTP-based password recovery
- Responsive Design - Mobile-first approach
- Persian/Farsi Support - Full RTL language support
- Rich Text Editor - CKEditor 5 with Persian language pack
- Advanced Caching - Redis-powered caching system
- SEO Optimized - Meta tags and structured data
- Celery Task Queue - Asynchronous task processing
- Redis Caching - High-performance caching layer
- Database Optimization - Efficient queries with select_related/prefetch_related
- Static File Optimization - Compressed and minified assets
- Docker Support - Containerized deployment
graph TB
A[Nginx Proxy] --> B[Django Application]
B --> C[PostgreSQL Database]
B --> D[Redis Cache]
B --> E[Celery Workers]
E --> D
B --> F[Static Files]
B --> G[Media Files]
| Component | Technology | Version |
|---|---|---|
| Backend | Django | 5.1.7 |
| Database | PostgreSQL | 15 |
| Cache | Redis | Latest |
| Task Queue | Celery | 5.4.0 |
| Web Server | Nginx | Latest |
| WSGI Server | Gunicorn | 23.0.0 |
| Containerization | Docker | Latest |
- Python 3.11+
- PostgreSQL 15+
- Redis
- Git
git clone https://github.com/amirhosein2004/Dental.git
cd Dentalpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root:
# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database Configuration
DB_ENGINE=django.db.backends.postgresql
DB_NAME=dental_db
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432
# Redis Configuration
REDIS_URL=redis://127.0.0.1:6379/1
REDIS_URL_CELERY=redis://localhost:6379/0
# Email Configuration
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password
# reCAPTCHA Keys
RECAPTCHA_PUBLIC_KEY=your-recaptcha-public-key
RECAPTCHA_PRIVATE_KEY=your-recaptcha-private-key
# Security
OTP_SECRET_KEY=your-otp-secret
RESET_PREFIX=your-reset-prefix
RESET_SUFFIX=your-reset-suffix
SECURE_ADMIN_PANEL=your-admin-urlpython manage.py makemigrations
python manage.py migrate
python manage.py createsuperuserpython manage.py collectstaticpython manage.py runserverVisit http://127.0.0.1:8000 to see the application.
# Clone the repository
git clone https://github.com/amirhosein2004/Dental.git
cd Dental
# Create .env file (see configuration section)
cp .env.example .env
# Build and run with Docker Compose
docker-compose up -d
# Run migrations
docker-compose exec web python manage.py migrate
# Create superuser
docker-compose exec web python manage.py createsuperuser
# Collect static files
docker-compose exec web python manage.py collectstatic --noinputThe Docker setup includes:
- Web: Django application with Gunicorn
- Database: PostgreSQL 15
- Cache: Redis
- Celery Worker: Background task processing
- Celery Beat: Scheduled tasks
- Nginx: Reverse proxy and static file serving
| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Django secret key | Auto-generated |
DEBUG |
Debug mode | False |
ALLOWED_HOSTS |
Allowed hosts | * |
DB_ENGINE |
Database engine | sqlite3 |
REDIS_URL |
Redis cache URL | redis://127.0.0.1:6379/1 |
EMAIL_HOST |
SMTP host | smtp.gmail.com |
LANGUAGE_CODE |
Language code | en-us |
TIME_ZONE |
Time zone | UTC |
The project consists of the following Django applications:
home- Homepage and landing pagesaccounts- User authentication and profilesdashboard- Doctor dashboard and managementservice- Dental services managementblog- Blog and news systemgallery- Image gallery managementcontact- Contact forms and informationabout- About pages and clinic informationpricing- Pricing services managementcore- Core models and utilitiesusers- Custom user model
Dental/
βββ π Dental/ # Main Django project
β βββ π settings/ # Environment-specific settings
β β βββ base.py # Base settings
β β βββ dev.py # Development settings
β β βββ prod.py # Production settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
β βββ celery.py # Celery configuration
βββ π home/ # Homepage app
βββ π accounts/ # Authentication app
βββ π dashboard/ # Doctor dashboard
βββ π service/ # Services management
βββ π blog/ # Blog system
βββ π gallery/ # Gallery management
βββ π contact/ # Contact system
βββ π about/ # About pages
βββ π pricing/ # Pricing services management
βββ π core/ # Core functionality
βββ π users/ # Custom user model
βββ π utils/ # Utility functions
βββ π templates/ # Global templates
βββ π static/ # Static files
βββ π media/ # User uploads
βββ requirements.txt # Python dependencies
βββ docker-compose.yml # Docker configuration
βββ Dockerfile # Docker image
βββ nginx.conf # Nginx configuration
βββ manage.py # Django management script
-
Install development dependencies:
pip install -r requirements.txt
-
Enable debug toolbar:
# In .env file DEBUG=True
The project follows Django best practices:
- PEP 8 compliance
- Class-based views for better organization
- Model managers for complex queries
- Custom middleware for additional functionality
- Comprehensive caching strategy
# Create new migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Show migration status
python manage.py showmigrationsPOST /auth/login/- User loginPOST /auth/logout/- User logoutPOST /auth/register/- User registrationPOST /auth/password-reset/- Password reset requestPOST /auth/password-reset-confirm/- Password reset confirmation
We welcome contributions! Please follow these steps:
- 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
- Follow Django coding standards
- Write comprehensive tests
- Update documentation
- Use meaningful commit messages
- Ensure backward compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- Django Community for the excellent framework
- Persian Django Community for localization support
- Contributors who helped improve this project
- Website: sbdental.ir
- Email: drsbdentals@gmail.com
Made with β€οΈ for the dental community
β Star this repository if it helped you! β