No description
  • Svelte 82.1%
  • TypeScript 8.1%
  • JavaScript 6.6%
  • Shell 1.2%
  • Dockerfile 0.8%
  • Other 1.2%
Find a file
2026-03-05 17:14:31 +01:00
.vscode refactor(ui): restructure social links and footer components 2025-12-23 01:42:54 +01:00
src fix: fixed connect-src and added umami 2026-03-05 17:14:31 +01:00
static feat: improvements in security, seo and project structure 2026-02-15 23:22:17 +01:00
tests Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.env.example refactor(analytics): replace server-side Umami tracking with client-side script 2026-01-01 21:13:07 +01:00
.eslintignore Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.eslintrc.cjs Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.gitignore Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.npmrc Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.prettierignore Add initial project files and configurations 2024-01-19 22:13:56 +01:00
.prettierrc Add initial project files and configurations 2024-01-19 22:13:56 +01:00
CHANGELOG.md feat: improvements in security, seo and project structure 2026-02-15 23:22:17 +01:00
Dockerfile feat(build): add Dockerfile for production deployment 2025-12-23 02:25:30 +01:00
package.json feat(wave): animations added to header 2026-02-15 22:41:37 +01:00
playwright.config.ts Add initial project files and configurations 2024-01-19 22:13:56 +01:00
pnpm-lock.yaml feat(wave): animations added to header 2026-02-15 22:41:37 +01:00
publish.sh feat(wave): animations added to header 2026-02-15 22:41:37 +01:00
README.md feat(analytics): migrate Umami tracking to environment variables 2026-01-01 20:41:41 +01:00
RECOMMENDATIONS.md feat: improvements in security, seo and project structure 2026-02-15 23:22:17 +01:00
svelte.config.js build(deps): upgrade major dependencies and migrate to Svelte 5 2025-12-23 00:46:40 +01:00
tsconfig.json Add initial project files and configurations 2024-01-19 22:13:56 +01:00
vite.config.ts build(deps): upgrade major dependencies and migrate to Svelte 5 2025-12-23 00:46:40 +01:00

create-svelte

Everything you need to build a Svelte project, powered by create-svelte.

Creating a project

If you're seeing this, you've probably already done this step. Congrats!

# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.


Umami Analytics Integration

The application includes a comprehensive Umami Analytics integration that tracks page views and logs detailed request information. This integration is implemented using SvelteKit server hooks.

Configuration

To configure Umami Analytics, add the following environment variables to your .env file:

# Umami Analytics Configuration
UMAMI_COLLECTION_ENDPOINT=https://your-umami-instance.com/api/collect
UMAMI_WEBSITE_ID=your-website-id-here
UMAMI_ENABLE_LOGGING=true
UMAMI_DEBUG_MODE=false
UMAMI_BATCH_INTERVAL=5000       # Batch interval in ms (default: 5000)
UMAMI_MAX_BATCH_SIZE=10         # Maximum batch size (default: 10)
UMAMI_TIMEOUT_MS=10000          # Request timeout in ms (default: 10000)

Features

  1. Comprehensive Logging: Detailed request logging with timestamps, request IDs, method, path, query parameters, headers, IP, and user agent
  2. Batch Processing: Requests are batched to reduce API calls and improve performance
  3. Error Handling: Robust error handling with detailed error logging
  4. Device Detection: User agent parsing to detect browser, OS, device type, and screen size
  5. Performance Tracking: Tracks request duration and includes performance metrics
  6. Location Tracking: Client IP address is included in payload for accurate location tracking
  7. Configurable: All aspects are configurable via environment variables

Log Levels

The integration supports different log levels:

  • info: General information (default)
  • warn: Warnings about potential issues
  • error: Errors that need attention

Implementation Details

The Umami integration is implemented in src/hooks.server.ts and includes:

  1. Request Tracking: Intercepts all incoming requests and logs detailed information
  2. Payload Creation: Creates comprehensive payloads with device information, performance metrics, and request details
  3. IP Address Tracking: Includes client IP address in payload for accurate location tracking
  4. Batch Processing: Collects requests and sends them in batches to reduce API calls
  5. Cleanup: Properly handles process exit to ensure pending requests are sent

Error Handling

The integration includes comprehensive error handling:

  • Network errors
  • Timeout errors
  • Invalid responses
  • Configuration errors
  • Payload creation errors

All errors are logged with detailed information to help with debugging.

Debugging

To enable debug mode, set:

UMAMI_DEBUG_MODE=true
UMAMI_ENABLE_LOGGING=true

Debug mode provides detailed JSON output of all logged information.

Type Safety

The integration includes TypeScript type definitions in src/app.d.ts for all Umami-related environment variables.