Forráskód Böngészése

Updated documentation

Efren Yevale Varela 1 hónapja
szülő
commit
f2d8a2b015
3 módosított fájl, 222 hozzáadás és 20 törlés
  1. 156 0
      AGENTS.md
  2. 5 0
      LICENSE.md
  3. 61 20
      README.md

+ 156 - 0
AGENTS.md

@@ -0,0 +1,156 @@
+# AGENTS.md — testing-proxy
+
+## Project Overview
+
+- **Framework**: SvelteKit 2.63.0 with Svelte 5 (runes mode)
+- **Build Tool**: Vite 8.0.16
+- **Styling**: Tailwind CSS 4.3.0 (via `@tailwindcss/vite`)
+- **Component Library**: Flowbite Svelte 1.33.1 + Flowbite Icons
+- **Deployment Adapter**: `@sveltejs/adapter-node` (Node.js deployments)
+- **Package Manager**: pnpm (workspace support configured)
+- **Type System**: JavaScript with JSConfig (no TypeScript)
+
+## Critical Commands
+
+### Development & Build
+
+```bash
+# Start dev server (port 3000, with hot reload)
+npm run dev
+# or with browser auto-open:
+npm run dev -- --open
+
+# Production build (generates .svelte-kit, /build, and optimized JS/CSS)
+npm run build
+
+# Preview production build locally (runs on port 3000 by default)
+npm run preview
+
+# Sync SvelteKit config (auto-runs on `npm install`)
+npm run prepare
+```
+
+### No test/lint commands
+This is a fresh project with no test suite or linter configured. Do not assume these exist.
+
+## Architecture & Key Files
+
+### SvelteKit Project Structure
+
+```
+src/
+├── app.html           # HTML shell (dark mode preset, typo: "lass" not "class")
+├── routes/
+│   ├── +layout.svelte # Root layout component
+│   ├── +page.svelte   # Home page (uses Flowbite Alert)
+│   └── layout.css     # Route-level styles
+└── lib/
+    ├── index.js       # $lib alias exports (currently empty)
+    └── assets/        # Static assets
+```
+
+### Build Artifacts (gitignored)
+
+- `.svelte-kit/` — SvelteKit type hints & config cache
+- `/build/` — Production output (Node.js adapter)
+- `vite.config.js.timestamp-*` — Vite cache
+
+### Port Configuration
+
+- **Dev Server**: port 3000 (configured in `vite.config.js`)
+- **Preview Server**: port 3000 (default for `npm run preview`)
+
+## Svelte & SvelteKit Quirks
+
+### Runes Mode (Mandatory for this Project)
+
+All code must use Svelte 5 **runes** by default. The Vite config enforces this for all files **except** those in `node_modules`:
+
+```js
+runes: ({ filename }) => 
+  filename.split(/[/\\]/).includes('node_modules') ? undefined : true
+```
+
+**Effect on Component Writing:**
+- Use `$state()` instead of `let` for reactive variables
+- Use `$derived` for computed values
+- Use `$effect()` for side effects (replaces `onMount`, `afterUpdate`)
+- Snippets use `{#snippet name()}` syntax (shown in `+page.svelte`)
+
+**Action:** Any new `.svelte` files must use runes. Violating this breaks dev/build.
+
+### Tailwind CSS Integration
+
+- Configured via `@tailwindcss/vite` plugin (not `postcss`)
+- Plugins loaded: `@tailwindcss/forms`, `@tailwindcss/typography`
+- Dark mode: hardcoded in `app.html` (`class="dark"` on `<html>`)
+- No separate `tailwind.config.js` (handled entirely via Vite plugin)
+
+### SvelteKit Adapter
+
+- Using `@sveltejs/adapter-node` for Node.js deployments
+- Production build outputs to `/build/`
+- Environment: supports `$env` module for runtime env vars
+
+## Git & Workflow
+
+- **Branch**: master
+- **Commits**: Only one initial commit (`de93a8a`)
+- **Status**: Clean working tree (no staged/unstaged changes)
+
+**Note:** This is a fresh project. No established commit conventions yet.
+
+## Known Issues & Observations
+
+1. **HTML Typo**: `app.html` line 9 has `lass="bg-white dark:bg-gray-700"` (missing `c` in `class`)
+   - Should be: `class="bg-white dark:bg-gray-700"`
+   - Affects dark mode styling on body element
+
+2. **No CI/CD**: No `.github/workflows/` or other CI pipeline configured
+
+3. **No Tests**: No test framework or test scripts in `package.json`
+
+4. **Minimal jsconfig**: Inherits TypeScript config from `.svelte-kit/tsconfig.json` but doesn't enforce type checking (`checkJs: false`)
+
+## Common Agent Tasks & Gotchas
+
+### Adding Components
+
+- Use Flowbite Svelte components from `flowbite-svelte`
+- Wrap icons in `{#snippet}` blocks (Svelte 5 pattern)
+- All components must use runes for reactivity
+
+### Modifying Styles
+
+- Tailwind classes work directly in templates
+- No CSS Modules configured (use Svelte `<style>` blocks for scoped styles)
+- Dark mode available via `dark:` prefix (already enabled on root)
+
+### Creating New Routes
+
+- Add `+page.svelte` (and optionally `+page.js`, `+layout.svelte`) in `src/routes/[path]/`
+- SvelteKit filesystem routing is automatic
+- Server-side code goes in `+page.server.js` (not configured; would need adapter setup)
+
+### Environment Variables
+
+- Store in `.env` file (gitignored)
+- Reference via `import { env } from '$env/dynamic/public'` or `$env/static/public`
+- Prefix public vars with `VITE_` for client access
+
+## Performance Notes
+
+- Vite dev server is fast; rebuilds are near-instant
+- Production build with Adapter-Node is optimized for server deployments
+- No bundle analyzer configured; use Vite's built-in `--profile` if needed
+
+## External Resources
+
+- **SvelteKit Docs**: https://svelte.dev/docs/kit
+- **Flowbite Svelte**: https://flowbite-svelte.com/
+- **Tailwind CSS**: https://tailwindcss.com/docs
+- **Svelte 5 Runes**: https://svelte.dev/docs/svelte/what-are-runes
+
+---
+
+**Last Updated**: Initial creation for fresh SvelteKit project

+ 5 - 0
LICENSE.md

@@ -0,0 +1,5 @@
+Copyright 2026 Syavne.Net
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 61 - 20
README.md

@@ -1,42 +1,83 @@
-# sv
+# testing-proxy
 
-Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
+A modern SvelteKit application with Svelte 5 runes, Tailwind CSS, and Flowbite components.
 
-## Creating a project
+## Setup
 
-If you're seeing this, you've probably already done this step. Congrats!
+Install dependencies:
 
 ```sh
-# create a new project
-npx sv create my-app
+pnpm install
 ```
 
-To recreate this project with the same configuration:
+## Development
 
-```sh
-# recreate this project
-pnpm dlx sv@0.16.1 create --template minimal --no-types --install pnpm testing-proxy
-```
-
-## Developing
-
-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
+Start the dev server on http://localhost:3000:
 
 ```sh
 npm run dev
 
-# or start the server and open the app in a new browser tab
+# Auto-open in browser
 npm run dev -- --open
 ```
 
-## Building
+Hot module reload enabled by default.
+
+## Build & Deploy
 
-To create a production version of your app:
+Create a production build:
 
 ```sh
 npm run build
 ```
 
-You can preview the production build with `npm run preview`.
+Preview the production build locally:
+
+```sh
+npm run preview
+```
+
+Production output goes to `/build/` (configured for Node.js via `@sveltejs/adapter-node`).
+
+## Project Structure
+
+- `src/routes/` — SvelteKit filesystem routes
+- `src/lib/` — Reusable components and utilities (access via `$lib` alias)
+- `src/app.html` — HTML shell (dark mode enabled via `class="dark"`)
+
+## Tech Stack
+
+- **Framework**: SvelteKit 2.63.0 with Svelte 5 (runes mode)
+- **Styling**: Tailwind CSS 4.3.0 via `@tailwindcss/vite` + Forms/Typography plugins
+- **Components**: Flowbite Svelte 1.33.1 + Flowbite Icons
+- **Build Tool**: Vite 8.0.16
+- **Adapter**: Node.js (`@sveltejs/adapter-node`)
+
+## Important Notes
+
+### Svelte 5 Runes (Mandatory)
+
+All `.svelte` files use runes mode by default. Use:
+- `$state()` for reactive variables
+- `$derived` for computed values  
+- `$effect()` for side effects
+- `{#snippet}` for component snippets (e.g., icon slots)
+
+See [Svelte 5 runes documentation](https://svelte.dev/docs/svelte/what-are-runes).
+
+### Styling
+
+- Dark mode hardcoded in `app.html` (remove `class="dark"` from `<html>` to disable)
+- Use Tailwind utilities directly; no CSS Modules
+- Scoped styles available via `<style>` blocks in `.svelte` files
+
+### Known Issue
+
+`src/app.html` line 9 has a typo: `lass=` should be `class=`. This affects body element dark mode styling.
+
+## Links
 
-> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
+- [SvelteKit Documentation](https://svelte.dev/docs/kit)
+- [Flowbite Svelte](https://flowbite-svelte.com/)
+- [Tailwind CSS](https://tailwindcss.com/)
+- [Project Instructions](./AGENTS.md)