How bombies/personal-portfolio-3 works
Project Context
• This is a personal portfolio website, built as a monorepo.
• The project uses a modern stack including a Next.js–based frontend (in packages/frontend), serverless API functions (in packages/functions), and shared or core functionalities (in packages/core). There are also infrastructure definitions (in the infra folder and sst.config.ts) that indicate the use of SST (Serverless Stack) for cloud deployments.
• Additional scripts (in packages/scripts) are used for tasks such as synchronizing secrets and other automation.
Main Components
a. Frontend Application:
• Located in packages/frontend, it’s a Next.js application that handles the display of your portfolio pages (landing, about, contact, projects, etc.).
• It includes public assets (like PDFs, fonts, images) and is organized through a structured routing (using Next.js app directory, with defined landing, about, projects sections).
• Key UI components, hooks, and utilities are part of this layer.
b. Backend / API Functions:
• Located in packages/functions, these serverless functions (api.ts) provide backend logic.
• They are likely used to power dynamic interactions or API endpoints required by the frontend.
c. Core / Shared Code:
• Located in packages/core, this package may supply common functionalities or business logic that can be used across both the frontend and even the functions.
• It includes example code and tests to ensure reliability.
d. Infrastructure & Deployment:
• The infra directory along with files such as sst.config.ts and the presence of SST environment files (sst-env.d.ts) indicate that infrastructure as code is being used to provision cloud resources.
• This component shows how the project is deployed (e.g., serverless deployment, routing, secrets management, etc.).
e. Automation and Scripts:
• The packages/scripts folder contains scripts for tasks (e.g., syncing secrets) that automate parts of the development or deployment process.
f. CI/CD Pipelines:
• The .github/workflows files (build.yml, deploy.yml) indicate automated build and deploy processes that should be represented as part of the overall system flow.
Relationships & Data Flows
• The frontend (Next.js) interacts directly with the backend API functions through HTTP calls (likely via Next.js API routes or direct serverless endpoints).
• Shared code from the core package may be consumed by both the frontend and functions to guarantee consistency.
• The infrastructure layer (defined in infra) configures the cloud environment, provisioning necessary resources (e.g., API gateways, hosting services) and integrating secret management.
• CI/CD pipelines drive automated testing, building, and deployment; these could be depicted as external triggers that feed into the overall system.
Architectural Patterns and Design Principles
• A clear separation of concerns is maintained by splitting the project into distinct packages.
• The microservices/serverless pattern is evident in the separation of the frontend and API functionality.
• Infrastructure as code principles are demonstrated via SST and the infra folder, ensuring reproducible and automated deployments.