A secure, private, and self-destructing chat room application built with Next.js 16, Elysia, and Upstash.
- π Private Rooms: Generate unique, secure room links instantly.
- β±οΈ Self-Destructing: Rooms automatically expire and delete all data after 10 minutes.
- π₯ Capacity Limited: Rooms are limited to 2 participants for true private one-on-one conversations.
- β‘ Real-time Messaging: Instant chat powered by Upstash Realtime and Redis.
- π« No Trace: History and metadata are completely wiped upon room modification/destruction.
- π Modern UI: Clean, dark-themed interface built with Tailwind CSS v4.
- Framework: Next.js 16 (App Router)
- API Engine: Elysia (adapted for Next.js)
- Database: Upstash Redis
- Realtime: Upstash Realtime
- Type Safety: TypeScript & Zod
- Node.js 18+
- An Upstash account (Redis database required)
Create a .env file in the root directory with the following variables:
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
NEXT_PUBLIC_APP_URL=your_app_urlNote: The application uses
@upstash/redisand@upstash/realtime. Ensure your database is correctly configured.
-
Clone the repository:
git clone <repository-url> cd private_chat
-
Install dependencies:
npm install # or pnpm install # or bun install
-
Run the development server:
npm run dev # or bun dev -
Access the app: Open http://localhost:3000 in your browser.
- Lobby: Provides a button to create a new secure room.
- Room Creation: Generates a random room ID and initializes metadata in Redis with a 10-minute TTL (Time To Live).
- Joining: Users joining via the link are authenticated anonymously.
- Messaging: Messages are pushed to Redis and broadcasted via Upstash Realtime.
- Expiration: The room and all its contents are automatically evited from Redis after the TTL expires.
This project is licensed under the MIT License - see the LICENSE file for details.