DevfolioX is a sophisticated personal portfolio web application built with Django framework. It serves as a comprehensive platform for developers, freelancers, and professionals to showcase their work, skills, and experiences in an interactive, customizable format. The application features modern design patterns, cloud integration, AI-powered responses, and extensive customization capabilities.
- Django 5.1.7: Primary web framework
- Python 3.11: Programming language
- Gunicorn 21.2.0: WSGI HTTP server with gevent worker class
- psycopg2-binary: PostgreSQL database adapter
- HTML5/CSS3: Markup and styling
- JavaScript (jQuery): Client-side interactivity
- Bootstrap & Tailwind CSS: UI frameworks
- Font Awesome & Devicon: Icon libraries
- AdminLTE: Admin interface styling
- Cloudinary: Media file storage and management
- PostgreSQL: Production database
- SQLite: Development database
- WhiteNoise: Static file serving
- Google Generative AI: AI-powered contact responses
- GitHub API: Repository integration
- ZeroBounce API: Email validation
- Django Social Auth: OAuth integration
- Docker: Containerization platform
- Render.com: Deployment platform
- Django Admin (Jazzmin): Enhanced admin interface
graph TB
A[Client Browser] --> B[Gunicorn WSGI Server]
B --> C[Django Application]
C --> D[URL Router]
D --> E[View Layer]
E --> F[Model Layer]
F --> G[PostgreSQL Database]
E --> H[Template Engine]
H --> I[Static Files]
J[Cloudinary CDN] --> H
K[External APIs] --> E
subgraph "Django Apps"
L[Branding]
M[Contact]
N[Projects]
O[Skills]
P[Education]
Q[Work Experience]
R[Services]
S[GitHub Integration]
T[Analytics Tracking]
end
The application follows Django's modular app structure with the following core components:
- branding: Personal branding and theme customization
- contact: Contact information and messaging system
- projects: Project showcase and management
- skills: Technical and soft skills representation
- education: Educational background
- work_experience: Professional experience
- services: Service offerings
- github: GitHub repository integration
- tracking: Analytics and visitor tracking
sequenceDiagram
participant U as User
participant V as Views
participant M as Models
participant DB as Database
participant C as Cloudinary
participant AI as Google AI
U->>V: HTTP Request
V->>M: Query Data
M->>DB: Database Query
DB-->>M: Return Data
M-->>V: Model Objects
V->>C: Request Media Files
C-->>V: Media URLs
V->>AI: Generate AI Response
AI-->>V: AI Content
V-->>U: Rendered Template
class PersonalBranding(models.Model):
# Basic Information
name = models.CharField(max_length=100)
tagline = models.CharField(max_length=150)
about = models.TextField()
bio = models.TextField()
# Media Assets
profile_picture = models.ImageField(storage=MediaCloudinaryStorage())
Dark_mode_profile_picture = models.ImageField(storage=MediaCloudinaryStorage())
resume = models.FileField(storage=RawMediaCloudinaryStorage())
# Color Scheme (Light/Dark Mode)
Primary_color = ColorField()
text_color = ColorField()
button_color = ColorField()
hover_color = ColorField()
# SEO & Meta
og_image = models.ImageField()
site_title = models.CharField(max_length=100)
site_description = models.TextField()
classDiagram
class ProgrammingLanguage {
+name: CharField
+custom_entry: CharField
+custom_icon: CharField
+level: IntegerField(35-100)
+icon: property
}
class Framework {
+select_framework: CharField
+custom_entry: CharField
+custom_icon: CharField
+level: IntegerField(35-100)
+icon: property
}
class Tools {
+select_tools: CharField
+custom_entry: CharField
+custom_icon: CharField
+level: IntegerField(35-100)
+icon: property
}
class Database {
+select_database: CharField
+custom_entry: CharField
+custom_icon: CharField
+level: IntegerField(35-100)
+icon: property
}
class SoftSkills {
+select_soft_skills: CharField
+custom_entry: CharField
+custom_icon: CharField
+level: IntegerField(35-100)
+icon: property
}
class Project(models.Model):
# Project Information
name = models.CharField(max_length=100)
one_line_about_the_project = models.CharField(max_length=200)
brief_about_the_project = models.TextField(max_length=1000)
# Technology Stack
technologies_used_1 = models.CharField(max_length=200)
level_in_1 = models.IntegerField(validators=[MinValueValidator(35), MaxValueValidator(100)])
technologies_used_2 = models.CharField(max_length=200)
level_in_2 = models.IntegerField(validators=[MinValueValidator(35), MaxValueValidator(100)])
technologies_used_3 = models.CharField(max_length=200)
level_in_3 = models.IntegerField(validators=[MinValueValidator(35), MaxValueValidator(100)])
# Media Gallery
Card_image = models.ImageField(storage=MediaCloudinaryStorage())
Project_image_1 = models.ImageField(storage=MediaCloudinaryStorage())
Project_image_2 = models.ImageField(storage=MediaCloudinaryStorage())
Project_image_3 = models.ImageField(storage=MediaCloudinaryStorage())
Project_image_4 = models.ImageField(storage=MediaCloudinaryStorage())
Project_image_5 = models.ImageField(storage=MediaCloudinaryStorage())
# External Links
live_demo_url = models.URLField()
github_repo_url = models.URLField()
# Project Details
challenges_faced_with_the_project = models.TextField(max_length=1000)
erDiagram
ContactInfo {
string email
string phone_number
text ai_details
url facebook
boolean facebook_active
url instagram
boolean instagram_active
url twitter
boolean twitter_active
url linkedin
boolean linkedin_active
url github
boolean github_active
}
Client_Message {
string name
string email
text message
text Ai_Response
text Reply
datetime Recived_at
}
ProjectMessage {
foreignkey project
string name
string email
text message
text Ai_response
text Reply
datetime Recived_at
}
ContactInfo ||--o{ Client_Message : receives
Project ||--o{ ProjectMessage : has
Endpoint | View Function | Template | Description |
---|---|---|---|
/ |
index |
index.html |
Homepage with all sections |
/about/ |
about |
about.html |
About section |
/contact/ |
contact |
contact.html |
Contact page |
/projects/ |
projects |
projects.html |
Projects showcase |
/projects/<int:pk>/ |
project_detail |
project_detail.html |
Individual project details |
/services/ |
services |
services.html |
Services offered |
/education/ |
education |
education.html |
Educational background |
/work_experience/ |
work_experience |
work_experience.html |
Professional experience |
/apps/skills/ |
Skills views | Skills templates | Skills management |
/apps/github/ |
github_repos_page |
github_repos.html |
GitHub integration |
Endpoint | Description |
---|---|
/admin/ |
Django admin interface |
/device-charts/ |
Analytics dashboard |
/health/ |
Health check endpoint |
# Contact form submission flow
def contact_page(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
# Save message to database
contact = form.save()
# Generate AI response using Google Generative AI
ai_response = generate_ai_response(contact.message)
contact.Ai_Response = ai_response
contact.save()
# Send email notification
send_email_notification(contact)
return redirect('contact_success')
else:
form = ContactForm()
return render(request, 'contact.html', {'form': form})
The application features a comprehensive theming system that allows users to:
- Light/Dark Mode Support: Dual color schemes with automatic switching
- Custom Color Palettes: 16 customizable color variables
- Automatic Color Generation: AI-powered color extraction from profile pictures
- CSS Variable System: Dynamic CSS custom properties injection
def remove_background_high_quality(self):
"""Remove background from profile picture using rembg"""
img = Image.open(self.profile_picture)
img = img.convert("RGBA")
# Remove background using rembg
no_bg_img = remove(img)
# Resize to maintain quality
no_bg_img = no_bg_img.resize(img.size, Image.LANCZOS)
# Save the processed image
buffer = BytesIO()
no_bg_img.save(buffer, format="PNG", quality=100)
self.profile_picture.save(self.profile_picture.name, ContentFile(buffer.getvalue()))
The skills system provides:
- Programming Languages: 60+ predefined options with custom entry support
- Frameworks: 50+ popular frameworks with version tracking
- Tools: Development tools, CI/CD, monitoring solutions
- Databases: SQL, NoSQL, and specialized database systems
- Soft Skills: Professional and interpersonal abilities
@property
def icon(self):
mapping = {
'Python': 'fab fa-python',
'JavaScript': 'fab fa-js',
'React': 'devicon-react-original',
'Django': 'devicon-django-plain',
# ... extensive icon mapping
}
return mapping.get(self.name, 'fas fa-code')
flowchart TD
A[User Message] --> B[Form Validation]
B --> C[Save to Database]
C --> D[Extract Contact Info]
D --> E[Generate AI Prompt]
E --> F[Google Generative AI API]
F --> G[Process AI Response]
G --> H[Save AI Response]
H --> I[Send Email Notification]
I --> J[Display Success Message]
K[Multiple API Keys] --> F
L[Rate Limiting] --> F
M[Error Handling] --> F
def fetch_github_repos(username):
"""Fetch user repositories from GitHub API"""
url = f"https://api.github.com/users/{username}/repos"
try:
response = requests.get(url)
if response.status_code == 200:
repos = response.json()
return sorted(repos, key=lambda x: x['updated_at'], reverse=True)
except requests.RequestException:
return []
return []
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', # Static file serving
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
The tracking system captures:
- Device Information: Browser, OS, screen resolution
- Geographic Data: IP-based location tracking
- User Behavior: Page views, session duration
- Performance Metrics: Load times, bounce rates
# Custom error handlers
handler404 = custom_404_view
handler500 = custom_500_view
handler403 = custom_403_view
handler400 = custom_400_view
# Database Configuration
USE_POSTGRES=True
DATABASE_URL=postgresql://user:password@host:port/database
# Django Settings
SECRET_KEY=your-secret-key
DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
# Cloud Storage
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# Email Configuration
[email protected]
EMAIL_HOST_PASSWORD=your-app-password
# AI Services
GEMINI_API_KEYS=key1,key2,key3
ZEROBOUNCE_API_KEYS=key1,key2
# Superuser Creation
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=secure-password
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install --upgrade pip && pip install -r requirements.txt
COPY . /code/
RUN python manage.py collectstatic --noinput
CMD sh -c "python manage.py migrate && \
python manage.py createsuperuser --noinput || true && \
python -c 'import os; import django; django.setup(); from django.contrib.auth import get_user_model; User = get_user_model(); user = User.objects.get(username=os.environ[\"DJANGO_SUPERUSER_USERNAME\"]); user.set_password(os.environ[\"DJANGO_SUPERUSER_PASSWORD\"]); user.save()' && \
gunicorn portfolio.wsgi:application --bind 0.0.0.0:$PORT --worker-class gthread --workers 2 --threads 4 --timeout 60"
- Python 3.11+
- pip package manager
- Docker (optional)
- PostgreSQL (for production)
- Cloudinary account
- Google AI API key
git clone https://github.com/Saran24875/SARAN-PORTFOLIO
cd SARAN-PORTFOLIO
python -m venv portfolio_env
source portfolio_env/bin/activate # On Windows: portfolio_env\Scripts\activate
pip install -r requirements.txt
Create .env
file in the project root:
# Copy environment variables from the configuration section above
cp .env.example .env
# Edit .env with your specific values
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic
python manage.py runserver
# Build Docker image
docker build -t saran-portfolio .
# Run with environment file
docker run --env-file .env -p 8000:8000 saran-portfolio
# Configure environment in docker-compose.yml
docker-compose up --build
- Fork the repository
- Connect to Render.com
- Configure environment variables
- Deploy using
render.yaml
configuration
- Navigate to
/admin/
- Login with superuser credentials
- Access all management panels
flowchart TD
A[Access Admin Panel] --> B[Navigate to Branding]
B --> C[Add Personal Information]
C --> D[Upload Profile Pictures]
D --> E[Configure Color Scheme]
E --> F[Set SEO Meta Tags]
F --> G[Upload Resume & Assets]
G --> H[Save Configuration]
- Navigate to Skills section in admin
- Add Programming Languages with proficiency levels (35-100)
- Configure Frameworks used in projects
- List development Tools and their expertise
- Add Database experience
- Include Soft Skills for professional profile
- Add project details and descriptions
- Upload project images (Card image + 5 gallery images)
- Configure technology stack with proficiency levels
- Add live demo and GitHub repository URLs
- Document challenges and achievements
- Set up contact information and social media links
- Configure AI assistant behavior and responses
- Enable/disable social media platform visibility
- Customize contact form appearance
- Homepage: Single-page application with all sections
- About: Personal story and background
- Skills: Interactive skill charts and progress bars
- Projects: Portfolio showcase with filtering
- Services: Professional offerings
- Education: Academic background
- Experience: Work history and achievements
- Contact: Multiple contact methods and form
- Mobile-first responsive layout
- Touch-friendly navigation
- Optimized images for different screen sizes
- Progressive loading for better performance
The system generates intelligent responses to contact inquiries using Google's Generative AI:
- Contact Form Submission → AI Analysis → Contextual Response → Email Notification
- Project Inquiries → Project-Specific Response → Technical Discussion → Follow-up Actions
- Automatic email notifications for new messages
- AI-generated preliminary responses
- Manual reply system with email delivery
- Contact validation using ZeroBounce API
- Real-time visitor tracking
- Device and browser analytics
- Geographic visitor distribution
- Page view statistics
- User engagement metrics
pie title Visitor Analytics Dashboard
"Desktop Users" : 60
"Mobile Users" : 30
"Tablet Users" : 10
Access analytics at /device-charts/
in the admin panel.
- Light/Dark Mode: Automatic theme switching
- Color Schemes: 16 customizable color variables
- Typography: Font selection and sizing
- Layout: Section ordering and visibility
- Dynamic Content: All content manageable via admin panel
- Media Assets: Cloudinary-powered image optimization
- SEO Optimization: Meta tags, Open Graph, Twitter Cards
- Social Integration: Multiple social media platform support
- Static file compression with WhiteNoise
- Cloudinary CDN for media files
- Browser caching for optimal performance
- Gunicorn with gevent for async processing
- Efficient query patterns
- Database indexing for frequently accessed data
- Connection pooling for production environments
- CSRF protection on all forms
- XSS prevention in templates
- Secure headers configuration
- Environment variable protection for sensitive data
- Django admin authentication
- Session security configuration
- Password validation requirements
- OAuth integration support
# Update dependencies
pip install -r requirements.txt --upgrade
# Database maintenance
python manage.py migrate
# Clear cache and rebuild static files
python manage.py collectstatic --clear
# Database backup (PostgreSQL)
pg_dump $DATABASE_URL > backup.sql
- Health check endpoint at
/health/
- Error logging and monitoring
- Performance tracking
- Automated backup systems
Database Connection Issues
# Check database connectivity
python manage.py dbshell
# Reset migrations if needed
python manage.py migrate --fake-initial
Static File Problems
# Rebuild static files
python manage.py collectstatic --clear --noinput
# Check WhiteNoise configuration
DEBUG=True python manage.py runserver
Cloudinary Upload Issues
# Verify API credentials
python -c "import cloudinary; print(cloudinary.config())"
# Test upload functionality
python manage.py shell
AI Response Failures
- Verify Google AI API key validity
- Check API rate limits and quotas
- Review AI prompt configuration in admin panel
- Regular Updates: Keep project portfolio current
- Image Optimization: Use appropriate image sizes and formats
- SEO Maintenance: Update meta descriptions and keywords
- Performance Monitoring: Regular speed and uptime checks
- Version Control: Use Git for all changes
- Testing: Test changes in development environment
- Deployment: Use CI/CD for production deployments
- Monitoring: Set up alerts for system health
This comprehensive manual provides complete guidance for understanding, installing, configuring, and maintaining the DevfolioX application. The system offers powerful customization capabilities while maintaining ease of use for content management and deployment.