server

module
v0.0.0-...-58993a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: GPL-3.0

README

Shared Events Library (SEL)

The Shared Events Library (SEL) is the events storage and query component of Togather—a collaborative, community driven initiative to rebuild event discovery as shared civic infrastructure.

Project Vision

We are building a data commons for open events ecosystems. The goal is to coordinate three groups to adopt shared practices:

  1. Event Publishers (venues, organizers)
  2. Infrastructure Builders (developers, civic technologists)
  3. Application Creators (curators, AI devs)

This repository focuses on the Infrastructure layer: building shared, open tools instead of proprietary silos.

The Mission

We exist to rebuild event discovery as a public good where:

  • People discover events that matter to them without surveillance.
  • Organizers reach audiences directly without platform lock-in.
  • Communities coordinate themselves using shared infrastructure.
  • Developers build on open APIs and data standards.

The Problem

Events are scattered across platforms. Organizers post everywhere, reach no one. Communities miss what matters most.

The real issue: There is no lack of event data, but open access and expert, personalized curation are missing.

The Solution

We are creating an events commons using shared standards (Schema.org, ActivityPub) that everyone can build on.

What the SEL Does

The Shared Events Library (SEL) is a backend server that:

  • Ingests event data from any source using Schema.org Event markup
  • Validates events against JSON-LD schemas and SHACL shapes
  • Enriches events with linked open data from knowledge graphs (Artsdata, Wikidata, MusicBrainz)
  • Stores events in a queryable database with provenance tracking (preserving original source data)
  • Serves events via REST and GraphQL APIs with content negotiation (JSON-LD, JSON)
  • Federates using ActivityPub to sync with other SEL nodes and services

Each SEL instance typically serves a specific geographic area (city/region), acting as a public utility for event data in that community.

The Architecture

The larger ecosystem works in three layers:

  1. Data Publishing (Structured Metadata): Events are published on source websites using AI-assisted Schema.org markup.
  2. Shared Infrastructure (This Project): A distributed collection system and "Shared Event Library" that aggregates, validates, and serves this data as a public utility. SEL integrates with multiple knowledge graphs (Artsdata, Wikidata, MusicBrainz, etc.) to enrich events with linked open data, supporting both arts and non-arts events.
  3. Discovery Applications: Personal AI curators and apps that read from the commons to verify and recommend events to users locally.

Why This Matters

Events are the heartbeat of local culture. By building this shared infrastructure, we enable:

  • Cultural Vibrancy: Small, DIY, and community events become discoverable.
  • Privacy-First Discovery: Personal AI agents can find events for you without a central platform tracking your behavior.
  • Resilience: Cities can coordinate culture without depending on corporate platforms.

Who We Are

The Togather Foundation is a coordination point, not a platform owner. We provide reference implementations (like this library), documentation, and standards guidance. We do not own the data or monetize the community.


Getting Started: Using the API

The SEL API provides open access to event data and supports event submission from authenticated sources.

Reading Events (No Authentication Required)

Query public events:

curl https://toronto.togather.foundation/api/v1/events

Filter by date range:

curl "https://toronto.togather.foundation/api/v1/events?start_date=2026-03-01&end_date=2026-03-31"

Interactive API explorer:

Submitting Events (Requires API Key)

To submit or manage events, you need an API key. Two onboarding options:

Option 1: Self-Service via GitHub OAuth (Instant)

  1. Visit /dev/login and click "Sign in with GitHub"
  2. Authorize the app - your developer account is automatically created
  3. Navigate to /dev/api-keys and create your first API key

Option 2: Email Invitation (Email/Password)

  1. Request an invitation: Email info@togather.foundation with your name, email, and use case
  2. Accept your invitation: Check your email for the invitation link (valid for 7 days), set your password
  3. Create an API key: Log in to the developer portal at /dev/login, navigate to /dev/api-keys, and create a key
  4. Use your key: Include it in the Authorization: Bearer <key> header for write requests

Submit an event:

curl -X POST https://toronto.togather.foundation/api/v1/events \
     -H "Authorization: Bearer your_api_key_here" \
     -H "Content-Type: application/ld+json" \
     -d @event.json
Comprehensive Guides

AI Agent Integration (MCP)

