Skip to content

tnychn/wysper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WYSPER

A minimal mobile-first, invite-only, real-time anonymous chat web application.

Hosting on https://wysper.tnychn.dev on a Raspberry Pi 4B with Alpine Linux via Cloudflare Tunnel.

Features

  • invite-code-based registration using 6-character alphanumeric codes
  • access-controlled registration restricted to CUHK network and night hours
  • toggleable hidden messages for unauthenticated users
  • emoji reactions with client-side optimistic updates
  • rate-limited API with bot protection via Cloudflare Turnstile
  • real-time message & reaction broadcasting with WebSocket API
  • live online presence tracking via WebSocket connections
  • neobrutalist design inspired user interface
  • mobile-first neobrutalist design inspired user interface

Tech Stack

Backend

Go 1.26

Server

Database

  • modernc.org/sqlite as SQLite driver
  • sqlc for type-safe SQL query generation

Security

  • github.com/golang-jwt/jwt for JWT-based authentication
  • github.com/go-playground/validator request data validation
  • argon2id for password hashing

Frontend

TypeScript 6

Frameworks

  • Solid.js for reactive user interface
  • Tailwind 4 for styling

Tools

  • npm for package management
  • vite for bundling and development server
  • oxlint/oxfmt for code formatting and linting

Configuration

The server is configured via the following environment variables.

Variable Required Default Description
HOST No 0.0.0.0 server bind host
PORT No 6969 server bind port
URL No frontend URL for CORS (development only)
DATABASE No :memory: SQLite file path (e.g. data.db)
AUTH_SECRET_KEY Yes JWT signing secret
TURNSTILE_SECRET_KEY Yes Cloudflare Turnstile secret key

Development

Backend:

cd server
go run . -debug

The -debug flag bypasses CUHK network and time restrictions, and enables CORS and logging.

Frontend:

cd web
npm install
npm run dev

Production Build

./build.sh

This script:

  1. Builds the frontend SPA.
  2. Embeds the SPA bundle into the Go binary via the web build tag.
  3. Produces a single self-contained binary named start.

Database Seeding

server/repository/seed.sql creates a root user and the initial invite code TNYCHN to bootstrap access on the first server run.


~ crafted with ♥︎ by tnychn ~
MIT © 2026 Tony Chan

About

Mobile-first, invite-only, real-time anonymous chat with hidden messages, online presence, emoji reactions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors