This repository contains the source code for my personal website and blog, dsanchezcr.com. The site is built using Docusaurus, a modern static website generator with a .NET 8 API backend.
This website serves as a platform to share my thoughts on technology, software development, and other interests through blog posts. It also includes information about my projects, professional background, volunteering experience, and a gaming section showcasing my gaming profiles and curated game lists across Xbox, PlayStation, Nintendo Switch, Meta Quest, Phone/Mobile, and Board Games.
The site uses Azure Static Web Apps with a managed API architecture:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Azure Static Web Apps โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Docusaurus Site โ โ .NET 8 Managed API โ โ
โ โ (React/MDX) โ โ (Azure Functions) โ โ
โ โ โ โ โ โ
โ โ โข Blog posts โ โ โข /api/contact โ โ
โ โ โข Static pages โ โ โข /api/verify โ โ
โ โ โข i18n (en/es/pt) โ โ โข /api/weather โ โ
โ โ โข Volunteering โ โ โ โ
โ โ โข Gaming โ โ โข /api/nlweb/ask โ โ
โ โ (multi-platform) โ โ โ โ
โ โ โ โ โข /api/health โ โ
โ โ โ โ โข /api/reindex โ โ
โ โ โ โ โข /api/gaming/xbox โ โ
โ โ โ โ โข /api/gaming/playstation โ โ
โ โ โ โ โข /api/gaming/refresh โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Both frontend and backend are deployed together from a single repository, with the API served from the same domain under /api.
- Docusaurus v3: Static site generator
- React: UI components
- MDX: Content authoring
- Internationalization: English, Spanish, Portuguese
- .NET 8: Runtime
- Azure Functions: Serverless compute (isolated worker model)
- Azure Communication Services: Email delivery
- Azure OpenAI: AI chat assistant
- Azure AI Search: RAG for contextual AI responses
- Azure Table Storage: Token & gaming profile persistence
- OpenXBL API: Xbox Live profile data
- PSN API: PlayStation Network profile & trophy data
- Azure Static Web Apps: Hosting
- Bicep: Infrastructure as Code
- Application Insights: Monitoring
- Node.js matching
package.jsonengines: 22.22.2+, 24.15.0+, or 26+ - .NET 8 SDK
- Azure Functions Core Tools v4
- SWA CLI (optional, for full local emulation)
git clone https://github.com/dsanchezcr/website.git
cd website
npm install
dotnet restore api/api.csprojOption 1: SWA CLI (Recommended) - Full emulation with API integration
npm install -g @azure/static-web-apps-cli
swa startAccess at http://localhost:4280 (API available at /api/*)
Option 2: Frontend Only
npm startAccess at http://localhost:3000
Option 3: API Only
cd api
dotnet build
func start --csharpAccess at http://localhost:7071
# Build frontend
npm run build
# Build API
cd api && dotnet build --configuration ReleaseBuild artifacts:
- Frontend:
build/ - API:
api/bin/Release/net8.0/
| Language | Path Prefix | Translation Directory |
|---|---|---|
| English | / (default) |
- |
| Spanish | /es/ |
i18n/es/ |
| Portuguese | /pt/ |
i18n/pt/ |
| Endpoint | Method | Description |
|---|---|---|
/api/contact |
POST | Submit contact form (initiates email verification) |
/api/verify |
GET | Complete email verification |
/api/weather |
GET | Weather data for predefined locations |
/api/nlweb/ask |
POST | AI chat assistant with RAG |
/api/health |
GET | Health check for all services |
/api/reindex |
POST | Update search index (called by GitHub Actions) |
/api/gaming/xbox |
GET | Xbox Live profile, gamerscore, and recent games |
/api/gaming/playstation |
GET | PSN profile, trophies, and recent games |
/api/gaming/refresh |
POST | Admin: trigger gaming data refresh |
/api/content-admin/tmdb?tmdbId=550&mediaType=movie |
GET | Admin-only: localized movie/TV metadata; server-side TMDB token |
Push to main or create a PR to trigger automatic deployment via azure-static-web-app.yml.
Deploy infrastructure using the Bicep templates in infra/:
az deployment group create \
--resource-group <resource-group> \
--template-file infra/main.bicep \
--parameters infra/main.parameters.json \
--parameters \
azureCommunicationServicesConnectionString="<secret>" \
recaptchaSecretKey="<secret>" \
azureOpenAIEndpoint="<endpoint>" \
azureOpenAIKey="<secret>"See infra/README.md for complete deployment instructions.
Set TMDB_READ_ACCESS_TOKEN in the managed API's Azure Static Web Apps application settings.
Locally, put TMDB_READ_ACCESS_TOKEN=<your-token> in ignored api/.env, or use
api/local.settings.json โ Values. Existing environment settings take precedence;
production never loads .env. Never use VITE_* or client-side keys.
In /admin, add/edit a Movie or Series, enter its numeric TMDB ID, and click
Fetch Data. Review the localized titles/plots/genres, year, director or creators,
TMDB rating and poster URL, then Save. Lookup makes no database writes and
downloads no images. It refreshes English metadata and fills missing es/pt
translations while preserving existing translations, reviews, personal ratings,
categories, ordering and unknown fields.
The authenticated proxy uses HTTPS, bounded requests and safe errors. See the TMDB setup guide for configuration, quotas, troubleshooting and the API contract.
TMDB account syncing and its scheduled workflow remain retired. Existing imported
records and attribution remain compatible, with no migration. After rollout,
remove OMDB_API_KEY and obsolete account-sync credentials as described in the
setup guide. Keep the TMDB read access token; no GitHub secret or scheduled job is needed.
โโโ api/ # .NET 8 Azure Functions API
โ โโโ SendEmail.cs # Contact form endpoint
โ โโโ VerifyEmail.cs # Email verification
โ โโโ GetWeather.cs # Weather data
โ โโโ ChatWithOpenAI.cs # AI chat with RAG
โ โโโ HealthCheck.cs # Health monitoring
โ โโโ ReindexContent.cs # Search index updates
โ โโโ GetTmdbMetadata.cs # Admin-only localized movie/TV metadata lookup
โ โโโ GetXboxProfile.cs # Xbox Live profile data
โ โโโ GetPlayStationProfile.cs # PSN profile & trophies
โ โโโ RefreshGamingProfiles.cs # Admin refresh endpoint
โ โโโ Services/ # TokenStorage, Search, GamingCache
โโโ blog/ # Blog posts (MDX)
โโโ gaming/ # Gaming docs section
โ โโโ xbox/ # Xbox & PC games
โ โโโ playstation/ # PlayStation games
โ โโโ nintendo-switch/ # Nintendo Switch games
โ โโโ meta-quest/ # Meta Quest games
โ โโโ phone-mobile/ # Phone & mobile games
โ โโโ board-games/ # Board games
โ โโโ chess/ # Chess profile
โโโ src/
โ โโโ components/ # React components
โ โ โโโ Gaming/ # Gaming widgets and renderers
โ โโโ data/
โ โ โโโ gaming/ # Per-platform gaming JSON data files
โ โโโ pages/ # Static pages
โ โโโ config/ # Environment configuration
โโโ i18n/ # Translations (es/, pt/)
โโโ infra/ # Bicep templates
โโโ static/ # Static assets + SWA config
โโโ .github/workflows/ # CI/CD pipelines
The website includes a gaming section at /gaming with live profile integrations and data-driven catalogs.
| Platform | Features | Data Source |
|---|---|---|
| Xbox & PC | Live profile (gamertag, gamerscore), recently played games | OpenXBL API |
| PlayStation | Trophy summary, recently played games, PSN profile | PSN Internal API |
| Nintendo Switch | Curated entries rendered from platform JSON | User-curated content |
| Meta Quest | Curated VR/MR entries rendered from platform JSON | User-curated content |
| Phone/Mobile | Curated mobile entries rendered from platform JSON | User-curated content |
| Board Games | Curated tabletop entries rendered from platform JSON | User-curated content |
| Chess | Live profile widget | Chess.com profile data |
Key features:
- Live profile data fetched from gaming APIs
- Dual-layer caching (in-memory + Azure Table Storage) for resilience
- Automatic fallback to cached data when APIs are unavailable
- Clickable game cards linking to Xbox/PlayStation store pages
- Per-platform JSON data files in
src/data/gaming/*.json GamingEntriesRenderer+GameCard/GameCardGroupcomponents for consistent rendering- Gaming docs in English, Spanish, and Portuguese all use the same JSON-driven platform data model
- Full i18n support (English, Spanish, Portuguese)
Required environment variables for gaming APIs:
XBOX_API_KEY # API key from https://xbl.io
XBOX_GAMERTAG_XUID # Numeric Xbox User ID (XUID)
PSN_NPSSO_TOKEN # NPSSO token from https://ca.account.sony.com/api/v1/ssocookie
GAMING_REFRESH_KEY # Optional automation key; admin UI uses its signed-in role
Rotating the PSN NPSSO token (expires every ~60 days):
The PlayStation NPSSO token expires roughly every 60 days. When it does, the live PSN
fetch fails and /api/gaming/playstation falls back to the last cached copy, returning
"isCached": true. The daily Refresh Gaming Profiles workflow fails when it detects
stale cache, which is the signal to rotate:
- Sign in at playstation.com in a browser.
- Visit
https://ca.account.sony.com/api/v1/ssocookieand copy thenpssovalue. - Update the
PSN_NPSSO_TOKENapplication setting on the Static Web App. - Open Admin > Gaming > Refresh PlayStation (or Xbox/both). The signed-in admin
role authorizes the request. Automation can also call
POST /api/gaming/refreshwithX-Gaming-Refresh-Key: <GAMING_REFRESH_KEY>. Refresh fetches immediately; failures are reported per provider and keep the last working cached profile. - Confirm the admin reports the connection as refreshed, or re-run the Refresh Gaming Profiles workflow and confirm the public response reports
"isCached": false. - Curated game cards now sort newest-added first automatically. Use the optional Manual rank to pin entries, or clear it to restore automatic ordering. Top Games retains ascending Order. See admin ordering details.
/api/health also reports the cache age per platform and degrades when data is older
than 3 days.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is private and the code is proprietary. However, the blog content, unless otherwise stated, is open for sharing and referencing with appropriate attribution.
Thank you for visiting my repository!