How thetechie/my-blog works
Project Type and Purpose
• This is a static site (personal blog) built with GatsbyJS (React + GraphQL SSG).
• Purpose: convert Markdown content + React templates + assets into a fully static website, then host it (Netlify).
File Structure
Top level:
– Configuration & CI:
• gatsby‐config.js, gatsby‐node.js (Gatsby setup & page‐creation hooks)
• netlify.toml (deploy rules)
• .eslintrc, .prettierrc, .codeclimate.yml, travis.yml (linting, formatting, CI)
– src/:
• assets/ (fonts, SCSS) → visual styling resources
• components/ (React pieces: Layout, Menu, Sidebar, Post, Disqus, etc.)
• pages/ (entry points: index.jsx, 404.jsx, category/tag listings, Markdown content under articles/ & pages/)
• templates/ (category‐template.jsx, post‐template.jsx, etc. – used by Gatsby’s GraphQL‐driven page creation)
README for Insights
– “my personal blog listing my work and profile”: confirms static, content‐centric, no server-side logic at runtime.
Main Components
a. Developer & Source Control
– Local code repository (Git) pushes to remote (e.g., GitHub).
b. Continuous Integration & Quality
– Travis CI (travis.yml) runs lint (ESLint), formatting checks (Prettier), optional tests, reports to CodeClimate.
c. Build System
– Netlify (triggered on push) calls Gatsby CLI:
• Reads gatsby-config.js & gatsby-node.js
• Parses Markdown files via GraphQL data layer
• Runs React templates + components + SCSS → generates static HTML, CSS, JS in /public
d. Data Layer (at build time only)
– GraphQL schema: sources content from src/pages/**/*.md, images, site metadata
e. Presentation Layer
f. Hosting & Delivery
– Netlify’s CDN serves the static /public site to end users (browsers).
g. External Integrations
– Disqus for comments (client‐side embed)
– Analytics (if configured, not in tree)
Relationships & Interactions
• Netlify CI → (runs) → Gatsby build → outputs /public
• Netlify CDN → serves static assets → End user browser
• Gatsby build:
– GraphQL Data Layer ← Markdown files, siteConfig
– React Templates + Data → Static HTML files
– SCSS & CSS → bundled styles
– JS bundle (runtime React for client side features like Disqus embed)
• Disqus component → client‐side network call to Disqus service
Architectural Patterns & Principles
– Static Site Generation: no server logic at runtime
– Component‐Based UI: React components + SCSS modules
– Data‐Driven Templates: GraphQL queries in templates + gatsby-node page creation
– CI/CD: automated lint, build, deploy
– Separation of Concerns: assets / styling / content / templates / configs clearly separated
– Clear labels: “Developer,” “GitHub (repo),” “Travis CI,” “Netlify Build,” “Gatsby GraphQL Layer,” “React Templates,” “Disqus,” “Netlify CDN,” “Browser”
• Config & CI (e.g., blue)
• Build process (e.g., green)
• Static assets & content (e.g., yellow)
• Runtime delivery & external services (e.g., orange)