Om Projektet
Teknisk dokumentation och arkitektur
Portfolio & Blog Platform
A modern full-stack web application built with Next.js, TypeScript, and PostgreSQL. The platform combines a personal portfolio with blog functionality, project management, analytics, and dynamic content.
📦View on GitHubFeatures
Content Management
- Markdown Blog with GitHub CMSWrite and publish blog posts in markdown with GitHub as version-controlled backend
- ISR (60s)Incremental Static Regeneration for fresh content without rebuilds
- Dynamic Bio & JourneyEditable bio and timeline via admin panel with real-time updates
- Project ShowcaseAutomatic GitHub repository import with CI/CD deployment status
- NPM Package IntegrationLive download stats and quality metrics from NPM Registry API
Analytics & Tracking
- Privacy-First AnalyticsSHA-256 IP hashing, no cookies, GDPR-compliant visitor tracking
- Token-Based API AuthBcrypt hashed tokens with rate limiting per project
- Action TrackingTrack visits, clicks, scrolls, downloads, and shares
- Real-Time DashboardLive stats with auto-refresh (30s polling) and admin filtering
- Public Stats WidgetVisitor-facing metrics (total visits, unique visitors, popular pages)
Developer Experience
- TypeScript (99.82%)Full type-safety with strict mode across entire stack
- Kysely ORMType-safe SQL query builder with CamelCase plugin
- Server ActionsRPC-style functions replacing 9 API routes for cleaner code
- Path Aliases@/types, @/components, @/lib, @/actions for clean imports
- Hot ReloadTurbopack for instant feedback during development
Performance
- SSR & ISRServer-side rendering with 60s incremental static regeneration
- Parallel QueriesPromise.all for concurrent data fetching (~50ms response time)
- Smart CachingDatabase query optimization with proper indexing
- Code SplittingDynamic imports for reduced initial bundle size
- Database PoolingConnection pooling with max 10 concurrent connections
Security & Auth
- TOTP 2FATwo-factor authentication with Google Authenticator (otplib)
- Iron SessionEncrypted, stateless sessions with rotation
- Protected RoutesServer-side authentication guards for admin pages
- IP Hashing (SHA-256)Privacy-preserving visitor tracking without storing PII
- Rate LimitingConfigurable per-token limits to prevent API abuse
UI & UX
- Liquid Glass DesignGlassmorphism with backdrop-blur and muted okLCH color palette
- 6-Level Shadow SystemDepth through shadows instead of color saturation
- Accessibility (WCAG AA)0 WAVE alerts, semantic HTML, ARIA labels, keyboard nav
- Smooth Animations1s CSS transitions with prefers-reduced-motion support
- Responsive DesignMobile-first approach tested across all breakpoints
Tech Stack
⚛️Frontend
- ▸Next.js 16v16.1.1
React framework with App Router and Server Actions
- ▸React 19v19.0.0
UI library with latest features
- ▸TypeScriptv5.7.2
Type-safe JavaScript (99.82% coverage)
- ▸Tailwind CSS v4v4.0.0-alpha
Utility-first CSS with okLCH color space
🔧Backend
- ▸Server Actions
RPC-style functions replacing REST API routes
- ▸Kyselyv0.27.4
Type-safe SQL query builder with CamelCase plugin
- ▸PostgreSQL (Neon)
Serverless Postgres with connection pooling
- ▸Iron Sessionv8.0.3
Encrypted stateless session management
- ▸bcryptjsv2.4.3
Secure password and token hashing
🔌Integrations
- ▸Octokitv4.0.2
GitHub API client for repo and content management
- ▸NPM Registry API
Package stats and metadata fetching
- ▸otplibv12.0.1
TOTP generation and validation for 2FA
- ▸GitHub Webhooks
Post-publish triggers for database sync
🛠️Dev Tools
- ▸Turbopack
Next-gen bundler for fast development
- ▸ESLint
Code linting and quality checks
- ▸dotenvx
Environment variable management
- ▸tsx
TypeScript execution for scripts
Arkitektur
The project follows a modern Next.js App Router architecture with separation of concerns, type-safety, and modular design enabling easy feature extraction.
Presentation Layer
src/app/React Server Components, Client Components, and file-based routing
Action Layer
src/lib/actions/Server Actions organized by domain (auth, posts, analytics, journey, bio, projects)
Data Layer
src/lib/Database interaction and external API calls with connection pooling
Component Layer
src/components/Reusable UI components organized by domain (layout, blog, forms, common, projects, bio, npm, ui)