Skip to content

dsanchezcr/website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

580 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

David's Personal Website

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 9 API backend.

Build and Deploy CodeQL

โœจ About This Repository

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 video games section showcasing my gaming profiles across Xbox, PlayStation, Nintendo Switch, and Meta Quest.

๐Ÿ—๏ธ Architecture

The site uses Azure Static Web Apps with a managed API architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Azure Static Web Apps                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   Docusaurus Site   โ”‚    โ”‚    .NET 9 Managed API       โ”‚ โ”‚
โ”‚  โ”‚   (React/MDX)       โ”‚    โ”‚    (Azure Functions)        โ”‚ โ”‚
โ”‚  โ”‚                     โ”‚    โ”‚                             โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Blog posts       โ”‚    โ”‚  โ€ข /api/contact             โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Static pages     โ”‚    โ”‚  โ€ข /api/verify              โ”‚ โ”‚
โ”‚  โ”‚  โ€ข i18n (en/es/pt)  โ”‚    โ”‚  โ€ข /api/weather             โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Volunteering     โ”‚    โ”‚  โ€ข /api/online-users        โ”‚ โ”‚
โ”‚  โ”‚  โ€ข Video Games      โ”‚    โ”‚  โ€ข /api/nlweb/ask           โ”‚ โ”‚
โ”‚  โ”‚    (Xbox/PSN/NSW/   โ”‚    โ”‚                             โ”‚ โ”‚
โ”‚  โ”‚     Meta Quest)     โ”‚    โ”‚                             โ”‚ โ”‚
โ”‚  โ”‚                     โ”‚    โ”‚  โ€ข /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.

๐Ÿš€ Tech Stack

Frontend

  • Docusaurus v3: Static site generator
  • React: UI components
  • MDX: Content authoring
  • Internationalization: English, Spanish, Portuguese

Backend (Managed API)

Infrastructure

๐Ÿ Getting Started

Prerequisites

Installation

git clone https://github.com/dsanchezcr/website.git
cd website
npm install
dotnet restore api/api.csproj

Running Locally

Option 1: SWA CLI (Recommended) - Full emulation with API integration

npm install -g @azure/static-web-apps-cli
swa start

Access at http://localhost:4280 (API available at /api/*)

Option 2: Frontend Only

npm start

Access at http://localhost:3000

Option 3: API Only

cd api
dotnet build
func start --csharp

Access at http://localhost:7071

๐Ÿ› ๏ธ Building

# Build frontend
npm run build

# Build API
cd api && dotnet build --configuration Release

Build artifacts:

  • Frontend: build/
  • API: api/bin/Release/net9.0/

๐ŸŒ Internationalization (i18n)

Language Path Prefix Translation Directory
English / (default) -
Spanish /es/ i18n/es/
Portuguese /pt/ i18n/pt/

๐Ÿ“ก API Endpoints

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/online-users GET Visitor analytics (24-hour count)
/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

โ˜๏ธ Deployment

Automatic (GitHub Actions)

Push to main or create a PR to trigger automatic deployment via azure-static-web-app.yml.

Manual (Bicep)

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.

๐Ÿ“ Project Structure

โ”œโ”€โ”€ api/                    # .NET 9 Azure Functions API
โ”‚   โ”œโ”€โ”€ SendEmail.cs        # Contact form endpoint
โ”‚   โ”œโ”€โ”€ VerifyEmail.cs      # Email verification
โ”‚   โ”œโ”€โ”€ GetWeather.cs       # Weather data
โ”‚   โ”œโ”€โ”€ GetOnlineUsers.cs   # Analytics
โ”‚   โ”œโ”€โ”€ ChatWithOpenAI.cs   # AI chat with RAG
โ”‚   โ”œโ”€โ”€ HealthCheck.cs      # Health monitoring
โ”‚   โ”œโ”€โ”€ ReindexContent.cs   # Search index updates
โ”‚   โ”œโ”€โ”€ GetXboxProfile.cs   # Xbox Live profile data
โ”‚   โ”œโ”€โ”€ GetPlayStationProfile.cs # PSN profile & trophies
โ”‚   โ”œโ”€โ”€ RefreshGamingProfiles.cs # Admin refresh endpoint
โ”‚   โ””โ”€โ”€ Services/           # TokenStorage, Search, GamingCache
โ”œโ”€โ”€ blog/                   # Blog posts (MDX)
โ”œโ”€โ”€ videogames/             # Video Games docs section
โ”‚   โ”œโ”€โ”€ xbox/               # Xbox & PC games
โ”‚   โ”œโ”€โ”€ playstation/        # PlayStation games
โ”‚   โ”œโ”€โ”€ nintendo-switch/    # Nintendo Switch games
โ”‚   โ””โ”€โ”€ meta-quest/         # Meta Quest games
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ””โ”€โ”€ VideoGames/     # Gaming widgets (XboxProfile, PSNProfile, GameCard)
โ”‚   โ”œโ”€โ”€ pages/              # Static pages
โ”‚   โ””โ”€โ”€ config/             # Environment configuration
โ”œโ”€โ”€ i18n/                   # Translations (es/, pt/)
โ”œโ”€โ”€ infra/                  # Bicep templates
โ”œโ”€โ”€ static/                 # Static assets + SWA config
โ””โ”€โ”€ .github/workflows/      # CI/CD pipelines

๐ŸŽฎ Video Games Section

The website includes a video games section at /videogames showcasing gaming profiles across three platforms:

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 Manual game cards with status updates User-curated content
Meta Quest Manual VR/MR game lists User-curated content

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
  • Custom GameCard component for manual game entries with status updates
  • 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          # Secret key for admin refresh endpoint

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

๐Ÿ“ License

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!

Sponsor this project

  •  

Contributors