You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/prompts/audit-quality.prompt.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,16 +166,22 @@ Act as a **Principal Code Reviewer, Security Auditor, and Refactoring Architect*
166
166
167
167
**Objective:** Ensure compliance with applicable data protection and privacy regulations.
168
168
169
+
Not all regulations apply to every codebase. Determine which regulations are in scope based on the system's data subjects, geography, data types, and regulated activities. Only perform compliance checks for regulations that apply, and explicitly state why any listed regulation is out of scope.
170
+
169
171
Check compliance with:
170
172
171
173
-**United States:** HIPAA (Health Insurance Portability and Accountability Act)
174
+
- Applies when the system handles protected health information (PHI) for a covered entity or business associate.
172
175
-**European Union & Ireland:** GDPR (General Data Protection Regulation)
176
+
- Applies when the system processes personal data, especially if it profiles users, tracks behavior, or makes decisions that affect individuals.
173
177
-**Canada (Federal):** PIPEDA (Personal Information Protection and Electronic Documents Act)
178
+
- Applies when the system processes personal information for commercial activities in the private sector.
174
179
-**Canada - Ontario (Provincial):** PHIPA (Personal Health Information Protection Act)
180
+
- Applies when the system handles personal health information for a health information custodian or their agent.
175
181
-**South Korea:** PIPA (Personal Information Protection Act)
176
-
-**Vietnam:** PDPL (Personal Data Protection Law)
182
+
- Applies when the system processes personal information, including identifiers, contact data, or behavioral data.
177
183
178
-
Verify:
184
+
For each applicable regulation, verify:
179
185
180
186
- Right to access, rectification, erasure, and data portability
This document explains the Next.js App Router directory structure and implementation in the Alexander Sullivan's Portfolio project.
4
-
5
-
## Overview
6
-
7
-
The project uses Next.js 16+ with the App Router architecture located in [`src/app/`](../../src/app/). This modern routing system uses file-system based routing with server and client components.
8
-
9
-
## Directory Structure
10
-
11
-
```text
12
-
src/app/
13
-
├── layout.tsx # Root layout with metadata
14
-
├── page.tsx # Home page component
15
-
├── manifest.ts # PWA manifest configuration
16
-
├── robots.ts # SEO robots.txt generator
17
-
├── error.tsx # Error boundary
18
-
├── global-error.tsx # Global error boundary
19
-
├── loading.tsx # Loading UI
20
-
├── not-found.tsx # 404 page
21
-
├── favicon.ico # Site favicon
22
-
└── sw.js/ # Service worker route handler
23
-
```
3
+
The portfolio uses Next.js App Router, where file names in [src/app/](../../src/app/) define routes and special behaviors. This follows Next.js convention-based routing rather than explicit route configuration.
4
+
5
+
## App Router Conventions
6
+
7
+
**File-Based Routing:** Next.js maps file names to functionality:
8
+
9
+
-`layout.tsx` — Wraps all child routes with shared UI and metadata
10
+
-`page.tsx` — Defines the `/` route content
11
+
-`error.tsx` — Catches errors in route segments
12
+
-`global-error.tsx` — Catches errors in root layout
**Server by Default:** Components in [src/app/](../../src/app/) are React Server Components unless marked with `'use client'`. This minimizes client JavaScript.
**Metadata Configuration:** The layout exports a metadata object with SEO tags, OpenGraph, Twitter Cards, and PWA manifest path. Keywords are imported from [src/data/keywords.ts](../../src/data/keywords.ts).
174
41
175
-
### Robots (`robots.ts`)
42
+
**Viewport Setup:** Defines theme color (#131518), responsive scaling, and device width settings for mobile browsers.
176
43
177
-
Generates robots.txt for SEO:
44
+
**GeneralLayout:** Wraps children with [GeneralLayout](../../src/layouts/GeneralLayout.tsx) which provides navigation, footer, stars background, and cookie consent.
178
45
179
-
```typescript
180
-
importtype { MetadataRoute } from'next';
46
+
**Global Styles:** Imports [globals.scss](../../src/styles/globals.scss) for application-wide CSS.
**Robots.txt** ([src/app/robots.ts](../../src/app/robots.ts)) — Generates `/robots.txt` allowing all crawlers with sitemap URL for SEO.
266
71
267
-
Custom 404 page with navigation back to home:
72
+
## Error Handling
268
73
269
-
```typescript
270
-
exportdefaultfunction NotFound() {
271
-
const pathname =usePathname();
74
+
**Error Boundary** ([src/app/error.tsx](../../src/app/error.tsx)) — Catches errors in route segments and displays fallback UI with reset button.
272
75
273
-
return (
274
-
<Stack/* ... */>
275
-
<Typography>404</Typography>
276
-
<Typography>{pathname}?!Whatisthat?!</Typography>
277
-
<Linkhref='/'aria-label='Go home'>
278
-
<Button>Gobackhome!</Button>
279
-
</Link>
280
-
</Stack>
281
-
);
282
-
}
283
-
```
76
+
**Global Error** ([src/app/global-error.tsx](../../src/app/global-error.tsx)) — Catches errors in root layout, including its own `<html>` and `<body>` tags since layout errors prevent normal rendering.
284
77
285
-
## Best Practices
78
+
Both error boundaries are client components that accept `error` and `reset` props.
286
79
287
-
1. **Server vs Client Components:** Use server components by default, mark client components with `'use client'`
288
-
2. **Metadata:** Define metadata in layout.tsx for SEO benefits
289
-
3. **Error Boundaries:** Implement error.tsx for graceful error handling
290
-
4. **Loading States:** Use loading.tsx for better UX during navigation
291
-
5. **TypeScript:** Use Next.js types like `MetadataRoute`, `Metadata`, and `Viewport`
292
-
6. **Accessibility:** Include proper ARIA labels on all components
80
+
## Loading & 404
293
81
294
-
## Testing
82
+
**Loading UI** ([src/app/loading.tsx](../../src/app/loading.tsx)) — Shows MUI CircularProgress spinner centered on screen while routes load.
295
83
296
-
Test files are located alongside their components:
84
+
**Not Found** ([src/app/not-found.tsx](../../src/app/not-found.tsx)) — Custom 404 page displaying pathname and navigation button back to home.
💡 **Tip:** The App Router automatically handles routing based on the file structure. Any `page.tsx` file becomes a route, and `layout.tsx` files wrap their children routes.
90
+
-[Architecture Overview](./index.md) — System architecture
0 commit comments