This repository contains the code for my portfolio website and its interactive projects.
frontend/— Angular application and GitHub Pages contentbackend/— Cloudflare Worker API for secure Gemini requests
The frontend is hosted with GitHub Pages. The backend is deployed as a Cloudflare Worker so API keys remain secure and are never exposed to visitors.
- Node.js
- Angular CLI
npm install -g @angular/clicd frontend
npm installcd frontend
ng serveOpen the app in your browser at:
http://localhost:4200
The frontend will communicate with the local Cloudflare Worker backend when running locally.
- Node.js
- Cloudflare account
- Wrangler CLI
npm install -g wranglerwrangler logincd backend
npm installThe Gemini API key is stored as a Cloudflare Worker secret and should never be committed to Git.
For local development, create backend/.dev.vars with:
GEMINI_API_KEY=your_api_key_hereFor production deployment, add the secret with:
wrangler secret put GEMINI_API_KEYcd backend
npm run devThe API should be available at:
http://localhost:8787
curl http://localhost:8787/api/testExpected response:
{
"message": "Worker is working!",
"geminiConfigured": true
}cd frontend
ng build --configuration productionThis generates the production files into the docs/ folder, which GitHub Pages uses.
cd frontend
git add .
git commit -m "Update frontend build"
git pushGitHub Pages will serve the content from the docs/ folder.
cd backend
npm run deployAfter deployment, Cloudflare will provide the Worker URL, for example:
https://your-worker-name.workers.dev
Update the production environment file at frontend/src/environments/environment.production.ts:
export const environment = {
production: true,
apiUrl: 'https://your-worker-name.workers.dev',
};Then rebuild the frontend.
-
Start the backend:
cd backend npm run dev -
Start the frontend:
cd frontend ng serve -
Make changes.
-
Test locally.
-
Build the frontend for production.
-
Commit and push changes.
Do not commit the following files:
.env.dev.vars
These files contain API credentials.
The Gemini API key should only exist:
- locally in
backend/.dev.vars - in Cloudflare Worker secrets for production