How vishaltalreja01/portfolio works
Main Components
• Data Layer: This includes the “src/data” directory with configuration files, internal data factories (e.g., create-link-factory, create-skill-factory), data transformation scripts (transform-data.ts, transformers.ts), and section-specific data files for education, experience, portfolio, skills, testimonials, and favorites.
• Web Frontend: Found in “src/web”, it contains multiple components and sections that render the online resume. There’s a clear separation of layout, reusable components (e.g., description.astro, sidebar, theme-toggle), and section-specific pages.
• PDF Generation Module: The “src/pdf” directory contains specialized components and sections for generating a print/PDF version of the resume. It includes its own versions of components such as photo, description, section headings, and section-specific templates.
• Assets and Static Files: The “src/assets” and “public” folders hold images, fonts, and other media needed by both the web and PDF renderings.
• Build and Utility Scripts: Scripts like “scripts/generate-favicons.ts” and “scripts/generate-pdf.ts” support automation tasks (favicons generation and PDF generation) and are integral parts of the build process.
• Configuration and CI/CD: Files such as “astro.config.ts”, “tailwind.config.cjs”, and various GitHub workflows (in the “.github” directory) indicate CI/CD integration and build configurations.
Relationships and Data Flow
• Data Input: The user supplies resume content through TypeScript files located in “src/data”. This data is structured and transformed via helper functions and transformers.
• Data Flow to Presentation: Transformed data flows into two parallel presentation layers:
• The Web Frontend (in “src/web”), which renders the responsive online resume.
• The PDF Generation module (in “src/pdf”), which produces the offline, printable version.
• Assets Integration: Both rendering layers consume assets from “src/assets” and “public”, ensuring image optimization and branding consistency.
• Automation and Build Pipeline: Scripts in the “scripts” directory, along with the GitHub workflows, drive tasks like PDF generation, favicon creation, and overall build orchestration.
Architectural Patterns & Design Principles
• Separation of Concerns: There is a clear division between the data (content and configuration), the rendering logic for the web interface (src/web), and the PDF rendering (src/pdf).
• Reuse of Components: Many UI components are reused or adapted between the web and PDF views, adhering to DRY principles.
• Automation and CI/CD: The project uses GitHub workflows and custom scripts to automate repetitive tasks like PDF and favicon generation.