How jefmonjor/portfolio works
Purpose and Runtime
A trilingual personal portfolio and CV delivery system for Jefferson Montesdeoca. It runs on Next.js 16 App Router with TypeScript, deployed primarily to Vercel; GitHub Actions also supports Docker/SSH deployment to a VPS. Core routes live in app/[locale]/page.tsx, app/[locale]/layout.tsx, and app/api/.
Localized Portfolio Shell
Locale-prefixed pages render the portfolio, metadata, and localized navigation through next-intl. Translation catalogs and routing configuration form the language boundary for Spanish, English, and Catalan.
• app/[locale]/layout.tsx
• app/[locale]/page.tsx
• i18n/routing.ts
• messages/en.json
Portfolio Presentation Layer
The UI is assembled as portfolio sections with shared providers, shadcn primitives, theme support, animation, and optional progressive 3D presentation. Interactive features—including command palette, terminal, project dialogs, and assistant—remain client-facing components, while profile facts are centralized rather than duplicated in views.
• components/portfolio/hero.tsx
• components/portfolio/projects.tsx
• components/portfolio/terminal/terminal.tsx
• components/background-provider.tsx
Canonical Profile and Content Boundary
Structured profile data is the common source for the web portfolio, assistant dossier, machine-readable CV outputs, and PDF rendering. This boundary prevents generated or UI-specific copies from becoming authoritative.
• lib/profile.ts
• types/profile.ts
• types/cv.ts
• lib/assistant/dossier.ts
AI Assistant and Consumption Controls
The assistant API accepts bounded conversation input, grounds responses in a closed public dossier, and calls OpenAI’s Responses API when OPENAI_API_KEY is configured. A shared IP minute/day limiter and global daily budget govern AI endpoints; without a key, the portfolio remains operational with a fallback contact path.
• app/api/assistant/route.ts
• lib/assistant/messages.ts
• lib/assistant/dossier.ts
• lib/assistant/rate-limit.ts
CV Generation and Tailoring Pipeline
CV endpoints expose synchronized Markdown, MAC JSON, and on-demand PDFs. The tailoring endpoint accepts a job offer but constrains OpenAI Structured Outputs to canonical terms and projects; server code validates selections, constructs verified content, and renders the PDF without trusting model-authored browser content.
• app/api/cv-tailor/route.ts
• app/cv.pdf/route.tsx
• server/cv/tailoring.ts
• server/cv/render.tsx
Public Discovery and Service Interfaces
Route handlers publish machine-readable CV representations and crawler-oriented content, while localized metadata and structured data support SEO/GEO. tRPC is available as a typed server boundary, currently rooted around health functionality.
• app/cv.md/route.ts
• app/cv.json/route.ts
• app/llms.txt/route.ts
• app/api/trpc/[trpc]/route.ts
• server/root.ts
Infrastructure and External Dependencies
OpenAI is the only required external runtime integration for AI features. PDFs are server-rendered with @react-pdf/renderer; optional Three.js/WebGL is loaded only after compatible interaction. Deployment configuration is split between Vercel-oriented application deployment and a Docker image plus SSH workflow for VPS delivery.
• Dockerfile
• .github/workflows/ci.yml
• .github/workflows/deploy.yml
• next.config.mjs
Main entry points: profile.ts Canonical profile · tailoring.ts Verified tailoring · layout.tsx Locale layout · route.ts Assistant endpoint
Components 19
Localized web
- Locale layout · Provides localized metadata and navigation.
app/[locale]/layout.tsx - Portfolio page
app/[locale]/page.tsx - Locale routing · Defines Spanish, English, and Catalan routing.
i18n/routing.ts - Translation catalog
messages/en.json - Portfolio UI · Sections and interactive portfolio experiences.
components/portfolio/hero.tsx - Presentation provider · Supplies theme, animation, and progressive background presentation.
components/background-provider.tsx
Canonical content
- Canonical profile · Single source for portfolio, CV, and assistant facts.
lib/profile.ts - Profile schemas
types/profile.ts
AI services
- Assistant endpoint · Accepts bounded conversations and offers fallback contact without AI.
app/api/assistant/route.ts - Public dossier · Closed assistant context derived from public profile facts.
lib/assistant/dossier.ts - AI consumption limits · Enforces per-IP minute/day limits and a global daily budget.
lib/assistant/rate-limit.ts - OpenAI Responses API
CV pipeline
- CV tailoring endpoint · Constrains and validates job-specific CV selections.
app/api/cv-tailor/route.ts - Verified tailoring · Builds CV content only from canonical terms and projects.
server/cv/tailoring.ts - PDF CV endpoint
app/cv.pdf/route.tsx - PDF renderer · Renders trusted CV content with @react-pdf/renderer.
server/cv/render.tsx - Public CV formats · Publishes Markdown, JSON, and crawler-oriented CV content.
app/cv.md/route.ts - tRPC server boundary · Typed interface currently rooted in health functionality.
app/api/trpc/[trpc]/route.ts
Delivery
- Vercel and VPS delivery · Vercel deployment plus Docker/SSH VPS workflow.
Dockerfile
Connections 18
- Locale routing → Locale layout: selects locale
- Translation catalog → Locale layout: localizes
- Locale layout → Portfolio page: wraps
- Portfolio page → Portfolio UI: renders
- Presentation provider → Portfolio UI: provides presentation
- Profile schemas → Canonical profile: types
- Canonical profile → Portfolio UI: supplies facts
- Canonical profile → Public dossier: derives public context
- Public dossier → Assistant endpoint: grounds replies
- AI consumption limits → Assistant endpoint: governs requests
- Assistant endpoint → OpenAI Responses API: calls when configured
- Canonical profile → Verified tailoring: supplies canonical terms
- CV tailoring endpoint → Verified tailoring: requests verified content
- Verified tailoring → OpenAI Responses API: uses structured outputs
- Verified tailoring → PDF renderer: builds trusted CV
- PDF CV endpoint → PDF renderer: renders PDF
- Canonical profile → Public CV formats: serializes
- Vercel and VPS delivery → Locale layout: deploys application