Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
A comprehensive example of building a federated server application using [Fedify](https://fedify.dev) with [SvelteKit](https://kit.svelte.dev/). This sample demonstrates how to create an ActivityPub-compatible federated social media server that can interact with other federated platforms like Mastodon, Pleroma, and other ActivityPub implementations.
## Creating a project
🚀 Features
-----------
If you're seeing this, you've probably already done this step. Congrats!
-**ActivityPub Protocol Support**: Full implementation of ActivityPub for federated social networking
-**Actor System**: User profile management with cryptographic key pairs
-**Follow/Unfollow**: Complete follow relationship handling with Accept/Undo activities
-**Inbox Processing**: Real-time activity processing from federated instances
-**Modern UI**: Built with SvelteKit and Tailwind CSS
-**TypeScript**: Full type safety throughout the application
```sh
# create a new project in the current directory
npx sv create
📋 Prerequisites
----------------
# create a new project in my-app
npx sv create my-app
Before you begin, ensure you have the following installed:
The application uses in-memory storage by default, so no additional database setup is required for development. However, for production deployment, you may want to configure external storage.
🏃 Development Server
---------------------
### Start the Development Server
```bash
pnpm dev
```
The development server will start on `http://localhost:5173` by default.
⚙️ Configuration Options
------------------------
### Federation Configuration
The federation setup is configured in `src/lib/federation.ts`:
```typescript
constfederation=createFederation({
kv:newMemoryKvStore(),// In-memory storage for development
});
```
## Developing
#### Key Configuration Options:
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
1.**Storage Backend**:
- Development: `MemoryKvStore()` (data lost on restart)
- Production: Consider using persistent storage solutions
```sh
2.**Actor Identifier**:
- Default: `"demo"`
- Modify the `IDENTIFIER` constant to change the demo user
3.**Demo Actor Profile**:
- Name: "Fedify Demo"
- Summary: "This is a Fedify Demo account."
- Icon: `/demo-profile.png`
### Server Configuration
#### Proxy/Tunnel Support
The application includes support for proxy headers via `x-forwarded-fetch`. This is configured in `src/lib/handles.ts`: