English | ζ₯ζ¬θͺ
Setsuna (εΉι£, meaning "moment" in Japanese) is a web application for real-time text sharing across devices.
Easily transfer text copied on your smartphone to your PC, or vice versa.
- Simple: Connect devices with a 6-character room code
- Real-time: Instant sync via Server-Sent Events (SSE)
- Secure: Room codes generated with cryptographically secure random numbers
- Ephemeral: Rooms auto-delete after 24 hours (privacy protection)
- Responsive: Works seamlessly on both mobile and desktop
- Dark Brutalist Design: Monospace fonts, thick borders, neon accents
- Internationalization: English and Japanese language support
- Admin Dashboard: Password-protected management interface for monitoring and cleanup
π Live Demo: https://setsuna-text.vercel.app
ββββββββββββββββββββββββββββββββββββββββββββ
β [EN][JA] β β Language Switcher
β Background: #0a0a0a β
β β
β SETSUNA_ β β White + green cursor
β [REAL-TIME TEXT SHARING] β β Gray, uppercase
β β
β Share a 6-character room code to β β Description text
β sync text across multiple devices β
β β
β ββββββββββββββββββββββββββββββββββββββ β
β β Create New Room β β β White border 2px
β β ββββββββββββββββββββββββββ β β
β β Create a room and share the code β β β Description
β β to access from another device β β
β β ββββββββββββββββββββββββββββββββ β β
β β β Create Room β β β β Green bg, black text
β β ββββββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββ or ββββββ β β Separator
β β
β ββββββββββββββββββββββββββββββββββββββ β
β β Join Existing Room β β
β β ββββββββββββββββββββββββββ β β
β β Room Code β β β Label
β β ββββββββββββββββββββββββββββββββ β β
β β β A B C D 2 3 β β β β Black bg, white border
β β ββββββββββββββββββββββββββββββββ β β
β β ββββββββββββββββββββββββββββββββ β β
β β β Join β β β β White bg, black text
β β ββββββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββ
| Category | Technology |
|---|---|
| Framework | Next.js 15 (App Router), React 19 |
| Language | TypeScript |
| Styling | Tailwind CSS |
| Database | Turso (SQLite compatible) |
| ORM | Prisma |
| Real-time | Server-Sent Events (SSE) |
| Testing | Vitest, Testing Library, Playwright |
| Linter/Format | ESLint 9, Prettier |
| Git Hooks | husky, lint-staged |
| Deployment | Vercel |
| i18n | next-intl |
- Node.js 20+
- npm 10+
# Clone the repository
git clone https://github.com/beagleworks/Setsuna.git
cd Setsuna
# Install dependencies
npm install
# Generate Prisma client
npx prisma generate
# Set up database (local SQLite)
npx prisma migrate devCopy .env.example to create .env:
cp .env.example .env| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
Local SQLite database path | Development |
TURSO_DATABASE_URL |
Turso database URL | Production |
TURSO_AUTH_TOKEN |
Turso authentication token | Production |
CRON_SECRET |
Secret for cron job authentication | Production |
ADMIN_PASSWORD |
Admin dashboard login password | Optional |
ADMIN_JWT_SECRET |
Secret key for JWT token signing | Required if using admin |
# Local development
DATABASE_URL="file:./dev.db"
# Admin dashboard (optional)
ADMIN_PASSWORD="your-password"
ADMIN_JWT_SECRET="your-jwt-secret"To generate a secure JWT secret:
openssl rand -base64 32TURSO_DATABASE_URL="libsql://your-db.turso.io"
TURSO_AUTH_TOKEN="your-token"
CRON_SECRET="your-secret"
# Admin dashboard
ADMIN_PASSWORD="your-secure-password"
ADMIN_JWT_SECRET="your-secure-jwt-secret"Note: If you want to use the admin dashboard (
/admin), bothADMIN_PASSWORDandADMIN_JWT_SECRETmust be set.
npm run devOpen http://localhost:3000 in your browser.
# Development server
npm run dev
# Build
npm run build
# Production server
npm run start
# Lint
npm run lint
npm run lint:fix
# Format
npm run format
npm run format:check
# Test
npm run test # Run all tests
npm run test:watch # Watch mode (for TDD)
npm run test:coverage # Coverage report
npm run test:e2e # E2E tests
# Database
npx prisma generate # Generate Prisma client
npx prisma migrate dev # Run migrations
npx prisma studio # Database GUISetsuna/
βββ docs/ # Documentation
β βββ SPEC.md # Full specification
β βββ API.md # API specification
β βββ DB.md # Database specification
β βββ UI.md # UI/UX specification
β βββ TEST.md # Test specification
βββ messages/ # i18n translation files
β βββ en.json # English
β βββ ja.json # Japanese
βββ prisma/
β βββ schema.prisma # DB schema
βββ src/
β βββ app/ # Next.js App Router
β β βββ [locale]/ # Locale-aware routes
β β β βββ page.tsx # Home page
β β β βββ room/[code]/ # Room page
β β βββ admin/ # Admin dashboard
β β β βββ page.tsx # Dashboard
β β β βββ login/ # Login page
β β β βββ rooms/ # Room management
β β βββ api/ # API routes
β βββ components/ # React components
β βββ i18n/ # i18n configuration
β βββ lib/ # Utilities
β βββ hooks/ # Custom hooks
β βββ types/ # Type definitions
βββ e2e/ # E2E tests
βββ middleware.ts # next-intl middleware
βββ ...config files
- Click "Create Room" on the home page
- A 6-character room code (e.g.,
ABCD23) will be generated - Enter this code on another device or share the URL
- Enter the room code on the home page
- Click "Join"
- Or navigate directly to
/room/ABCD23
- Enter text on the room page
- Click "Send" or press Ctrl+Enter
- Text is delivered to all participants in real-time
- Use the copy button to copy to clipboard
| Endpoint | Method | Description |
|---|---|---|
/api/rooms |
POST | Create room |
/api/rooms/[code] |
GET | Get room info |
/api/rooms/[code]/messages |
GET | Get messages |
/api/rooms/[code]/messages |
POST | Send message |
/api/sse/[code] |
GET | SSE connection |
/api/cleanup |
POST | Delete expired rooms |
/api/admin/auth/login |
POST | Admin login |
/api/admin/stats |
GET | Get statistics |
/api/admin/rooms |
GET | List rooms (admin) |
/api/admin/rooms/[code] |
DELETE | Delete room |
See the API Documentation for details.
This project follows TDD (Test-Driven Development).
Red β Green β Refactor
1. Write a failing test
2. Write minimal code to pass the test
3. Refactor the code
| Target | Approach |
|---|---|
src/lib/ |
TDD (test-first) |
src/app/api/ |
TDD (test-first) |
src/components/ |
Post-hoc testing |
| E2E | Post-hoc testing |
# Unit/Integration tests (35 tests)
npm run test
# E2E tests (14 tests)
npm run test:e2e
# Coverage report
npm run test:coverageSetsuna supports English and Japanese. Language switching is available via the UI.
| Language | URL Pattern |
|---|---|
| English | /en, /en/room/ABCD23 |
| Japanese | /ja, /ja/room/ABCD23 |
Translation files are located in the messages/ directory:
messages/
βββ en.json # English
βββ ja.json # Japanese
- Full Specification
- API Documentation
- Database Documentation
- UI/UX Documentation
- Test Documentation
- Changelog
MIT License