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
Version: 0.1.0 (MVP) Β |Β Status: Active Development Β |Β License: Private
A full-stack TypeScript/Next.js web application that serves as both an interactive personal portfolio and an educational design pattern playground. The system demonstrates all 23 Gang of Four (GoF) design patterns implemented within a production-grade architecture, targeting CS students, recruiters, and software engineering educators.
Traditional developer portfolios are static, single-purpose pages that fail to demonstrate depth of software engineering knowledge. Simultaneously, CS curricula often teach design patterns in isolation β without grounding them in real, working systems. This project resolves both problems by merging portfolio functionality with a living, interactive pattern showcase.
1.2 Project Objectives
Objective
Description
Portfolio Showcase
Present projects, blog posts, resume, articles, and podcast content in a unified, dynamic interface
Pattern Playground
Implement all 23 GoF design patterns as first-class, observable features of the running application
Educational Reference
Provide a production-grade codebase that CS students and educators can study and extend
Future AI Integration
Architect the system to support LLM-powered content generation and intelligent assistants
1.3 Technology Stack Rationale
Layer
Technology
Rationale
Frontend Framework
Next.js 16 + React 19
App Router support, SSR/CSR flexibility, API routes co-location
Language
TypeScript 5.9 (strict)
Type safety essential for pattern demonstrations; generics power Strategy/Iterator/Composite
AudioPlayerContext with StoppedState, PlayingState, PausedState
app/models/podcast/
Template Method
Content export algorithm with pluggable format steps
src/patterns/
Mediator
ContactFormMediator β orchestrates form validation and submission
app/services/contact/
Memento
FeedStateMemento + FeedStateCaretaker β snapshot/restore filter state
app/models/feed/
Interpreter
Grammar evaluator for expression parsing
src/patterns/
Visitor
MetricsVisitor, TagsVisitor β analytics traversal of content trees
app/components/dashboard/
3.3 Data Model
erDiagram
USER {
string id PK "cuid"
string email UK
string name
string image
string role
string provider
string providerAccountId
datetime createdAt
datetime updatedAt
}
POST {
string id PK "cuid"
string title
string content
boolean published
string authorId FK
datetime createdAt
datetime updatedAt
}
USER ||--o{ POST : "authors"
React Context API is used for global state (theme, language, admin role) rather than a third-party store β keeping the pattern surface visible without framework magic.
Singleton services are instantiated once at module load, ensuring pattern correctness is observable at runtime.
Bun is the canonical package manager and script runner for dependency installation, seeding, integration tests, image builds, and container runtime commands. Node.js remains the Docker base image for Next.js compatibility.
Static mock data (app/data/) drives the portfolio sections in the MVP; the REST API layer is designed to replace this data source as database models are added.
5. Testing
5.1 Current Coverage
Layer
Framework
Status
Pattern Unit Tests
Bun (bun:test)
β 140+ test cases across all 23 patterns
Integration β Auth + DB
Bun script (scripts/integration-auth-db.ts)
β Available locally; not run by the current deployment workflow
Integration β HTTP CRUD
Bun script (scripts/integration-http-crud.ts)
β Available locally; not run by the current deployment workflow
Integration β Admin Users
Bun script (scripts/integration-http-admin-users.ts)
β Available locally; not run by the current deployment workflow
Unit Tests β React Components
Jest / React Testing Library
π² To be defined
E2E Tests
Playwright
π² To be defined
5.2 Running Pattern Tests
# Creational patterns
bun test src/patterns/TESTS.ts
# Structural patterns
bun test src/patterns/STRUCTURAL_TESTS.ts
# Behavioral patterns
bun test src/patterns/BEHAVIORAL_TESTS.ts
# All patterns
bun test src/patterns/
5.3 Running Integration Tests
# Prerequisites: database running and migrations applied
bun run db:up
bunx prisma migrate deploy
# Auth + database
bun run integration:auth-db
# HTTP CRUD endpoints
bun run integration:http-crud
# Admin user management
bun run integration:http-admin-users
Target coverage: 80% for critical paths, 60% overall.
6. Deployment
6.1 Prerequisites
Node.js 20.19+ (the Docker image uses node:20.19-alpine)
Docker & Docker Compose
Bun (canonical package manager and script runner)
Google Cloud SDK (optional, for manual GCP tooling)
6.2 Local Development
# 1. Clone the repository
git clone <repository-url>cd personal-profile-prototype
# 2. Install dependencies
bun install
# 3. Configure environment
cp .env.example .env
# 4. Start PostgreSQL
bun run db:up # docker compose up -d# 5. Apply database migrations
bunx prisma migrate dev
# 6. Seed the database
bun run prisma:seed
# 7. Start development server
bun run dev # Webpack dev server β http://localhost:3000# or: bun run dev:turbo # Turbopack (faster, experimental)
6.3 Required Environment Variables
The Compose files use different variable names for local development and production deployment. Configure the appropriate environment file for the selected runtime and do not commit secret values.
# Local docker-compose.ymlDATABASE_URL=postgresql://user:password@localhost:5432/personal_profile_prototypeNEXTAUTH_URL=http://localhost:3000NEXTAUTH_SECRET=<random-256-bit-secret>GITHUB_ID=<optional-github-client-id>GITHUB_SECRET=<optional-github-client-secret>GOOGLE_ID=<optional-google-client-id>GOOGLE_SECRET=<optional-google-client-secret>NODE_ENV=developmentNEXT_PUBLIC_API_URL=http://localhost:3000
docker-compose.prod.yml uses DATABASE_URL, NODE_ENV, and NEXT_PUBLIC_API_URL, and also expects production values for AUTH_SECRET, AUTH_URL, AUTH_TRUST_HOST, AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET, ADMIN_TEST_EMAIL, ADMIN_TEST_PASSWORD, VIEWER_TEST_PASSWORD, OWNER_EMAIL, and SERVER_NODE.
6.4 Docker Production Build
# Build image
docker build -t personal-profile:0.1.0 .# Run with production env
docker run -p 3000:3000 --env-file .env.production personal-profile:0.1.0
# Or use production compose
docker compose -f docker-compose.prod.yml up -d
The Dockerfile uses a multi-stage build:
Stage 1 (builder):node:20.19-alpine β bootstraps Bun, installs dependencies from bun.lock, generates the Prisma client, and builds Next.js
Stage 2 (runner):node:20.19-alpine β bootstraps Bun, copies the built application assets, runs as the non-root node user, and starts the app with bun run start
docker-compose.prod.yml pulls ghcr.io/taichi112/personal-profile-app:latest and runs the app alongside Nginx and Certbot.
6.5 CI/CD Pipeline
flowchart TD
A(["Push to main"]) --> B["deploy.yml: check out repository"]
B --> C["Log in to GitHub Container Registry"]
C --> D["Build Docker image from Dockerfile"]
D --> E["Push ghcr.io/taichi112/personal-profile-app:latest"]
E --> F["deploy-gcp: SSH to GCP host"]
E --> G["deploy-azure: validate SSH key and connect to Azure host"]
F --> H["Reset checkout to origin/main"]
G --> I["Reset checkout to origin/main"]
H --> J["Pull app image and restart docker-compose.prod.yml"]
I --> K["Pull app image and restart docker-compose.prod.yml"]
J --> L(["GCP Docker Compose deployment running"])
K --> M(["Azure Docker Compose deployment running"])
Loading
6.6 Deployment Targets
Environment
Platform
Trigger
Development
Local Docker Compose
Manual
Production β GCP host
Docker Compose over SSH
Push to main
Production β Azure host
Docker Compose over SSH
Push to main
7. Maintenance
7.1 Scalability
Horizontal scaling: The current SSH-based Docker Compose deployment runs on individual hosts. Horizontal scaling would require an orchestration or load-balancing layer.
Database scaling: Migrate from single PostgreSQL container to GCP Cloud SQL with read replicas as traffic grows.
Content volume: The Composite tree and Adapter pattern ensure new content types can be added without modifying existing rendering logic.
7.2 Monitoring & Logging
Area
Current
Planned
Client errors
console.log + Toast notifications
Sentry / GCP Error Reporting
Server errors
Next.js default
Structured JSON logs β GCP Cloud Logging
Performance
Manual
Core Web Vitals via Vercel Analytics or GCP
Uptime
None
StatusPage.io / GCP Uptime Checks
Analytics
AnalyticsSystem singleton (client-side)
Google Analytics / Plausible
7.3 Maintenance Schedule
Cadence
Task
Weekly
Review CI failures; check error logs for patterns
Monthly
bun audit + dependency security patches; analyze failed API requests
Quarterly
Major framework version upgrades; security audit; load testing; DR drill
Manual: deploy a known-good GHCR image tag and restart the production Docker Compose services
7.5 Future Enhancements
AI-Native Content Generation: Integrate an LLM API to auto-generate blog post drafts, project descriptions, and resume bullet points
Database-backed portfolio: Migrate static data/content.ts to Prisma-managed Project, Article, Podcast, and Template models
Full-text search: Add PostgreSQL full-text search or Algolia for the content feed
Accessibility audit: Complete WCAG 2.1 AA remediation and add automated axe-core checks to CI
Progressive Web App (PWA): Add service worker and offline support via next-pwa
Kubernetes manifests: Add Helm chart for multi-region, production-scale deployment
Quick Reference: Bun Scripts
bun run dev # Start Webpack dev server
bun run dev:turbo # Start Turbopack dev server
bun run build # Type-check + Next.js production build
bun run start # Start production server
bun run lint # ESLint
bun run db:up # docker compose up -d (PostgreSQL)
bun run db:down # docker compose down
bun run db:logs # Follow PostgreSQL container logs
bun run prisma:generate # Generate Prisma client
bun run prisma:migrate:dev # Apply migrations (dev)
bun run prisma:seed # Seed database via Bun
bun run integration:auth-db # Auth + database integration test
bun run integration:http-crud # HTTP CRUD integration test
bun run integration:http-admin-users # Admin users integration test
Generated from codebase analysis Β· April 2026 Β· Personal Profile Prototype v0.1.0
About
Personal-Profile-Prototype: A highly scalable CMS-style personal portfolio. Architected with 14+ Gang of Four (GoF) Design Patterns to systematically manage dynamic layouts, content hierarchies, themes, and complex workflows.