Architecture
The application uses a modern JAMstack architecture:- Frontend: React 18 with TypeScript, built with Vite
- Serverless Functions: Netlify Functions for backend API operations
- AI Integration: Azure AI models accessed through serverless functions
- Hosting: Netlify with automatic deployments from GitHub
Deployment Flow
Automatic Build
Netlify automatically detects the push and triggers a build using the configuration in
netlify.tomlBuild Process
The build command runs:This compiles your React application and prepares serverless functions
Key Features
Serverless Functions
The portfolio uses Netlify Functions to handle backend operations:- Chat API Proxy: Located at
netlify/functions/chat.ts - Azure AI Integration: Securely proxies requests to Azure AI models
- CORS Handling: Built-in CORS configuration for API requests
Environment Variables
Two critical environment variables are required:VITE_GITHUB_API_TOKEN
GitHub API token for accessing repository data
API_TOKEN
Azure AI API token for chat functionality
Environment variables prefixed with
VITE_ are exposed to the client-side code, while others remain server-side only.Build Configuration
The build process is configured innetlify.toml:
netlify.toml
SPA Routing
The application uses client-side routing with React Router. Netlify is configured to redirect all routes toindex.html:
Next Steps
Netlify Setup
Step-by-step guide to deploying on Netlify
Environment Variables
Configure all required environment variables
Requirements
- Node.js v20 or higher
- pnpm package manager (v10.19.0)
- GitHub account
- Netlify account
- Azure AI API access