How mexrojxon/my_portfolio works
Project type and purpose
• This is a monolithic full‑stack web application built on Django (Python).
• It serves as a personal portfolio site with two main sections: an “About” app (resume, education, experience, contact, social links, portfolio items) and a “Blog” app (posts, comments).
• It uses Django’s MTV (Model‑Template‑View) architecture, with static/asset pipelines for CSS, JS, images, and an integrated rich‑text editor (CKEditor).
File‑structure analysis
• Top‑level: ─ manage.py (Django CLI), requirements.txt, config/ (project settings & routing), about/ and blog/ apps (models, views, forms, URL conf, migrations).
• Static assets: two parallel trees—“assets/” (project‑specific CSS/JS/fonts/images/files) and “static/” (Django‑collected static, admin assets, CKEditor).
• Templates for each app and a shared base.html in templates/.
• No microservices; all code runs in a single Django process (WSGI/ASGI).
Key README insight
• Minimal README (“My_portfolio”), but file names and structure reveal Django conventions and third‑party integrations (CKEditor, hitcount).
a. Client/browser
• Renders HTML/CSS/JS; downloads assets (CSS, JS, images, fonts).
b. Web server & application server
• Nginx (or Apache) to serve static files and proxy to Django.
• Gunicorn/Uvicorn/Daphne running Django (WSGI/ASGI).
c. Django project
• config/ (settings, URL router, WSGI/ASGI entrypoint)
• Apps: about/ and blog/ handling HTTP endpoints.
• Middleware (security, sessions, CSRF, hit‑count tracker).
• Forms (contact form posting).
• Admin site (configurable via config/settings.py + static/admin).
d. Database
• Relational DB (SQLite, Postgres, MySQL) storing models: ResumeModel, EducationModel, ExperienceModel, PortfolioModel, ContactModel, SocialMediaModel, BlogPostModel, CommentModel, HitCount.
e. External services
• SMTP or third‑party email service for contact form.
• CDN or object storage (optional) for serving static/media.
f. Third‑party libraries
• CKEditor for rich text editing in admin/blog forms.
• jQuery plugins (smoothscroll, pagepiling).
• Django‑hitcount for tracking blog views.
Relationships and data flow
• Browser → HTTP request → Nginx → Django entrypoint (WSGI/ASGI).
• URL router → Middleware → App view → (a) Query ORM → Database → return Model instances; (b) Validate Form → send email or save ContactModel.
• View → Render template with context → HTML → back through Nginx → Browser.
• Static requests → Nginx serves from /static/ or /assets/.
• Admin user → login → Django admin app → CRUD models.
• CKEditor assets loaded in admin forms via static/ckeditor/.
Architectural patterns and principles
• MTV (Model‑Template‑View)
• Separation of concerns:
• Models hold data schema
• Views (and forms) handle business logic and validation
• Templates handle presentation
• Layered architecture:
• Presentation (Browser + templates)
• Application (Django apps)
• Data (Database)
• Reuse and modularity: discrete apps (about, blog), reusable static/asset bundles.
Essential elements to capture
• Entry points: manage.py (dev), WSGI/ASGI (prod)
• URL dispatcher
• Middleware chain (CSRF, sessions, hit‑count)
• App modules (about, blog) with their models/views/forms
• Database schema simplified to main entities
• Static asset pipeline (assets → collectstatic → static/)
• External SMTP/CDN if used
• Admin interface as a separate flow