A modern, performant portfolio website built with SvelteKit 5, TypeScript, and Tailwind CSS v4. Deployed on Cloudflare Pages with integrated R2 storage for automated project screenshots.
@iconify/svelteClone the repository:
git clone https://github.com/Damianko135/portfolio-svelte.git
cd portfolio-svelte
Install dependencies:
pnpm install
Start the development server:
pnpm dev
The application will be available at http://localhost:5173
To add a new project to your portfolio, edit src/lib/data/projects.json and add a new entry:
{
"id": 4,
"uuid": "d4e5f6a7-b8c9-0123-def4-567890123456",
"name": "Your Project Name",
"url": "https://your-project-url.com",
"description": "A brief description of your project",
"technologies": [{ "name": "Technology Name", "icon": "simple-icons:iconname" }]
}
Each project requires a unique UUID for screenshot identification. Here are several ways to generate one:
node -e "console.log(require('crypto').randomUUID())"
[guid]::NewGuid().ToString()
Visit uuidgenerator.net or uuid.rocks
Install the "UUID Generator" extension and use Ctrl+Shift+P โ "Insert UUID"
Icons are powered by Iconify. To find an icon:
simple-icons:svelte, mdi:github)technologies arrayUUIDs are used instead of sequential IDs to:
pnpm dev # Start development server
pnpm build # Build for production
pnpm preview # Preview production build locally with Wrangler
pnpm check # Run TypeScript and Svelte checks
pnpm check:watch # Run checks in watch mode
pnpm format # Format code with Prettier
pnpm lint # Lint code with Prettier
pnpm test # Run Playwright E2E tests
pnpm test:e2e # Run Playwright E2E tests
pnpm playwright # Install Playwright browsers
portfolio-svelte/
โโโ src/
โ โโโ lib/
โ โ โโโ data/
โ โ โ โโโ projects.json # Project data
โ โ โโโ server/
โ โ โ โโโ screenshot.ts # Screenshot generation logic
โ โ โโโ Footer.svelte
โ โ โโโ Header.svelte
โ โ โโโ Icon.svelte
โ โ โโโ ThemeToggle.svelte
โ โ โโโ types.ts # TypeScript types
โ โโโ routes/
โ โ โโโ about/ # About page
โ โ โโโ contact/ # Contact page
โ โ โโโ projects/ # Projects page
โ โ โโโ api/screenshot/[slug]/ # Screenshot API endpoint
โ โ โโโ +layout.svelte # Root layout
โ โ โโโ +page.svelte # Home page
โ โโโ app.css # Global styles
โ โโโ app.html # HTML template
โโโ static/ # Static assets
โโโ tests/ # E2E tests
โโโ wrangler.jsonc # Cloudflare configuration
โโโ package.json
Install Wrangler CLI (if not already installed):
npm install -g wrangler
Login to Cloudflare:
wrangler login
Configure R2 Bucket (for screenshots):
screenshots in your Cloudflare dashboardwrangler.jsonc with your bucket name if differentConfigure Browser Rendering:
wrangler.jsonc if neededDeploy:
pnpm deploy
This will:
The application uses Cloudflare bindings configured in wrangler.jsonc:
SCREENSHOTS - R2 bucket for storing project screenshotsMYBROWSER - Browser Rendering API bindingThis application implements multiple layers of security protection:
429 Too Many Requests when limit exceededAll responses include comprehensive security headers:
Rate limiting and security settings can be adjusted in src/hooks.server.ts:
const RATE_LIMIT_WINDOW = 60 * 1000; // 1 minute
const RATE_LIMIT_MAX_REQUESTS = 30; // General endpoints
const RATE_LIMIT_API_MAX_REQUESTS = 10; // API endpoints
Note: For production-scale applications, consider using Cloudflare KV or Durable Objects for distributed rate limiting.
Edit the Tailwind configuration in your CSS or Tailwind config to customize the color scheme.
src/routes/about/+page.sveltesrc/routes/contact/+page.sveltesrc/routes/+page.sveltesrc/lib/data/projects.jsonRun E2E tests with Playwright:
# Install browsers (first time only)
pnpm playwright
# Run tests
pnpm test
This project is private and not licensed for public use.
This is a personal portfolio project. Feel free to fork it for your own use!
For any inquiries, please visit the contact page on the live website.
Built with โค๏ธ using SvelteKit and Cloudflare