How avniproject/avni-website works
This project is a static website built with GatsbyJS that serves as a content-rich site for publishing blogs, case studies, and other informational pages. It is deployed on Netlify and uses Markdown files to generate pages via Gatsby’s build process. Additionally, there are serverless Lambda functions and CMS integration for previewing content, which further impact its overall architecture.
Main Components
a. Frontend (Static Site Generator):
• Gatsby Build Process: Illustrate the core role of the gatsby-config.js and gatsby-node.js files that define how pages and templates are created.
• Source Content: Show the separation between Markdown pages (located in src/pages) and React components/templates (found under src/components and src/templates) that render the pages.
• Image and Static Assets: Represent assets (images, styles, etc.) held in both src/img and static directories.
b. Content Management and Blog System:
• Markdown Content: Indicate that blog posts, case studies, and other pages are written in Markdown and stored as files under src/pages (or a dedicated folder like src/blog).
• CMS Integration: Denote the Netlify CMS (static/admin with its config.yml) and preview templates inside src/cms, which allow non-developer contributions and live previews.
c. Serverless Functions:
• Lambda Functions: Include the lambda directories (both in the root and under src/lambda) representing serverless endpoints (for example, the hello.js functions) that might handle API requests or dynamic functionality.
d. Deployment and DevOps:
• Netlify Deployment: Represent the netlify.toml file which configures deployment, along with continuous integration via GitHub (see .github folder templates for issues and pull requests).
• Build & Dependency Management: Note the Makefile, package.json, and related configuration files that manage dependency installation and build scripts.
Relationships and Interactions
• Data Flow: Begin with “Developer/Content Editor” updating Markdown files and/or CMS configuration.
• The Gatsby build process ingests this content (via GraphQL queries) and generates static HTML/CSS/JS.
• The static assets, React components, and templates combine to render the final pages.
• Serverless Lambda functions, when triggered (for example, via API calls or specific requests), interact with the site as needed.
• The Netlify deployment process takes the generated site and publishes it live, with the CDN delivering the static assets.
• The Netlify CMS provides an admin interface (located in static/admin) which interacts with content files and preview templates.
Architectural Patterns/Design Principles
• Separation of Concerns: Clear division between content (Markdown, CMS), presentation (React components, templates), and backend functionality (serverless functions).
• Static Site Generation: Use of Gatsby’s pre-rendering mechanism to optimize performance.
• Modular Design: Organized folder structure that encapsulates components, utilities, and templates separately.
Relevant Technologies and Frameworks
• GatsbyJS (static site generator, React-based components)
• Netlify (hosting and serverless functions)
• Markdown for content creation
• Node.js (via npm scripts, lambda functions)
• GitHub for version control and community collaboration (including CI/CD with Netlify)