From 068976b33cabd653036a3f41e924652c2dcd2175 Mon Sep 17 00:00:00 2001 From: samuraikun Date: Tue, 23 Apr 2024 00:29:38 -0700 Subject: [PATCH] feat: Add team projects & fix styles. --- src/pages/projects.astro | 131 +++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/src/pages/projects.astro b/src/pages/projects.astro index 0730bb2..e326f61 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -3,39 +3,39 @@ import { match, P } from "ts-pattern"; import Card from "@components/Card.astro"; import BaseLayout from "@layouts/BaseLayout.astro"; -const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql' -const GITHUB_TOKEN = import.meta.env.GITHUB_TOKEN +const GITHUB_GRAPHQL_ENDPOINT = "https://api.github.com/graphql"; +const GITHUB_TOKEN = import.meta.env.GITHUB_TOKEN; type Repository = { - name: string, - description: string, - url: string, + name: string; + description: string; + url: string; primaryLanguage: { - name: string - }, + name: string; + }; repositoryTopics: { edges: Array<{ node: { topic: { - name: string - } - } - }> - } -} + name: string; + }; + }; + }>; + }; +}; type GraphQLResponse = { data?: { viewer: { pinnedItems: { edges: Array<{ - node: Repository - }> - } - } - }, - errors?: Array<{ message: string }> -} + node: Repository; + }>; + }; + }; + }; + errors?: Array<{ message: string }>; +}; async function fetchMyPinnedRepos(): Promise { const query = ` @@ -66,17 +66,17 @@ query { } } } - ` + `; const response = await fetch(GITHUB_GRAPHQL_ENDPOINT, { - method: 'POST', + method: "POST", headers: { - 'Content-Type': 'application/json', - 'Authorization': `bearer ${GITHUB_TOKEN}` + "Content-Type": "application/json", + Authorization: `bearer ${GITHUB_TOKEN}`, }, - body: JSON.stringify({ query }) - }) - const jsonResponse: GraphQLResponse = await response.json() + body: JSON.stringify({ query }), + }); + const jsonResponse: GraphQLResponse = await response.json(); // error handling by ts-pattern return match(jsonResponse) @@ -84,39 +84,66 @@ query { console.error(errors); return null; }) - .with({ data: { viewer: { pinnedItems: { edges: P.array() } } } }, ({ data }) => { - return data.viewer.pinnedItems.edges.map((edge: { node: Repository }) => edge.node) - }) + .with( + { data: { viewer: { pinnedItems: { edges: P.array() } } } }, + ({ data }) => { + return data.viewer.pinnedItems.edges.map( + (edge: { node: Repository }) => edge.node + ); + } + ) .otherwise(() => { - console.error('Unexpected response from GitHub GraphQL API'); + console.error("Unexpected response from GitHub GraphQL API"); return null; - }) + }); } -const pinnedRepos = await fetchMyPinnedRepos() +const pinnedRepos = await fetchMyPinnedRepos(); --- - -
-
Projects
+ +
+
Personal Projects
+
My pinned repositories on GitHub
+
+ { + pinnedRepos && + pinnedRepos.map((repo: Repository) => ( + + )) + } +
- -
- As a full-stack engineer, my portfolio reflects a balance of curiosity and deliberate technical exploration. -
I've developed projects with Vue and React, adhering to the Atomic Design principles. -
However, my deeper inclination, lies in backend development and setting up application infrastructures, especially with AWS and Terraform. - The Rails applications deployed on AWS ECS and my experiments with GraphQL in Ruby on Rails are testament to this. - These repositories, born out of personal interest, provide a snapshot of my capabilities and methodical approach to software engineering. +
Team Projects
+
+ Tabi-memo: A travel diary app +
+ URL: + + https://tabi-memo.vercel.app +
-
- {pinnedRepos && pinnedRepos.map((repo: Repository) => ( - - ))} + +