My-Svelte-Assignment-Project Svelte Themes

My Svelte Assignment Project

Repository created for sharing my assignment with the interviewers

Developer Portfolio Analytics MVP

A lightweight analytics dashboard for developers to showcase their profile professionally, monitor project performance, view deployment & API usage insights, and track errors and traffic trends.

Built with SvelteKit as an installable Progressive Web App (PWA).

✨ Features

Profile Page (/profile)

  • Hero Section - Avatar, name, role, tagline, and social links
  • Tech Stack - Categorized skills with proficiency indicators
  • Featured Projects - Project cards with metrics and status
  • Contribution Activity - GitHub-style heatmap visualization

Dashboard Page (/dashboard)

  • Overview Metrics - Total projects, API calls, deployments, error rate, uptime, users served
  • Traffic Analytics Chart - Monthly API calls and unique users (filterable by project)
  • Traffic by Project - Donut chart showing traffic distribution
  • Response Time Chart - Daily average response times (filterable by project)
  • Recent Errors Panel - Filterable error logs with tab navigation (All/Critical/Warning/Info)
  • Deployment Status - Real-time deployment health with CPU/Memory metrics

šŸ— Architecture

Aspect Approach
Framework SvelteKit
Rendering Hybrid SSR + CSR
PWA Installable with caching
Data Mock JSON files (simulates backend)
Charts ApexCharts (dynamically loaded)
Styling Global CSS + Component-scoped CSS

Rendering Strategy

Component Rendering Reason
Profile Page SSR SEO friendly, static content
Dashboard Metrics SSR Critical data, fast first paint
Deployment Status SSR Lightweight, important info
Charts CSR Heavy JS, not needed for initial paint
Error Logs CSR Interactive, loads on demand

šŸ“ Project Structure

src/
ā”œā”€ā”€ lib/
│   └── data/
│       ā”œā”€ā”€ index.js              # Barrel exports
│       ā”œā”€ā”€ site_config.json      # Site-wide configuration
│       ā”œā”€ā”€ profile.json          # Profile page data
│       ā”œā”€ā”€ tech_stack.json       # Skills and proficiencies
│       ā”œā”€ā”€ projects.json         # Featured projects
│       ā”œā”€ā”€ contributions.json    # Contribution heatmap data
│       └── dashboard/
│           ā”œā”€ā”€ metrics.json      # Overview metrics
│           ā”œā”€ā”€ traffic.json      # Traffic analytics (per-project)
│           ā”œā”€ā”€ errors.json       # Error logs
│           └── deployments.json  # Deployment status
ā”œā”€ā”€ routes/
│   ā”œā”€ā”€ +layout.svelte            # Root layout with nav & theme toggle
│   ā”œā”€ā”€ +layout.server.js         # Site config loader
│   ā”œā”€ā”€ +page.svelte              # Root redirect to /profile
│   ā”œā”€ā”€ profile/
│   │   ā”œā”€ā”€ +page.svelte          # Profile page UI
│   │   └── +page.server.js       # SSR data fetching
│   └── dashboard/
│       ā”œā”€ā”€ +page.svelte          # Dashboard page UI
│       └── +page.server.js       # SSR data fetching
ā”œā”€ā”€ styles/
│   └── global.css                # Theme variables, typography, utilities
└── app.html                      # HTML template with favicon & fonts

static/
ā”œā”€ā”€ icons/                        # App icons (PWA + favicon)
ā”œā”€ā”€ lib/apexcharts/               # ApexCharts library
ā”œā”€ā”€ manifest.json                 # PWA manifest
└── screenshots/                  # PWA screenshots

šŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or pnpm

Installation

# Clone the repository
git clone <repository-url>
cd my_test_project

# Install dependencies
npm install

# Start development server
npm run dev

The app will be available at http://localhost:5173

Build for Production

# Create production build
npm run build

# Preview production build
npm run preview

šŸŽØ Theming

The app supports Dark and Light themes with a toggle in the header.

Theme variables are defined in src/styles/global.css:

:root[data-theme="dark"] {
  --color-bg-primary: #0a0a0f;
  --color-accent: #f97316;
  /* ... */
}

:root[data-theme="light"] {
  --color-bg-primary: #f8fafc;
  --color-accent: #ea580c;
  /* ... */
}

Theme preference is persisted in localStorage.

šŸ“Š Data Configuration

All data is stored in JSON files under src/lib/data/. Keys follow snake_case convention.

Modifying Data

  1. Profile Info - Edit src/lib/data/profile.json
  2. Tech Stack - Edit src/lib/data/tech_stack.json
  3. Projects - Edit src/lib/data/projects.json
  4. Dashboard Metrics - Edit src/lib/data/dashboard/metrics.json
  5. Traffic Data - Edit src/lib/data/dashboard/traffic.json
  6. Error Logs - Edit src/lib/data/dashboard/errors.json
  7. Deployments - Edit src/lib/data/dashboard/deployments.json
  8. Site Config - Edit src/lib/data/site_config.json

šŸ“± PWA Features

  • Installable - Can be installed on desktop and mobile
  • Offline Support - Service worker caching (when deployed)
  • App Icons - Multiple sizes for all platforms
  • Theme Color - Matches app theme

šŸ›  Tech Stack

  • Framework: SvelteKit
  • Language: JavaScript (JSDoc for types)
  • Styling: CSS Variables, Global + Scoped CSS
  • Charts: ApexCharts
  • Fonts: DM Sans, Sora, JetBrains Mono
  • Icons: Custom SVG icons

šŸ“ Trade-offs & Decisions

Decision Rationale
SSR for Profile SEO optimization, faster first paint
CSR for Charts Heavy JS library, not critical for initial load
JSON mock data Simulates backend, easy to modify
ApexCharts (CDN) No npm dependency, loaded on-demand
CSS Variables Easy theming, consistent design tokens
Legacy Svelte syntax Better compatibility, familiar patterns

šŸ‘¤ Author

Amal B Nair
Senior Fullstack Web Developer
šŸ“§ amal004nair@gmail.com
šŸ”— LinkedIn | GitHub

šŸ“„ License

This project is for demonstration purposes.

Top categories

Loading Svelte Themes