T005-T006

This commit is contained in:
2025-09-18 10:04:43 -06:00
parent 8e82274d30
commit 28f8907259
16 changed files with 2748 additions and 2 deletions

View File

@@ -1,3 +1,13 @@
# GlowTrack Web (SvelteKit)
Minimal scaffold created for T005.
Scripts:
- pnpm dev — start dev server
- pnpm build — build static site (adapter-static)
- pnpm preview — preview built site
After T006/T007, Tailwind and tests will be wired.
# GlowTrack Web App
Placeholder for SvelteKit PWA app. See specs in `specs/001-glowtrack-a-mood/`.

31
apps/web/package.json Normal file
View File

@@ -0,0 +1,31 @@
{
"name": "@glowtrack/web",
"private": true,
"version": "0.0.0",
"type": "module",
"description": "GlowTrack SvelteKit web app (adapter-static)",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"test": "echo \"No unit tests yet (see T007)\" && exit 0",
"test:e2e": "echo \"No e2e tests yet (see T007, T012T015)\" && exit 0"
},
"dependencies": {
"svelte": "^4.2.18"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"svelte-preprocess": "^5.1.4",
"tailwindcss": "^3.4.14",
"@tailwindcss/forms": "^0.5.9",
"svelte": "^4.2.18",
"typescript": "^5.5.4",
"vite": "^5.1.0"
}
}

View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

42
apps/web/src/app.css Normal file
View File

@@ -0,0 +1,42 @@
:root {
--bg: #0b0b10;
--fg: #e5e7eb;
--muted: #9ca3af;
color-scheme: dark;
}
html, body, #svelte {
height: 100%;
}
body {
margin: 0;
font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
background: var(--bg);
color: var(--fg);
}
a { color: inherit; }
.container {
max-width: 960px;
padding: 1rem;
margin: 0 auto;
}
.grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 6px;
}
.tile {
aspect-ratio: 1 / 1;
border-radius: 6px;
background: #111827;
box-shadow: 0 0 10px rgba(56, 189, 248, 0.15) inset;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

11
apps/web/src/app.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}
export {};

12
apps/web/src/app.html Normal file
View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<script lang="ts">
import '../app.css';
</script>
<svelte:head>
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#0b0b10" />
<title>GlowTrack</title>
</svelte:head>
<div class="min-h-dvh bg-zinc-950 text-zinc-100">
<slot />
</div>

View File

@@ -0,0 +1,13 @@
<script lang="ts">
const days = Array.from({ length: 35 });
</script>
<main class="container">
<h1>GlowTrack</h1>
<p class="muted">Mood & Habit wellbeing grid — SvelteKit scaffold.</p>
<section class="grid" aria-label="demo grid">
{#each days as _, i}
<div class="tile" aria-label={`day ${i + 1}`} />
{/each}
</section>
</main>

View File

View File

@@ -0,0 +1,20 @@
{
"name": "GlowTrack",
"short_name": "GlowTrack",
"start_url": "/",
"display": "standalone",
"background_color": "#0b0b10",
"theme_color": "#0b0b10",
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

18
apps/web/svelte.config.js Normal file
View File

@@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-static';
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: preprocess({ postcss: true }),
kit: {
adapter: adapter({
fallback: '200.html'
}),
// Service worker wiring comes in T008
paths: {
// supports GitHub Pages-like hosting later; keep default for now
}
}
};
export default config;

View File

@@ -0,0 +1,10 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/**/*.{html,js,svelte,ts}',
],
theme: {
extend: {},
},
plugins: [require('@tailwindcss/forms')],
};

19
apps/web/tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"noEmit": true,
"baseUrl": ".",
"types": ["svelte", "vite/client", "@sveltejs/kit"],
"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"]
}
},
"include": ["src/**/*", "vite.config.ts", "svelte.config.js"],
"exclude": ["node_modules", "dist", "build", ".svelte-kit"]
}

6
apps/web/vite.config.ts Normal file
View File

@@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
});