Created My Portfolio
Tags: typescript, portfolio
Published: 2024-07-03 18:36:38

# Created My Portfolio

I recently built a system to automate the process of updating my portfolio and resume. This approach eliminates the need for frequent manual updates, ensuring that my online presence always reflects my latest accomplishments and skills.

## Portfolio

* [Portfolio](https://portfolio-9ym.pages.dev/)
* [REST API](https://rest-api.honwakapappa-honwakapappa.workers.dev/docs)
* [GraphQL](https://graphql.honwakapappa-honwakapappa.workers.dev/graphql)

## Background

Initially, I set out to create a traditional portfolio website.  However,  during the planning stage, I realized that the core information for both a portfolio and a resume is essentially the same: showcasing my skills and experience.  With this realization, I decided to explore a more integrated approach.  This resulted in a system that automatically updates both my portfolio and resume whenever I update my resume content.

## Structure

The diagram of this system's overview is the following:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pgh5ktbax8z6slweylc.png)


My portfolio system leverages [server-side rendering (SSR) within the Astro framework](https://docs.astro.build/en/guides/server-side-rendering/) to ensure users always access the latest information. Here's how it works:

1. User Accesses Portfolio: When a user visits my portfolio website, the server hosting the portfolio initiates a call to my information API ([details explained later](#information-management-module)).
2. API Data Extraction: The information API returns my most recent data.
3. Server-Side Rendering: Astro utilizes SSR to render the portfolio on the server, incorporating the fetched data from the API.
4. Fresh Content Delivered: The server then delivers the fully rendered HTML content, including the latest information, to the user's browser.

## Modular System Design

My portfolio system is comprised of two well-defined modules, each housed in its own dedicated GitHub repository with integrated deployment via GitHub Actions to [Cloudflare Pages](https://pages.cloudflare.com/) or [Cloudflare Workers](https://developers.cloudflare.com/workers/).

### Modules

#### Portfolio Frontend

This Astro-based module is solely responsible for the visual presentation of the portfolio. It retrieves and displays information from the information management module but doesn't store any user data itself.

#### Information Management Module

This comprehensive module manages all user information and related functionalities. It consists of four distinct components:

##### Information Storage

This component leverages TypeScript to define the structure and types for user data in JSON format. This file acts as a schema, ensuring data consistency and enabling type safety within the system. The user information itself is stored directly within this TypeScript file, utilizing the defined JSON structure.

##### Resume Generation

This component leverages [Astro](https://astro.build/) to dynamically generate a resume in HTML format based on the user's information. A subsequent automated process within GitHub Actions converts the HTML to PDF and ensures its deployment to both GitHub artifacts and Cloudflare.

##### REST API

This component, built with [Hono](https://hono.dev/?kawaii=true) and [Swagger UI middleware](https://hono.dev/examples/swagger-ui), provides a RESTful interface for accessing and potentially manipulating user information.

##### GraphQL API

This component, built with [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server), offers a GraphQL interface for interacting with user data.

## Summary

By providing my latest information as API, it allows users to create my portfolio as they like. So you can create a cool portfolio for me. I cannot wait to see my nice and cool portfolio site that will be created by YOU!😜