How emmabostian/portfolio works
Project Type and Purpose
• This project is a static site generated using Gatsby (a React-based framework for building fast websites). The directory structure and the usage of Gatsby-specific configuration files (gatsby-config.js, gatsby-node.js, gatsby-browser.js, gatsby-ssr.js) indicate that this is a modern static site or blog with a focus on front-end and content delivery.
• The README confirms that it’s the default Gatsby starter, meant to help kick off new Gatsby projects with a preset build configuration.
File Structure
• Top-level files include configuration files (gatsby-config.js, gatsby-node.js, etc.), package-related files (package.json, package-lock.json), and code style configurations (.prettierrc, .prettierignore).
• The main code lives under the “src” directory, which is divided into:
• components: Reusable UI parts (e.g., navigation, layout, SEO components).
• pages: Page components that map to routes (e.g., index.js, about.js, contact.js, a specialized folder for blog posts like “2019-08-24-cute-cats” containing markdown files).
• templates: Likely used for dynamic page generation for blog posts (e.g., blogPost.js).
• The presence of markdown files in “src/pages” for blog posts and a template for blogPost indicates that this site uses Gatsby’s dynamic page creation system to build blog pages from markdown content.
Architectural Components to Highlight
• Gatsby Core: The configuration files (gatsby-config.js, gatsby-node.js, gatsby-ssr.js, gatsby-browser.js) that manage the build process, API integrations, and runtime behavior.
• Source Code (src) Structure:
• Pages: Represent individual routes and content pages.
• Components: The building blocks of the site's UI.
• Templates: Used to dynamically generate pages (blog posts) from source data.
• Assets: Static images and styling files.
• Dependencies and Ecosystem:
• React as the underlying UI library.
• GraphQL (through Gatsby’s built-in GraphQL interface for data queries).
• Prettier for code formatting.
• A potential deployment flow (the README references Netlify for deployment).
a. Main Components to Include:
• Gatsby Build Engine: Show components like Gatsby Config, Node, SSR, and Browser APIs as building blocks.
• Source Code Modules:
• Pages (including static pages and blog posts generated from markdown).
• Components (UI elements such as Nav, Layout, SEO).
• Templates (blogPost template for dynamic page creation).
• Content & Assets: Separate out markdown content and images.
• Runtime React Layer: The front-end rendered React application.
• External Tools/Services:
• Node Package Manager (npm) for dependency management.
• Deployment platform (e.g., Netlify as referenced in the README).
b. Relationships and Interactions:
• gatsby-config.js feeds metadata and plugin configs into the build.
• gatsby-node.js directs dynamic page creation (e.g., blog posts) from markdown files using templates.
• gatsby-ssr.js and gatsby-browser.js extend the behavior when the site is rendered on the server or client.
• That the “src/pages” directory creates static routes, while the “src/templates” are used by Gatsby to transform markdown content into fully rendered blog posts.
• Data flow from source Markdown files (in src/pages) into the dynamic creation pipeline managed in gatsby-node.js.
c. Architectural Patterns/Design Principles:
• Static Site Generation: The entire site structure is created at build time, optimizing for performance and deployment simplicity.
• Component-Based Structure: The separation of presentational components (“src/components”) which align with React best practices.
• Separation of Concerns: Clear division between content (pages and markdown), UI components, and configuration.
d. Technologies & Frameworks:
• Gatsby (React, GraphQL integration).
• React (UI framework).
• GraphQL (for data queries within the Gatsby ecosystem).
• Prettier (code formatting tool).
• Node.js/NPM (for dependency and build management).
Extra Detail
• Iterative nature of development in Gatsby where changes to files (like those in “src/pages” or “src/components”) trigger real-time updates in the browser via “gatsby develop”.