Skip to content

Commit d4cd552

Browse files
committed
update docs
1 parent 569b72f commit d4cd552

File tree

12 files changed

+402
-184
lines changed

12 files changed

+402
-184
lines changed

.github/copilot-instructions.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# AlexJSully Portfolio - AI Coding Agent Instructions
1+
# Alexander Sullivan's Portfolio - AI Coding Agent Instructions
22

33
## Architecture Overview
44

55
This is a **Next.js portfolio website** using the **App Router** (not Pages Router), React, TypeScript, and Material-UI with Emotion. The project follows a modular structure with path aliases, comprehensive testing, and Progressive Web App (PWA) capabilities.
66

77
### Key Technologies & Integrations
8+
89
- **Framework**: Next.js App Router with React Server Components
910
- **Styling**: Material-UI (MUI) + Emotion (use `sx` prop, not CSS modules)
1011
- **Testing**: Jest (unit tests), Cypress (E2E tests with accessibility via cypress-axe)
@@ -14,6 +15,7 @@ This is a **Next.js portfolio website** using the **App Router** (not Pages Rout
1415
## Critical Workflows
1516

1617
### Development Commands
18+
1719
```bash
1820
npm run dev # Start dev server at localhost:3000
1921
npm run validate # Full CI check: prettier → eslint → tsc → jest → cypress → build → markdown
@@ -25,6 +27,7 @@ npm run build # Production build
2527
**Always run `npm run validate` before committing.** This is the comprehensive quality gate used in CI/CD.
2628

2729
### Testing Requirements
30+
2831
- **Unit tests**: Every component requires a `.test.tsx` file (see `src/components/banner/Banner.test.tsx`)
2932
- **Test setup**: Uses `jest/setup.ts` with jsdom environment
3033
- **E2E tests**: Located in `cypress/e2e/`, include accessibility tests (cypress-axe)
@@ -33,17 +36,23 @@ npm run build # Production build
3336
## Project-Specific Conventions
3437

3538
### Path Aliases (Critical!)
39+
3640
Always use TypeScript path aliases defined in `tsconfig.json`:
41+
3742
```typescript
38-
import Avatar from '@components/banner/Avatar'; // NOT '../components/banner/Avatar'
39-
import { DELAYS } from '@constants/index'; // NOT '../../constants'
43+
import Avatar from '@components/banner/Avatar';
44+
// NOT '../components/banner/Avatar'
45+
import { DELAYS } from '@constants/index';
46+
// NOT '../../constants'
4047
import { isNetworkFast } from '@util/isNetworkFast';
4148
```
4249

4350
### Component Patterns
4451

4552
#### Material-UI Styling
53+
4654
Use `sx` prop for styling, never inline styles or CSS modules:
55+
4756
```typescript
4857
<Box
4958
component='div'
@@ -56,43 +65,52 @@ Use `sx` prop for styling, never inline styles or CSS modules:
5665
```
5766

5867
#### SVG Icons Pattern
68+
5969
SVGs are imported as React components via `@svgr/webpack`. See `src/images/icons.tsx`:
70+
6071
```typescript
6172
import Icon from './icons/example.svg';
6273
export const ExampleIcon = (props: SvgIconProps) =>
6374
<SvgIcon component={Icon} inheritViewBox {...props} />;
6475
```
6576

6677
### Data Management
78+
6779
Static data lives in `src/data/`:
80+
6881
- `projects.ts`: Project portfolio with typed interface
6982
- `publications.ts`: Academic publications
7083
- `socials.ts`: Social media links
7184
- `keywords.ts`: SEO keywords array
7285

7386
### Constants Pattern
87+
7488
Centralized constants in `src/constants/index.ts` with `as const` for type safety:
89+
7590
```typescript
76-
DELAYS.PROJECT_HOVER_VIDEO // 1000ms before video plays on hover
77-
THRESHOLDS.SNEEZE_TRIGGER_INTERVAL // Easter egg triggers
78-
NETWORK.SLOW_DOWNLINK_THRESHOLD // Network performance checks
91+
DELAYS.PROJECT_HOVER_VIDEO; // 1000ms before video plays on hover
92+
THRESHOLDS.SNEEZE_TRIGGER_INTERVAL; // Easter egg triggers
93+
NETWORK.SLOW_DOWNLINK_THRESHOLD; // Network performance checks
7994
```
8095

8196
## Code Style & Quality
8297

8398
### Linting & Formatting
99+
84100
- **Indentation**: Tabs (not spaces) - enforced by ESLint
85101
- **Line length**: No hard limit, use Prettier
86102
- **Import sorting**: Handled by `@trivago/prettier-plugin-sort-imports`
87103
- **Unused vars**: Prefix with `_` to ignore (e.g., `_unusedParam`)
88104

89105
### ESLint Rules (see `eslint.config.js`)
106+
90107
- Tabs for indentation (indent: ['error', 'tab'])
91108
- Console logs allowed (`no-console: off`)
92109
- Unused vars with `_` prefix ignored
93110
- React hooks exhaustive deps enforced
94111

95112
### TypeScript
113+
96114
- **Strict mode**: Enabled in `tsconfig.json`
97115
- **No implicit any**: All types must be explicit
98116
- **React 19**: Uses new `react-jsx` transform
@@ -101,7 +119,9 @@ NETWORK.SLOW_DOWNLINK_THRESHOLD // Network performance checks
101119
## Next.js App Router Specifics
102120

103121
### Metadata & SEO
122+
104123
All metadata configured in `src/app/layout.tsx`:
124+
105125
```typescript
106126
export const metadata: Metadata = {
107127
title: { template: `%s | ${metadataValues.title}`, default: metadataValues.title },
@@ -112,12 +132,15 @@ export const metadata: Metadata = {
112132
```
113133

114134
### Server Components vs Client Components
135+
115136
- Default: Server Components (no `'use client'`)
116137
- Client-only: Components with hooks, event handlers, browser APIs
117138
- Example client component: `src/components/ServiceWorkerRegister.tsx`
118139

119140
### Security Headers
141+
120142
CSP and security headers configured in `next.config.js` headers() function. Includes:
143+
121144
- X-Content-Type-Options: nosniff
122145
- X-Frame-Options: DENY
123146
- Strict-Transport-Security (HSTS)
@@ -126,31 +149,40 @@ CSP and security headers configured in `next.config.js` headers() function. Incl
126149
## Special Features
127150

128151
### Network Performance Optimization
152+
129153
`src/util/isNetworkFast.ts` checks Network Information API to conditionally load heavy assets based on connection speed.
130154

131155
### Easter Eggs
156+
132157
- `src/helpers/aaaahhhh.ts`: Fun image replacement logic triggered by avatar interactions
133158
- `src/helpers/ascii.ts`: Console ASCII art
134159

135160
### Service Worker
161+
136162
- Lives in `public/sw.js` and served via `src/app/sw.js/`
137163
- Registration in `src/components/ServiceWorkerRegister.tsx`
138164
- Used for PWA offline support
139165

140166
## Firebase & Analytics
167+
141168
Initialize Firebase only client-side (see `src/configs/firebase.ts`):
169+
142170
```typescript
143171
import { init, logAnalyticsEvent } from '@configs/firebase';
144-
init(); // Call once on client mount
172+
173+
init(); // Call once on client mount
145174
logAnalyticsEvent('event_name', { params });
146175
```
147176

148177
## Documentation
178+
149179
Architecture docs in `docs/architecture/`:
180+
150181
- `index.md`: System overview
151182
- Component-specific docs for Avatar, Projects, Publications, etc.
152183

153184
## Common Gotchas
185+
154186
1. **Don't** import from relative paths - use path aliases
155187
2. **Don't** forget to update tests when changing components
156188
3. **Always** run `npm run validate` frequently when making changes

.github/prompts/audit-docs.prompt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Documentation produced by this prompt must serve **two audiences simultaneously*
1818

1919
1. **Internal developers / maintainers**
2020
- To understand system internals, architectural decisions, constraints, and design intent
21-
- To preserve *why* things were implemented the way they are and the *how* behind the *what*
21+
- To preserve _why_ things were implemented the way they are and the _how_ behind the _what_
2222
2. **New or external developers**
2323
- To understand how to use the system, APIs, and modules as tools
2424
- To quickly navigate from documentation to implementation
@@ -64,12 +64,12 @@ Do **not** skip ahead.
6464
When documenting behavior, architecture, or usage:
6565

6666
1. **Start with a succinct natural-language explanation**
67-
- Explain *what the component does*, *why it exists*, and *how it fits into the system*
67+
- Explain _what the component does_, _why it exists_, and _how it fits into the system_
6868
2. **Link directly to the implementation**
6969
- Prefer links to real source files over inline code
7070
- Example:
71-
> The request validation logic is centralized in `validateRequest`, which enforces schema constraints before execution.
72-
> See implementation: [`src/api/validateRequest.ts`](src/api/validateRequest.ts)
71+
> The request validation logic is centralized in `validateRequest`, which enforces schema constraints before execution.
72+
> See implementation in the corresponding source file (for example under `src/components/` or `src/util/`), and always link to a real file that exists in this repository.
7373
3. **Use inline code blocks sparingly and intentionally**
7474
- Include code snippets **only when they materially improve understanding**, such as:
7575
- Public API usage examples

docs/architecture/app-directory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# App Directory (Next.js)
22

3-
This document explains the Next.js App Router directory structure and implementation in the AlexJSully Portfolio project.
3+
This document explains the Next.js App Router directory structure and implementation in the Alexander Sullivan's Portfolio project.
44

55
## Overview
66

docs/architecture/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Components Documentation
22

3-
This document describes the internal architecture, relationships, and usage of major UI components in the AlexJSully Portfolio project. Components are modular, reusable, and styled with Material-UI and Emotion.
3+
This document describes the internal architecture, relationships, and usage of major UI components in the Alexander Sullivan's Portfolio project. Components are modular, reusable, and styled with Material-UI and Emotion.
44

55
## Component List & Hierarchy
66

0 commit comments

Comments
 (0)