How sagarreddypatil/portfolio-website works
Project Type & Purpose
• This is a static website built using a custom static site generator. Its primary goal is to compile markdown posts and reusable HTML templates into a deployable website.
• It combines Python scripts (for the build process and image optimization) with JavaScript tooling (for development tasks, Tailwind CSS integration, and a live dev server).
File Structure – Identify Main Components
• Build System & Scripts:
• src/build.py: Main entry point that orchestrates the build.
• build.sh: A shell script that triggers the production build.
• src/dev-server.py: Provides a live reload development server.
• src/optimize_images.py: Handles image optimization tasks.
• Templating & Rendering:
• src/templates folder (including subdirectories like components and posts): Contains the HTML templates (layout.html, index.html, button.html, fieldset.html, list.html, page.html).
• These templates are used to render the static pages and project posts.
• Content & Posts:
• posts folder: Contains markdown files under projects, which hold the content (project descriptions) to be transformed into HTML pages.
• Assets & Styling:
• public folder:
• photography: Holds raw, unoptimized images that might be processed during builds.
• src/index.css and tailwind.config.js indicate the use of Tailwind CSS for styling.
• Dependency Management & Configurations:
• package.json, pnpm-lock.yaml, yarn.lock: Used for JavaScript dependency management.
• pyproject.toml and poetry.lock: Used for Python dependency management.
• Other configuration files (.gitattributes, .gitignore, .prettierrc) are used for code styling and version control.
• A “Content Handler” that represents the markdown posts in the posts directory, flowing into the Build Engine.
• A “Template Renderer” component (represented by the content in src/templates) that the Build Engine uses to generate HTML pages.
• A “Static Assets & Styling” component connected to the output:
• Public folder (assets & photography).
• Tailwind (referenced by index.css and tailwind.config.js).
• A “Development Server” component (src/dev-server.py) that interacts with the Build Engine during development.
• Dependency management side for:
• JS side (package.json, yarn) and its build/development tools.
• Python side (pyproject.toml, poetry) used by Build Engine and scripts.
• Output directory (likely “dist” as mentioned in the README), where the complete site is generated and ready to be deployed.
Architectural Patterns and Interactions
• The system follows a build pipeline pattern: Taking content (markdown posts) + templates → processing them through the build engine → generating static HTML, optimized assets, and styles.
• A separation of concerns is visible: content, presentation templates, styling, and build orchestration are modularized into different directories.
• External tools (yarn for JavaScript dependencies and poetry for Python) indicate that the build and deployment processes combine multiple languages.