How arghajit-saha/blogdown works
Project type and purpose
• This is a full-stack, monolithic web application built with Django (an MVT framework) that provides a Markdown-powered blogging platform plus a contact form.
File structure
• Top-level components:
• blogdown/ (project settings: ASGI, WSGI, settings.py, urls.py)
• blog/ (core “app” holding models, views, URLs, migrations, tests)
• static/ (CSS, fonts, JS assets such as marked.js for Markdown parsing and live preview)
• templates/ (HTML templates for pages: base, content, create, contact, about, etc.)
• db.sqlite3 & manage.py & requirements.txt
Key architecture details from README
• Uses Django ORM and views to handle requests
• Stores posts in Markdown format, converts at render time via JavaScript (live preview) and server-side rendering into HTML
• Contact form posts data back to the server, persists in the database, possibly sends email or stores submissions
Main components
a. Client / Browser
• UI layer (HTML templates, CSS, JS—including marked.js)
• Sends HTTP GET/POST to server
• Live Markdown preview via JS (client-side)
b. Web Server (Django app)
• URL Router (blogdown/urls.py + blog/urls.py)
• Views (blog/views.py):
• And detail views for posts
• Create/edit view (accepts Markdown, saves model)
• Contact view (form handling)
• Templates (server-side rendering)
• Models (blog/models.py): Post, ContactMessage
• Migrations & ORM layer (persistence logic)
c. Database (SQLite)
• blog_post table, contact_message table
d. External / Third-party libraries
• marked.js (client-side Markdown→HTML)
• Django, Python standard libs
Relationships and interactions
1. User opens browser → HTTP GET “/” → Django URL Router → Index View → ORM fetch posts → Templates render HTML → Response
2. User clicks “Create” → GET “/create/” → Django returns form template
3. User writes Markdown → JS marked.js shows live preview in browser
4. User submits form (POST “/create/”) → Django View parses form → ORM saves Post (Markdown + metadata) → Redirect/list view
5. User visits a post → GET “/post/<slug>/” → View retrieves Markdown content → Server side can render to HTML (or pass raw Markdown to template which runs marked.js) → Response
6. Contact form flow: GET contact page → user submits → POST → View validates → ORM saves ContactMessage → Optionally send email → Response
Architectural patterns & principles
• Django MVT (Model–View–Template) separation
• Single-process, monolithic architecture
• Client-side vs server-side rendering (hybrid approach)
• REST-style URL design for CRUD operations
• ORM for DB abstraction
Essential elements
• Component labels (e.g., “Django URL Router”, “Post Model”)