Skip to content

Commit d98c50a

Browse files
kiyarosecursoragentCopilotCopilot
authored
Migrate portfolio architecture to Astro SSG core (#253)
* Migrate portfolio to Astro static host Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech> * Stabilize remote data sync and test flows Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech> * Add GitHub Pages PR preview workflow Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/347cdca7-8283-4c28-ad63-8d83605460cb Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com> * Refine GH Pages preview build step Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/347cdca7-8283-4c28-ad63-8d83605460cb Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Address PR #253 review comments and adjust preview workflow Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/e0e67947-5d7c-4bdd-9aba-1aa674165a7b Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com> * Polish copy and simplify base-path joins after validation feedback Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/e0e67947-5d7c-4bdd-9aba-1aa674165a7b Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com> * Fixed a circus of issues Issues lead to weird caching of the remote URL, and not respecting prefs * Fix merge by restoring vitest dev dependency Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c60f038 commit d98c50a

69 files changed

Lines changed: 12862 additions & 6981 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@
33

44
# Pageclip API key for contact form
55
# Get your API key from https://pageclip.co/
6-
VITE_PAGECLIP_API_KEY=your_pageclip_api_key_here
6+
VITE_PAGECLIP_API_KEY=your_pageclip_api_key_here
7+
8+
# Optional: remote JSON base (production builds). Example:
9+
# VITE_REMOTE_DATA_URL=https://data.example.com/data
10+
#
11+
# Optional: bypass localStorage cache for remote JSON (useful for testing).
12+
# Set to "true" to always refetch.
13+
# VITE_REMOTE_DATA_BYPASS_CACHE=true

.github/ISSUE_TEMPLATE/content_update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
attributes:
2323
label: "Affected pages or sections"
2424
description: "List routes, components, or assets that need updates."
25-
placeholder: "Home hero copy, About bio, public/index.html gradient."
25+
placeholder: "Home hero copy, About bio, public/fallback/index.html gradient."
2626
validations:
2727
required: true
2828
- type: textarea

.github/copilot-instructions.md

Lines changed: 30 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,42 @@
1-
# Copilot / AI agent instructions (project-specific)
1+
# Copilot / AI instructions
22

3-
This file contains focused, actionable rules for automated coding agents working in the KR_Portf repository. Keep guidance short and specific — prefer small, safe edits and follow the project's conventions.
3+
## Architecture
44

5-
## Quick architecture & big picture
6-
- Vite + React + TypeScript front-end served via Firebase Hosting. Entry points: `src/main.tsx``src/App.tsx``src/AppRouter.tsx`.
7-
- UI components: `src/components/`; page sections: `src/sections/`; content/data: `src/data/` (e.g., `build.ts`, `projects.ts`).
8-
- Theme and context providers: `src/providers/ThemeProvider.tsx`, `src/providers/theme-context.ts` and hook `src/hooks/useTheme.ts`.
9-
- Tests and visual checks: Playwright + Vitest under `tests/` and `playwright.config.ts`.
5+
- Astro + React + TypeScript portfolio template.
6+
- Astro routes live in `src/pages/` (`index.astro`, `privacy-policy.astro`).
7+
- Main UI and section composition remain in React (`src/App.tsx`, `src/sections/*`).
8+
- Local content lives in `src/data/*` and translations in `src/translations/*`.
109

11-
## Project-specific conventions (follow these)
12-
- Compose Tailwind utility classes directly in JSX. Use PascalCase for components and camelCase for hooks.
13-
- Visual style: rounded Material-like cards (`rounded-3xl`, `shadow-card`), warm orange/pink accents (`#f97316`, `#ec4899`), and `.font-kiya` for the printed name "Kiya Rose" (font located in `public/fonts`).
14-
- Respect `prefers-reduced-motion`. Framer Motion is used; prefer short fade/slide transitions and provide reduced-motion fallbacks.
15-
- Footer/legal: use `getBuildUpdatedAt()` from `src/data/build.ts` for the "Last updated" date — do not hard-code timestamps.
16-
- Contact form: client-only `mailto:` generation plus copy-to-clipboard CTA (see `src/sections/ContactSection.tsx`).
10+
## Core conventions
1711

18-
## Environment & secrets
19-
- Environment variables use the `VITE_` prefix. Critical: `VITE_TURNSTYLE_SITE` is intentionally misspelled (no second "t"); do not rename it.
20-
- Never commit secrets. Use `.env.local` locally and GitHub Secrets in CI.
12+
- Keep the current visual layout and section order unless explicitly asked to redesign.
13+
- Prefer small, focused edits; preserve accessibility and reduced-motion behavior.
14+
- Use Tailwind utility classes in JSX and keep Material-like rounded card styling.
15+
- Use `.font-kiya` for the display-name accent style.
2116

22-
## Common developer workflows & commands
23-
- Install deps: `npm ci` or `npm install`.
24-
- Dev server: `npm run dev` (Vite, http://localhost:5173).
25-
- Lint: `npm run lint` (run before PR).
26-
- Build: `npm run build``dist/` for Firebase Hosting.
27-
- Local hosting preview: `firebase emulators:start --only hosting` (project has `firebase.json`).
28-
- Run tests: `npm run test` (Playwright tests and other test runners configured in package.json).
17+
## Remote data contract
2918

30-
## Places to inspect for examples and patterns
31-
- Routing & layout: `src/App.tsx`, `src/AppRouter.tsx`.
32-
- Footer/build label: `src/components/SiteFooter.tsx`, `src/data/build.ts` (localStorage prefix behavior).
33-
- Contact flow: `src/sections/ContactSection.tsx` (mailto + clipboard behaviour).
34-
- Theme logic: `src/providers/ThemeProvider.tsx`, `src/hooks/useTheme.ts`.
35-
- Page-level sections: `src/sections/*` — follow their existing patterns for spacing, animation, and accessibility.
19+
- `VITE_REMOTE_DATA_URL` enables remote JSON fetches.
20+
- If no remote URL is set, use local fallback data only.
21+
- On remote fetch failure, show placeholder data (do not silently swap to local fallback).
22+
- Keep this behavior centered in `src/hooks/useRemoteData.ts`.
3623

37-
## Editing guidance for AI agents
38-
- Make smallest useful change. Prefer a focused PR per issue.
39-
- Preserve existing UX and data flows. If you change `src/data/build.ts` or footer code, preserve the localStorage build-label behavior unless explicitly fixing it.
40-
- Avoid global CSS: adhere to Tailwind utility usage in JSX.
41-
- When adding routes: update `src/AppRouter.tsx` and use `src/utils/navigation.ts` helpers.
24+
## Build and test commands
4225

43-
## Tests & quality gates
44-
- Before proposing changes: run `npm run lint` and `npm run build` locally.
45-
- Test files live under `tests/` (e.g. `a11y.spec.ts`, `screenshot.spec.ts`); Playwright is used for integration/visual checks.
26+
- Install: `npm ci`
27+
- Dev: `npm run dev`
28+
- Lint/type check: `npm run lint`
29+
- Unit tests: `npm run test`
30+
- E2E tests: `npm run test:e2e`
31+
- Build: `npm run build`
4632

47-
## Native companion tool
48-
- `$DashCam!/` holds a macOS Swift helper app used by developers to manage dev and playwright codegen tasks. If you modify related scripts, update the DashCam Swift sources under `$DashCam!/Sources/DashboardApp`.
33+
## Deploy targets
4934

50-
## PR checklist for automated changes
51-
- Lint passes (`npm run lint`).
52-
- Build succeeds (`npm run build`).
53-
- No secrets committed.
54-
- Follow naming and Tailwind conventions.
35+
- Cloudflare Pages: output `dist/`, config in `wrangler.toml`, headers in `public/_headers`.
36+
- GitHub Pages: use `npm run build:pages` with `BASE_PATH=/your-repo-name/`.
5537

56-
If any section is unclear or you want more repo file examples, say which area to expand and I will iterate.
57-
# Copilot Instructions
38+
## Security
5839

59-
## Style & Architecture
60-
61-
- Keep the interface sleek and minimal with rounded Material-style cards, soft shadows, and translucent layers when depth is needed.
62-
- Accent colors lean warm orange/pink (`#f97316` / `#ec4899`) in light mode while dark mode stays slate—mirror those tones in new UI or gradients.
63-
- Use rounded Material Symbols for navigation, section headers, and social chips so iconography stays cohesive.
64-
- Compose Tailwind utility classes directly in JSX; components follow PascalCase, hooks use camelCase, and class names remain lowercase-kebab.
65-
- Respect `prefers-reduced-motion`, keeping Framer Motion animations subtle (short fade/slide transitions) and providing fallbacks for reduced motion preferences.
66-
- Maintain the light/dark theme toggle with animated sun/moon icons and ensure contrast targets accessibility best practices.
67-
- Apply the `.font-kiya` (Patrick Hand) accent whenever “Kiya Rose” appears in UI copy.
68-
- Keep the footer’s legal line consistent: dynamic current year, typographic © symbol, `.font-kiya` "Kiya Rose", and the “Crafted with React, Tailwind CSS, and Firebase.” tag.
69-
- Privacy and legal copy should source their “Last updated” value from `getBuildUpdatedAt()` in `src/data/build.ts` so the date reflects the current build—no hard-coded timestamps.
70-
- Everything should be in Canadian English or French English when possible, when there are conflicting versions of a singular term use the more specific one. (For example cheque instead of check)
71-
72-
## Environment Variables
73-
74-
- Secrets use the `VITE_` prefix; note that `VITE_TURNSTYLE_SITE` (missing the second "t") is intentional and should not be renamed to `VITE_TURNSTILE_SITE`.
75-
76-
## Quality Expectations
77-
78-
- Prefer fixes that resolve lint warnings, TypeScript errors, and obvious UX problems rather than adding placeholders.
79-
- When you touch code, scan the surrounding logic for latent bugs or smells and address them when feasible.
80-
- Align fixes with the guidance used by DeepSource, CodeFactor, and SonarQube: eliminate dead code, handle edge cases, simplify complex conditionals, and tighten null/undefined guards.
81-
- Preserve Firebase secrets by loading them from environment configuration—never commit credentials or hard-coded API keys.
82-
- Ensure licensing references match the BSD 3-Clause notice in the project root `LICENSE` (copyright © 2025, Kiya Rose).
83-
- Honor existing lint rules (avoid inline arrow handlers in JSX, limit nesting by extracting helpers, etc.).
84-
85-
## Collaboration Notes
86-
87-
- Favor small, composable helper components over deeply nested JSX trees (see `SiteHeader`/`SiteFooter` in `App.tsx`).
88-
- When making UI changes, consider drag-and-drop persistence, localStorage access, the `mailto:` contact workflow, and other side effects already established in the repo.
89-
- Use the existing `isDeveloping` styling in the Skills section when introducing new abilities (dashed border for in-progress skills).
90-
- Keep the fallback page (`public/index.html`) visually aligned with the main palette when adjusting colors.
91-
- Run `npm run lint` and (when relevant) `npm run build`; clean up generated `dist/` outputs if you run the build locally.
92-
- Keep the build label helper in `src/data/build.ts` intact: it persists a random prefix per build signature in `localStorage`, so only adjust it if that behaviour breaks, and retain the accent tooltip that explains the two segments.
93-
- Keep the macOS Swift companion `DashCam!` in `$DashCam!/`: it manages `npm run dev` and `npx playwright codegen` processes, so update `DashboardViewModel`/`ProcessController` plus the packaged `DashCam.app` or `dashcam_swift.tgz` whenever those workflows change.
94-
- Route-level additions should flow through `src/AppRouter.tsx` with helpers from `src/utils/navigation.ts`; render privacy/legal pages inside React rather than shipping standalone static HTML.
95-
- When you adjust repository guidance, update both `AGENTS.md` and this file so instructions stay in sync.
96-
## Security & ZAP Scanning
97-
98-
- All security headers are centrally configured in `security-headers.config.ts` and deployed via `public/_headers` (Cloudflare Pages), `firebase.json` (Firebase Hosting), and `vite.config.ts` (local preview).
99-
- The ZAP workflow scans `https://your.website` nightly; check `.zap-ignore` for known/accepted alerts.
100-
- When ZAP reports issues, verify headers are in `public/_headers` and deployed properly before adding to `.zap-ignore`.
101-
- Use `safeConsoleWarn()` and `safeConsoleError()` from `src/utils/errorSanitizer.ts` instead of raw console methods to prevent information disclosure.
40+
- Keep security headers centralized in `security-headers.config.ts`.
41+
- Keep parity checks working via `npm run verify:security-headers`.
42+
- Use safe logging helpers in `src/utils/errorSanitizer.ts`.

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This directory contains automated workflows for the portfolio project. Workflows
4343
- **`security-headers-parity.yml`** - Security Headers Verification
4444
- Verifies security headers are synchronized across:
4545
- `security-headers.config.ts`
46-
- `vite.config.ts`
46+
- `astro.config.mjs`
4747
- `public/_headers`
4848
- `firebase.json`
4949

.github/workflows/codeql.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ jobs:
3636
- 'package-lock.json'
3737
- 'yarn.lock'
3838
- 'pnpm-lock.yaml'
39-
- 'vite.config.ts'
39+
- 'astro.config.mjs'
4040
- 'eslint.config.js'
4141
- 'tailwind.config.js'
4242
- 'postcss.config.js'
4343
- 'tsconfig.json'
44-
- 'tsconfig.app.json'
45-
- 'tsconfig.node.json'
4644
- 'src/**'
4745
- 'public/**'
4846
- 'tests/**'
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy PR Preview to GitHub Pages
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
pull-requests: write
14+
15+
concurrency:
16+
group: pages-preview-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm clean-install --progress=false
35+
36+
- name: Build
37+
env:
38+
BASE_PATH: /${{ github.event.repository.name }}/
39+
run: npm run build:pages
40+
41+
- name: Upload Pages artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: dist
45+
46+
deploy:
47+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages preview
55+
id: deployment
56+
uses: actions/deploy-pages@v4
57+
with:
58+
preview: true

.github/workflows/github-pages.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ name: Deploy to GitHub Pages
1010
# If you are using this as a template for your own project you will need to
1111
# update TWO values so that assets load from the correct path:
1212
#
13-
# 1. VITE_BASE_URL (in the Build step below)
13+
# 1. BASE_PATH (in the Build step below)
1414
# Set this to "/<your-repo-name>/" — include both slashes.
1515
# Example: if your repo is "github.com/jane/my-portfolio", use "/my-portfolio/".
1616
# If you are deploying to a root domain (e.g. https://jane.github.io) or a
17-
# custom domain pointed at the repo root, set VITE_BASE_URL to "/" or
17+
# custom domain pointed at the repo root, set BASE_PATH to "/" or
1818
# remove the env block entirely.
1919
#
20-
# 2. The "base" value in vite.config.ts
21-
# Normally this is driven automatically by VITE_BASE_URL above, so you
20+
# 2. The "base" value in astro.config.mjs
21+
# Normally this is driven automatically by BASE_PATH above, so you
2222
# only need to change it if you want to hard-code the path instead of
2323
# using the environment variable.
2424
#
25-
# The router (src/utils/navigation.ts) reads import.meta.env.BASE_URL at
25+
# The navigation helper (src/utils/navigation.ts) reads import.meta.env.BASE_URL at
2626
# runtime and strips the prefix automatically — no other files need changing.
2727
# ---------------------------------------------------------------------------
2828

@@ -60,7 +60,7 @@ jobs:
6060
# TEMPLATE USERS: change /Portf/ below to /<your-repo-name>/ — or
6161
# remove the env block entirely when deploying to a root domain.
6262
env:
63-
VITE_BASE_URL: /Portf/
63+
BASE_PATH: /Portf/
6464
run: npm run build:pages
6565

6666
- name: Upload Pages artifact

.github/workflows/pr-screenshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
- name: Run Playwright tests (screenshots & accessibility)
7373
run: |
74-
npx playwright test tests/e2e.spec.ts tests/a11y.spec.ts
74+
npx playwright test tests/screenshot.spec.ts tests/a11y.spec.ts tests/theme-consistency.spec.ts
7575
7676
- name: Upload artifacts
7777
uses: actions/upload-artifact@v4

.github/workflows/security-headers-parity.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'security-headers.config.ts'
77
- 'public/_headers'
88
- 'firebase.json'
9-
- 'vite.config.ts'
9+
- 'astro.config.mjs'
1010
- '.github/workflows/security-headers-parity.yml'
1111
push:
1212
branches:
@@ -15,7 +15,7 @@ on:
1515
- 'security-headers.config.ts'
1616
- 'public/_headers'
1717
- 'firebase.json'
18-
- 'vite.config.ts'
18+
- 'astro.config.mjs'
1919

2020
permissions:
2121
contents: read
@@ -49,7 +49,7 @@ jobs:
4949
'The security headers are not synchronized across configuration files.\n\n' +
5050
'Please ensure that:\n' +
5151
'1. `security-headers.config.ts` contains the master configuration\n' +
52-
'2. `vite.config.ts` imports from the master config\n' +
52+
'2. `security-headers.config.ts` includes all required header keys\n' +
5353
'3. `public/_headers` and `firebase.json` are updated to match\n\n' +
5454
'See the workflow logs for details.'
5555
})

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ coverage
2626
node_modules/
2727
dist/
2828
dist-ssr/
29+
.astro/
30+
public/__remote-data/
2931

3032
# Tooling caches
3133
.npm

0 commit comments

Comments
 (0)