Skip to content
rntschlrPublic

About

Personal portfolio — johnkrentschler.me. React 19, TypeScript, Cloudflare Pages, bilingual EN/HU

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

johnkrentschler.me

Personal portfolio site for John Rentschler — developer, fintech, and networker.

Live: johnkrentschler.me

Stack

Layer Tech
Frontend React 19, TypeScript 5.7, Vite 6
Styling Hand-authored CSS, custom properties
API Cloudflare Pages Functions
Email Resend
Hosting Cloudflare Pages

Local Development

Prerequisites

  • Node.js 22+
  • npm 10+
  • Wrangler CLI (included as a dev dependency)

Setup

git clone https://github.com/rntschlr/jkr.me.git
cd jkr.me
npm install

Environment Variables

Copy the example vars file for local development:

cp .dev.vars.example .dev.vars

Then fill in your values in .dev.vars. See .dev.vars.example for reference.

Note: Cloudflare Pages Functions use .dev.vars instead of .env. This file is gitignored.

Run

# Start the Vite dev server (frontend only)
npm run dev

# Start with Cloudflare Functions (runs contact API locally)
npx wrangler pages dev dist --compatibility-date=2024-12-01
# Run `npm run build` first, or open two terminals and combine both

Scripts

Command Description
npm run dev Start Vite dev server
npm run build Type-check + production build
npm run preview Preview production build locally
npm run typecheck TypeScript type-check only
npm run lint Lint with ESLint
npm run lint:fix Lint and auto-fix
npm run format Format with Prettier
npm run format:check Check formatting without writing

Project Structure

.
├── functions/
│   └── api/
│       └── contact.ts     # Cloudflare Pages Function — email endpoint
├── public/
│   ├── _headers           # Cloudflare security + cache headers
│   ├── manifest.json      # PWA manifest
│   ├── robots.txt
│   └── sitemap.xml
├── src/
│   ├── components/        # React section components
│   ├── hooks/             # Custom React hooks
│   ├── styles/            # Hand-authored CSS (one file per section)
│   ├── App.tsx
│   ├── main.tsx
│   └── index.css
├── index.html
├── vite.config.ts
└── wrangler.toml

Deployment

The site deploys automatically to Cloudflare Pages on every push to main via GitHub Actions.

Manual Deploy

npm run build
npx wrangler pages deploy dist --project-name=personalportfolio

Cloudflare Pages Secrets

Set RESEND_API_KEY in your Cloudflare Pages project settings under Settings → Environment variables.

Without this variable, the contact form falls back to a mailto: link automatically.

Contact Form

The contact form at /api/contact is a Cloudflare Pages Function that:

  • Validates required fields (name, email, message)
  • Rejects bots via a honeypot field
  • Sends email via Resend if RESEND_API_KEY is set
  • Returns a 501 with "fallback": "mailto" if the key is absent — the frontend handles this gracefully

Rate Limiting

Production rate limiting is configured at the Cloudflare dashboard level (Security → Rate limiting rules) on path /api/contact. Recommended settings: 10 req/min/IP, action Block.

The in-code per-isolate throttle in functions/api/contact.ts is a defense-in-depth supplement, not a replacement. It only persists for the lifetime of a single Cloudflare Worker isolate and provides no cross-isolate protection; the dashboard rule is the authoritative gate.

License

MIT

About

Personal portfolio — johnkrentschler.me. React 19, TypeScript, Cloudflare Pages, bilingual EN/HU

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages