Loading examples/sveltekit-sample/README.md +28 −14 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ But if you don't use proxy or tunnel, the handle is unnecessary. 1. Start the development server: ```bash npm run dev pnpm dev ``` 2. Access the demo user profile: Loading Loading @@ -195,21 +195,35 @@ federation ``` src/ ├── app.css # Global styles ├── app.d.ts # TypeScript app declarations ├── app.html # HTML template ├── hooks.server.ts # Server-side hooks ├── data/ │ └── store.ts # In-memory data storage ├── federation/ # Federation-related modules ├── lib/ │ ├── federation.ts # Main federation configuration │ ├── fetch.ts # Fetch utilities │ ├── handles.ts # Request handlers │ └── index.ts # Library exports │ ├── index.ts # Library exports │ ├── store.ts # In-memory data storage │ ├── types.ts # TypeScript type definitions │ ├── assets/ │ │ └── favicon.svg # Favicon asset │ └── components/ │ ├── Profile.svelte # Profile component │ └── Spinner.svelte # Loading spinner component └── routes/ ├── +layout.svelte # Layout component ├── +page.server.ts # Home page server logic ├── +page.svelte # Home page └── users/ └── [identifier]/ └── +page.svelte # User profile page ├── +page.server.ts # User profile server logic ├── +page.svelte # User profile page └── posts/ ├── +page.server.ts # User posts server logic ├── +page.svelte # User posts page └── [id]/ ├── +page.server.ts # Individual post server logic └── +page.svelte # Individual post page ``` 🚀 Deployment Loading @@ -221,7 +235,7 @@ src/ pnpm build ``` ### Deployment Considerations pnpm preview 1. **HTTPS Required**: ActivityPub requires HTTPS in production 2. **Domain Configuration**: Ensure proper domain setup for federation Loading @@ -235,7 +249,7 @@ pnpm build pnpm build # Preview the build pnpm dev pnpm preview # Or deploy to your preferred platform # (Vercel, Netlify, Docker, etc.) Loading @@ -248,7 +262,7 @@ This is a sample application demonstrating Fedify capabilities. Feel free to: - Experiment with the code - Add new features - Submit issues or suggestions - [Fedify GitHub Repository](https://github.com/fedify-dev/fedify) - Use as a starting point for your own federated applications 📄 License Loading @@ -262,4 +276,4 @@ This sample application follows the same license as the main Fedify project. - [Fedify Documentation](https://fedify.dev) - [SvelteKit Documentation](https://kit.svelte.dev/) - [ActivityPub Specification](https://www.w3.org/TR/activitypub/) - [Fedify GitHub Repository](https://github.com/dahlia/fedify) - [Fedify GitHub Repository](https://github.com/fedify-dev/fedify) examples/sveltekit-sample/package.json +4 −4 Original line number Diff line number Diff line Loading @@ -22,10 +22,6 @@ "dependencies": { "@fedify/fedify": "workspace:", "@fedify/sveltekit": "workspace:", "eslint-config-prettier": "^10.1.8", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.14", "x-forwarded-fetch": "^0.2.0" }, "devDependencies": { Loading @@ -36,8 +32,12 @@ "@sveltejs/vite-plugin-svelte": "^6.0.0", "@tailwindcss/vite": "^4.0.0", "eslint": "^9.18.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-svelte": "^3.0.0", "globals": "^16.0.0", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.14", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "tailwindcss": "^4.0.0", Loading examples/sveltekit-sample/src/lib/federation.ts +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ import { type Recipient, Undo, } from "@fedify/fedify"; import { keyPairsStore, relationStore } from "./store"; import { keyPairsStore, postStore, relationStore } from "./store"; const federation = createFederation({ kv: new MemoryKvStore(), Loading examples/sveltekit-sample/src/lib/store.ts +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class PostStore { } get = this.#get.bind(this); #getAll() { return this.#timeline.reverse() return this.#timeline.toReversed() .map((id) => id.toString()) .map((id) => this.#map.get(id)!) .filter((p) => p); Loading examples/sveltekit-sample/src/routes/users/[identifier]/posts/+page.server.ts +2 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ import { getPosts, getUser } from "$lib/fetch"; const post: Action = async (event) => { const data = await event.request.formData(); const content = data.get("content") as string; const identifier = data.get("identifier") as string; const content = data.get("content"); const identifier = data.get("identifier"); if (typeof content !== "string" || typeof identifier !== "string") { error(400, "Content and identifier are required"); Loading Loading
examples/sveltekit-sample/README.md +28 −14 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ But if you don't use proxy or tunnel, the handle is unnecessary. 1. Start the development server: ```bash npm run dev pnpm dev ``` 2. Access the demo user profile: Loading Loading @@ -195,21 +195,35 @@ federation ``` src/ ├── app.css # Global styles ├── app.d.ts # TypeScript app declarations ├── app.html # HTML template ├── hooks.server.ts # Server-side hooks ├── data/ │ └── store.ts # In-memory data storage ├── federation/ # Federation-related modules ├── lib/ │ ├── federation.ts # Main federation configuration │ ├── fetch.ts # Fetch utilities │ ├── handles.ts # Request handlers │ └── index.ts # Library exports │ ├── index.ts # Library exports │ ├── store.ts # In-memory data storage │ ├── types.ts # TypeScript type definitions │ ├── assets/ │ │ └── favicon.svg # Favicon asset │ └── components/ │ ├── Profile.svelte # Profile component │ └── Spinner.svelte # Loading spinner component └── routes/ ├── +layout.svelte # Layout component ├── +page.server.ts # Home page server logic ├── +page.svelte # Home page └── users/ └── [identifier]/ └── +page.svelte # User profile page ├── +page.server.ts # User profile server logic ├── +page.svelte # User profile page └── posts/ ├── +page.server.ts # User posts server logic ├── +page.svelte # User posts page └── [id]/ ├── +page.server.ts # Individual post server logic └── +page.svelte # Individual post page ``` 🚀 Deployment Loading @@ -221,7 +235,7 @@ src/ pnpm build ``` ### Deployment Considerations pnpm preview 1. **HTTPS Required**: ActivityPub requires HTTPS in production 2. **Domain Configuration**: Ensure proper domain setup for federation Loading @@ -235,7 +249,7 @@ pnpm build pnpm build # Preview the build pnpm dev pnpm preview # Or deploy to your preferred platform # (Vercel, Netlify, Docker, etc.) Loading @@ -248,7 +262,7 @@ This is a sample application demonstrating Fedify capabilities. Feel free to: - Experiment with the code - Add new features - Submit issues or suggestions - [Fedify GitHub Repository](https://github.com/fedify-dev/fedify) - Use as a starting point for your own federated applications 📄 License Loading @@ -262,4 +276,4 @@ This sample application follows the same license as the main Fedify project. - [Fedify Documentation](https://fedify.dev) - [SvelteKit Documentation](https://kit.svelte.dev/) - [ActivityPub Specification](https://www.w3.org/TR/activitypub/) - [Fedify GitHub Repository](https://github.com/dahlia/fedify) - [Fedify GitHub Repository](https://github.com/fedify-dev/fedify)
examples/sveltekit-sample/package.json +4 −4 Original line number Diff line number Diff line Loading @@ -22,10 +22,6 @@ "dependencies": { "@fedify/fedify": "workspace:", "@fedify/sveltekit": "workspace:", "eslint-config-prettier": "^10.1.8", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.14", "x-forwarded-fetch": "^0.2.0" }, "devDependencies": { Loading @@ -36,8 +32,12 @@ "@sveltejs/vite-plugin-svelte": "^6.0.0", "@tailwindcss/vite": "^4.0.0", "eslint": "^9.18.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-svelte": "^3.0.0", "globals": "^16.0.0", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.14", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "tailwindcss": "^4.0.0", Loading
examples/sveltekit-sample/src/lib/federation.ts +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ import { type Recipient, Undo, } from "@fedify/fedify"; import { keyPairsStore, relationStore } from "./store"; import { keyPairsStore, postStore, relationStore } from "./store"; const federation = createFederation({ kv: new MemoryKvStore(), Loading
examples/sveltekit-sample/src/lib/store.ts +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class PostStore { } get = this.#get.bind(this); #getAll() { return this.#timeline.reverse() return this.#timeline.toReversed() .map((id) => id.toString()) .map((id) => this.#map.get(id)!) .filter((p) => p); Loading
examples/sveltekit-sample/src/routes/users/[identifier]/posts/+page.server.ts +2 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,8 @@ import { getPosts, getUser } from "$lib/fetch"; const post: Action = async (event) => { const data = await event.request.formData(); const content = data.get("content") as string; const identifier = data.get("identifier") as string; const content = data.get("content"); const identifier = data.get("identifier"); if (typeof content !== "string" || typeof identifier !== "string") { error(400, "Content and identifier are required"); Loading