The Santiago Nieto portfolio is a production-grade personal site built with TanStack Start and React 19. Every piece of data you see on the page — profile information, repositories, contribution statistics, and activity events — is fetched live from the GitHub REST API and cached for one week via a dual-layer snapshot system. There are no static JSON files to keep in sync: when the cache is warm the site responds instantly; when it is cold a single parallel burst of GitHub API calls rebuilds the snapshot in the background before the page is returned to the browser.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagonieto09/portafolio/llms.txt
Use this file to discover all available pages before exploring further.
Tech Stack
| Dependency | Role |
|---|---|
| TanStack Start | Full-stack SSR framework; handles server entry, routing, and server functions |
| TanStack Router | File-based, fully type-safe client/server router |
| TanStack Query | Async data-fetching, caching, and dehydration/rehydration across the SSR boundary |
| React 19 | UI rendering with concurrent features and the new use() hook |
| TypeScript | End-to-end type safety across domain, infrastructure, and UI layers |
| Tailwind CSS v4 | Utility-first styling with the new CSS-first configuration format |
| shadcn/ui + Radix UI | Accessible, unstyled component primitives styled with Tailwind |
| Bun | JavaScript runtime and package manager used for local development and CI |
| Vite | Dev server with HMR and optimised production bundling |
| Vitest | Unit and integration test runner co-located with the Vite config |
| Nitro | Server engine that compiles the app to Vercel or Cloudflare Workers via a preset flag |
How Data Flows
The following describes the full request lifecycle from the moment a visitor’s browser makes a request to the moment a fully-rendered page arrives:- Browser request — A visitor navigates to the portfolio. TanStack Router matches the
/route and triggers SSR on the server. - Server function — The route loader calls
getPortfolio(), a TanStack Start server function defined inlib/portfolio.functions.ts, which in turn delegates tofetchPortfolio()in the infrastructure layer. - Snapshot cache check — The infrastructure
fetchPortfolio()function first queries the snapshot cache (Cloudflare Cache API when running on Workers, in-memory otherwise). If a validPortfolioSnapshotexists and is younger than seven days, it is returned immediately. - Cache miss → parallel GitHub API calls — On a cache miss, the infrastructure layer fires four parallel requests to the GitHub REST API:
GET /users/{username}— profile, bio, avatar, location, follower countsGET /users/{username}/repos— full repository list with language and star dataGET /users/{username}/social_accounts— linked social platform URLsGET /users/{username}/events/public— recent contribution events for the activity feed
- Snapshot assembly — The raw API responses are normalised and merged into a typed
PortfolioSnapshotvalue indomain/github/types.ts. - Cache write — The new snapshot is persisted to the cache layer with a one-week TTL so subsequent requests are served instantly.
- SSR render — TanStack Query dehydrates the snapshot into the HTML payload. React 19 renders the complete page on the server and streams it to the browser with no client-side loading states for the initial paint.
Project Structure
Thesrc/ directory is organised into four top-level concerns:
components/portfolio/
Feature-specific React components that compose the visible portfolio page:
| Component | Description |
|---|---|
ProfileHero | Avatar, name, bio, location, and follower/following counts |
StatsGrid | Summary tiles for total public repos, stars, forks, and releases |
LanguageChart | Doughnut chart of programming languages weighted by repository byte count |
RepositoryExplorer | Filterable, sortable card grid of all public repositories |
ActivityFeed | Chronological list of recent public GitHub events |
SiteHeader | Top navigation bar with theme toggle |
SocialButtons | Icon-linked buttons for each detected social account |
RepositoryCard | Individual card within the Repository Explorer |
RepositoryFilters | Language and sort-order controls for the Repository Explorer |
components/ui/
Low-level shadcn/ui primitives consumed by the portfolio components:
DropdownMenu— Radix-based accessible dropdownSelect— Radix-based accessible select input
domain/github/
Pure business-logic modules with no I/O dependencies:
types.ts— All TypeScript interfaces:GitHubUser,GitHubRepo,PortfolioSnapshot, etc.language-colors.ts— Mapping of language names to their canonical GitHub colour hex codestechnology-detection.ts— Heuristic rules that infer the technologies used in a repository from itstopics,language, and dependency file names
domain/portfolio/
repository-query.ts— Filter and sort predicates applied to the repository list inside the Repository Explorer
infrastructure/github/
All network I/O to the GitHub REST API is isolated here:
github-api.server.ts— Server-only module that constructs authenticatedfetchcalls with optionalGITHUB_TOKENbearer authgithub-api-types.ts— Raw API response shapes (separate from the domain types to preserve a clear anti-corruption layer)snapshot-cache.ts— Cache read/write logic; uses the Cloudflare Cache API when available and falls back to an in-processMap
hooks/
Custom React hooks shared across components:
use-mobile.tsx— Detects whether the current viewport width is below the mobile breakpointuse-relative-time.ts— Formats an ISO timestamp as a human-readable relative string (e.g. “3 days ago”)use-theme.ts— Reads and toggles the active colour theme (light / dark / system)
lib/
Shared utilities and cross-cutting concerns:
constants.ts— Site-wide constants:GITHUB_USERNAME,GITHUB_PROFILE_URL, andCONTACT_EMAILportfolio.functions.ts— TanStack Start server function (getPortfolio) that delegates to the infrastructure layer to fetch and return thePortfolioSnapshotportfolio.queries.ts— TanStack QueryqueryOptionsfactories consumed by route loadersformat.ts— Number and date formatting helpersdocs-url.ts— Helper that constructs absolute documentation linksutils.ts— Generic utility functions (cn class merger, etc.)
routes/
TanStack Router file-based routes:
index.tsx— Main portfolio page; prefetchesPortfolioSnapshotin the loader and renders all section componentsapi/public/sync.ts—POSTendpoint that manually triggers a cache refresh; protected byCRON_SECRETsitemap[.]xml.ts— Generates a validsitemap.xmlusingSITE_URL
The
github-api.server.ts file uses the .server.ts filename convention enforced by TanStack Start and Nitro. Any module with .server. in its name is stripped from the client bundle at build time, ensuring that your GITHUB_TOKEN and raw API logic never ship to the browser.Explore Further
Quickstart
Clone, configure, and run the portfolio locally in under five minutes.
Configuration
Environment variables, GitHub token scopes, and cron sync setup.
Architecture Overview
Deep dive into the SSR pipeline, snapshot cache, and technology-detection engine.
Features: Repositories
How the Repository Explorer filters, sorts, and displays your public repos.