-
-
Notifications
You must be signed in to change notification settings - Fork 98
Add Nuxt example application #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
2chanhaeng
wants to merge
5
commits into
fedify-dev:main
Choose a base branch
from
2chanhaeng:pr/example-nuxt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9ff8b5f
Create examples/nuxt with Claude Opus 4.6
2chanhaeng afaa1f3
Replace `~~/server` to `#server`
2chanhaeng 7497859
Format files
2chanhaeng 0c6a7ad
Apply necessary reviews
2chanhaeng 4876c0b
Move `@nuxt/kit` to peerDependencies for efficiency in `@fedify/nuxt`
2chanhaeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.agents/skills/create-example-app-with-integration/example/public/theme.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| node_modules | ||
| dist | ||
| .output | ||
| .nuxt | ||
| .data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <!-- deno-fmt-ignore-file --> | ||
|
|
||
| Fedify-Nuxt integration example application | ||
| =========================================== | ||
|
|
||
| A comprehensive example of building a federated server application using | ||
| [Fedify] with [Nuxt]. This example demonstrates how to create an | ||
| ActivityPub-compatible federated social media server that can interact with | ||
| other federated platforms like [Mastodon], [Misskey], and other ActivityPub | ||
| implementations using the Fedify and [Nuxt]. | ||
|
|
||
| [Fedify]: https://fedify.dev | ||
| [Nuxt]: https://nuxt.com/ | ||
| [Mastodon]: https://mastodon.social/ | ||
| [Misskey]: https://misskey.io/ | ||
|
|
||
|
|
||
| Running the example | ||
| ------------------- | ||
|
|
||
| ~~~~ sh | ||
| pnpm dev | ||
| ~~~~ | ||
|
|
||
|
|
||
| Communicate with other federated servers | ||
| ---------------------------------------- | ||
|
|
||
| 1. Tunnel your local server to the internet using `fedify tunnel` | ||
|
|
||
| ~~~~ sh | ||
| fedify tunnel 3000 | ||
| ~~~~ | ||
|
|
||
| 2. Open the tunneled URL in your browser and check that the server is running | ||
| properly. | ||
|
|
||
| 3. Search your handle and follow from other federated servers such as | ||
| [Mastodon] or [Misskey]. | ||
|
|
||
| > [!NOTE] | ||
| > [ActivityPub Academy] is a great resource to learn how to interact | ||
| > with other federated servers using ActivityPub protocol. | ||
|
|
||
| [ActivityPub Academy]: https://www.activitypub.academy/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <template> | ||
| <NuxtPage /> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| useHead({ | ||
| link: [ | ||
| { rel: "stylesheet", href: "/style.css" }, | ||
| { rel: "icon", type: "image/svg+xml", href: "/fedify-logo.svg" }, | ||
| ], | ||
| script: [{ src: "/theme.js" }], | ||
| }); | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export default defineNuxtConfig({ | ||
| modules: ["@fedify/nuxt"], | ||
| fedify: { federationModule: "#server/federation" }, | ||
| ssr: true, | ||
| devServer: { host: "0.0.0.0" }, | ||
| vite: { server: { allowedHosts: true } }, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "nuxt-example", | ||
| "version": "0.0.1", | ||
| "private": true, | ||
| "type": "module", | ||
| "description": "Fedify app with Nuxt integration", | ||
| "scripts": { | ||
| "dev": "nuxt dev", | ||
| "build": "nuxt build", | ||
| "preview": "nuxt preview", | ||
| "start": "node .output/server/index.mjs" | ||
| }, | ||
| "dependencies": { | ||
| "@fedify/fedify": "workspace:^", | ||
| "@fedify/nuxt": "workspace:^", | ||
| "@fedify/vocab": "workspace:^", | ||
| "@logtape/logtape": "catalog:", | ||
| "nuxt": "catalog:", | ||
| "h3": "catalog:", | ||
| "vue": "^3.5.13", | ||
| "x-forwarded-fetch": "^0.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "typescript": "catalog:", | ||
| "@types/node": "catalog:" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Confirm
devServer.host: "0.0.0.0"andvite.server.allowedHosts: trueare only intended for this demo.Binding the dev server to all interfaces and disabling Vite's host-header allow-list is useful for tunneling (e.g., pinggy/localtunnel) during local federation testing, but it turns off a defence against DNS-rebinding-style attacks on the dev server. Since the test runner uses
pnpm startagainst the built Nitro output (not the Vite dev server), this only affects developers runningnuxt dev. Consider a brief comment in the config noting these options are intentional for tunnel-based federation demos and not recommended defaults for general Nuxt projects, so consumers who copy this file don't propagate the looser settings.🤖 Prompt for AI Agents