How abdallah-ali247/custom-protfolio works
Project type and purpose
• This is a full-stack Django web application (“Portfolio Website”) for architects/interior designers.
• It provides both a public-facing site (to browse projects, view CV, read about/contact the architect) and a login-protected admin dashboard to manage content (projects, images, CV, theme, goals, about info, contact messages).
Main components
a. Client Tier
• Public User Browser – requests HTML/CSS/JS, views projects, submits contact form
• Admin User Browser – logs in to the Dashboard UI for content management
b. Application Tier (Django Server)
• ASGI/WSGI Layer (asgi.py / wsgi.py) handling incoming HTTP(S) requests
• Django Core (“architect_portfolio” settings, URLs, middleware)
• Apps:
• core – public-site models, views, templates, custom template filters
• dashboard – admin-site views, models (if any), templates
• Template Engine – renders templates in architect_portfolio/templates and per-app templates
• Static Files Handler – serves CSS, JS, fonts (managed via static/ + possibly WhiteNoise or CDN)
• Media Upload Handler – stores and serves user-uploaded CV PDFs and project images (media/ tree)
c. Data Tier
• Relational Database – SQLite in development (db.sqlite3) or PostgreSQL/MySQL in production
• Migrations – Django ORM migrations under core/migrations and dashboard/migrations
d. External Services
• Email SMTP Server – handles outgoing contact form emails
• (Optional) CDN or Object Storage – for production media & static file hosting
e. Deployment Infrastructure
• Procfile – declares entry point (e.g., “gunicorn architect_portfolio.wsgi”) for Heroku or similar
• Virtual Environment – venv holds Python dependencies
• requirements.txt – lists Python packages
Relationships and data flows
• Public or Admin Browser → HTTP(S) → Django ASGI/WSGI → URL router → view function
• View ↔ ORM → Database (CRUD on models)
• View → Template Engine → HTML response → Browser
• Browser ← Static assets (CSS/JS) ← Static handler/CDN
• Browser ← Media assets (images, PDFs) ← Media handler/CDN
• Contact form submission → Django view → SMTP client → Email provider
• Admin actions (Add/Edit) → File upload → Media storage → File system or external object store
Architectural patterns & design principles
• MTV Pattern (Model-Template-View)
• App modularization: “core” app for public functionality, “dashboard” app for admin panel
• Separation of concerns: static vs dynamic content, public vs admin, code vs configuration
• DRY templates with a shared base.html and dashboard/base.html
Detail level
• Django app as a sub-component
• Template directories vs static directories
• Config files (settings.py, Procfile) in the deployment context