Updated readme

This commit is contained in:
Christopher
2026-01-22 02:55:13 -08:00
parent 84b0651077
commit 6d0ad77031
+59 -70
View File
@@ -1,108 +1,97 @@
# Project Synapsis # Synapsis
An open-source, federated social network designed as global communication infrastructure. Synapsis is an open-source, federated social network built to serve as global communication infrastructure. It is designed to be lightweight, easy to deploy, and interoperable with the broader fediverse.
## Features ## Features
- **Federation**: ActivityPub-compatible, interoperable with Mastodon and other fediverse platforms - **Federation Ready**: Built with ActivityPub compatibility in mind (WebFinger, NodeInfo).
- **Global Identity**: Portable identity backed by DIDs - your handle works everywhere - **Identity**: Portable identity system backed by user handles.
- **Easy Deployment**: Deploy to Vercel with one click, no Docker or complex setup required - **Modern UI**: Clean, responsive interface inspired by Vercel's design system.
- **Modern UX**: Clean, Vercel-inspired dark theme with responsive design - **Rich Media**: Support for image uploads and media galleries.
- **Transparent Feeds**: Chronological and curated feeds with clear algorithms - **Moderation**: Built-in admin dashboard for user management and content moderation.
- **Moderation**: Admin dashboard for reports, post removals, and user actions - **Setup Wizard**: User-friendly `/install` flow to get your node running in minutes.
- **Curated Feeds**: Smart feed algorithms to highlight engaging content.
## Quick Start ## Tech Stack
- **Framework**: [Next.js 15+](https://nextjs.org/) (App Router)
- **Database**: PostgreSQL (via [Neon](https://neon.tech) / Drizzle ORM)
- **Styling**: Tailwind CSS v4 & custom Vercel-like design system
- **Authentication**: Auth.js (NextAuth)
- **Type Safety**: TypeScript
## Getting Started
### Prerequisites ### Prerequisites
- Node.js 18+ - Node.js 18+
- A Neon PostgreSQL database (free tier available at https://neon.tech) - A PostgreSQL database (e.g., [Neon](https://neon.tech))
- An Upstash Redis database (free tier available at https://upstash.com)
### Setup ### Installation
1. Clone the repository: 1. **Clone the repository**
```bash ```bash
git clone https://github.com/your-username/synapsis.git git clone https://github.com/cyph3rasi/Synapsis.git
cd synapsis cd Synapsis
``` ```
2. Install dependencies: 2. **Install dependencies**
```bash ```bash
npm install npm install
``` ```
3. Copy the environment example and configure: 3. **Configure Environment**
Copy the example environment file:
```bash ```bash
cp .env.example .env cp .env.example .env
``` ```
4. Update `.env` with your database credentials: Update `.env` with your credentials:
``` ```env
DATABASE_URL=postgresql://... # Database (PostgreSQL connection string)
UPSTASH_REDIS_REST_URL=https://... DATABASE_URL="postgresql://user:password@host/dbname..."
UPSTASH_REDIS_REST_TOKEN=...
AUTH_SECRET=generate-a-random-string
NEXT_PUBLIC_NODE_DOMAIN=your-domain.com
NEXT_PUBLIC_NODE_NAME=My Synapsis Node
ADMIN_EMAILS=comma,separated,emails
```
5. Run database migrations: # Auth (Generate with: openssl rand -base64 33)
AUTH_SECRET="your-secret-key"
# Node Configuration
NEXT_PUBLIC_NODE_DOMAIN="your-domain.com"
NEXT_PUBLIC_NODE_NAME="My Synapsis Node"
# Admin Access (Comma-separated emails)
ADMIN_EMAILS="admin@example.com,moderator@example.com"
```
4. **Initialize Database**
Push the schema to your database:
```bash ```bash
npm run db:push npm run db:push
``` ```
6. Start the development server: 5. **Start Development Server**
```bash ```bash
npm run dev npm run dev
``` ```
Visit `http://localhost:3000` to see your node.
### Deploy to Vercel ### Initial Setup
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/your-username/synapsis) 1. Go to `http://localhost:3000` (or your deployed URL).
2. You will be redirected to the **Setup Wizard** (`/install`) if the node is not configured.
3. Follow the wizard to verify your environment and database connection.
4. **Register your first account**.
5. Add your email to `ADMIN_EMAILS` in your `.env` file to grant yourself admin privileges.
6. Restart the server (if running locally) to apply the admin changes.
1. Click the button above ## Deployment
2. Connect your Neon PostgreSQL and Upstash Redis
3. Configure environment variables
4. Deploy!
## Architecture This project is optimized for deployment on **Vercel**.
- **Frontend**: Next.js 14+ with App Router 1. Push your code to a Git repository.
- **Backend**: Next.js API Routes (serverless) 2. Import the project into Vercel.
- **Database**: PostgreSQL via Neon 3. Add the required environment variables (`DATABASE_URL`, `AUTH_SECRET`, etc.) in the Vercel project settings.
- **Cache**: Redis via Upstash 4. Deploy.
- **Federation**: ActivityPub protocol
## API Endpoints
### Authentication
- `POST /api/auth/register` - Create account
- `POST /api/auth/login` - Login
- `POST /api/auth/logout` - Logout
- `GET /api/auth/me` - Get current user
### Posts
- `POST /api/posts` - Create a post
- `GET /api/posts` - Get feed
- `POST /api/posts/[id]/like` - Like a post
- `DELETE /api/posts/[id]/like` - Unlike a post
- `POST /api/posts/[id]/repost` - Repost
### Federation
- `GET /.well-known/webfinger` - WebFinger discovery
- `GET /.well-known/nodeinfo` - NodeInfo discovery
- `GET /nodeinfo/2.1` - Node metadata
- `GET /.well-known/synapsis-handles` - Handle registry export
- `POST /api/federation/handles` - Ingest handle registry from peers
- `POST /api/federation/gossip` - Pull registry from peer nodes (admin)
- `GET /api/handles/resolve` - Resolve handle to DID
### Installation
- `GET /install` - Setup wizard
- `GET /api/install/status` - Installation status
## License ## License
Apache 2.0 License - see LICENSE file for details. Licensed under the **Apache 2.0 License**. See [LICENSE](LICENSE) for details.