The SEL server exposes a Model Context Protocol (MCP) endpoint, giving AI agents direct tool access to event data — no scraping or REST plumbing needed.

Endpoint
<your-node>/mcp   (streamable HTTP, API key required)

Get a free API key at /dev/login (GitHub OAuth, instant).

Available Tools
Tool Description
events List events with filters (date, location, keyword, category) or get a single event by ULID
add_event Submit a new event from JSON-LD (requires API key)
places List venues/locations with filters or get a single place by ULID
organizations List event organizers with filters or get a single organization by ULID
search Full-text search across events, places, and organizations
Claude Desktop Configuration
{
  "mcpServers": {
    "togather": {
      "type": "http",
      "url": "https://<your-node>/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Resources

Quick Start: Deploying SEL

New server: provision and install the base system (one-time).

./deploy/scripts/provision.sh deploy@server production --with-app

Existing server: deploy with zero downtime.

# Uses .deploy.conf.production when present
./deploy/scripts/deploy.sh production

Deploy specific version: ./deploy/scripts/deploy.sh production --version v1.2.3

Docs: DEPLOY.md · docs/deploy/quickstart.md · docs/deploy/remote-deployment.md

Local Development

git clone https://github.com/Togather-Foundation/server.git
cd server
make build
./server setup

Docs: docs/contributors/development.md · docs/contributors/postgresql-setup.md

Documentation & Contributor Resources

Thanks

This project is built with help from OpenCode, Spec Kit, and Beads, along with the teams behind:

  • ChatGPT 5.2 Codex
  • Claude Sonnet 4.5
  • Claude Opus 4.5
  • Gemini Pro 3

This README provides a high-level overview. Technical documentation can be found in the docs/ directory.

Directories

Path Synopsis
cmd
gentoken command
Test program to generate JWT tokens for testing
Test program to generate JWT tokens for testing
loadtest command
mcp-server command
server command
Package internal documents the shared event library server internals.
Package internal documents the shared event library server internals.
api
api/pagination
Package pagination provides cursor-based pagination for SEL API endpoints.
Package pagination provides cursor-based pagination for SEL API endpoints.
domain/developers
Package developers provides developer account management functionality including developer creation, authentication, invitation flows, and API key management.
Package developers provides developer account management functionality including developer creation, authentication, invitation flows, and API key management.
domain/scraper
Package scraper defines the domain types and interfaces for scraper source management.
Package scraper defines the domain types and interfaces for scraper source management.
domain/users
Package users provides user account management functionality including user creation, invitation flows, account activation, and user lifecycle operations.
Package users provides user account management functionality including user creation, invitation flows, account activation, and user lifecycle operations.
ical
Package ical provides ICS (RFC 5545) parsing, VEVENT-to-EventInput mapping, and RRULE expansion for the Togather scraper pipeline.
Package ical provides ICS (RFC 5545) parsing, VEVENT-to-EventInput mapping, and RRULE expansion for the Togather scraper pipeline.
jsonld/schema
Package schema provides typed Go structs for schema.org JSON-LD output.
Package schema provides typed Go structs for schema.org JSON-LD output.
kg
llmsafe
Package llmsafe provides shared LLM prompt-injection defense: boundary tagging with cryptographic nonces and HTML sanitization.
Package llmsafe provides shared LLM prompt-injection defense: boundary tagging with cryptographic nonces and HTML sanitization.
loadtest
Package performance provides load testing utilities for the Togather server.
Package performance provides load testing utilities for the Togather server.
mcp
Package mcp provides MCP (Model Context Protocol) server implementation for Togather SEL.
Package mcp provides MCP (Model Context Protocol) server implementation for Togather SEL.
sse
Package sse provides a Server-Sent Events broker that fans River job events out to N connected SSE clients.
Package sse provides a Server-Sent Events broker that fans River job events out to N connected SSE clients.
testauth
Package testauth provides authentication utilities for testing and development.
Package testauth provides authentication utilities for testing and development.
tests
integration_batch
Package integration_batch contains integration tests that require River job queue workers.
Package integration_batch contains integration tests that require River job queue workers.
testhelpers
Package testhelpers provides shared test utilities for integration, contract, and batch test packages.
Package testhelpers provides shared test utilities for integration, contract, and batch test packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL