A secure, real-time chat application with self-destructing rooms built using Next.js, TypeScript, and Upstash services.
- π Ephemeral Messaging: Chat rooms automatically destroy themselves after use
- β‘ Real-time Communication: Powered by Upstash Realtime
- π‘οΈ Anonymous Chat: No user registration required - temporary identities
- π± Responsive Design: Works seamlessly across all devices
- π¨ Modern UI: Clean, dark-themed interface with Tailwind CSS
- π¦ Type Safety: Full TypeScript support throughout
- β‘ Fast Performance: Optimized with Next.js 16 and React Server Components
- Frontend: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: React Query
- Real-time: Upstash Realtime
- Data Storage: Upstash Redis
- API Framework: Elysia.js
- Validation: Zod
- Node.js 18+ or Bun
- npm, yarn, pnpm, or bun package manager
- Upstash account (for Redis and Realtime services)
This project requires several environment variables to function properly. These variables configure connections to external services and control various aspects of the application.
- Upstash Redis - For storing chat room data and session information
- Upstash Realtime - For real-time messaging functionality
- Create a
.env.localfile in the project root directory - Add the following variables:
# Upstash Redis Configuration
UPSTASH_REDIS_REST_URL=your_redis_rest_url
UPSTASH_REDIS_REST_TOKEN=your_redis_rest_token
# Upstash Realtime Configuration
UPSTASH_REALTIME_URL=your_realtime_url
UPSTASH_REALTIME_TOKEN=your_realtime_token
# Application Settings
NEXT_PUBLIC_APP_URL=http://localhost:3000
ROOM_EXPIRY_TIME=3600 # Room expiry time in seconds- Sign up at Upstash Console
- Create a new Redis database
- Copy the REST URL and token from the database dashboard
- Add them to your environment variables as
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKEN
- In your Upstash console, navigate to the Realtime section
- Create a new Realtime database
- Copy the URL and token from the database dashboard
- Add them to your environment variables as
UPSTASH_REALTIME_URLandUPSTASH_REALTIME_TOKEN
Note: Never commit your
.env.localfile to version control. It's already included in the.gitignorefile.
-
Clone the repository
git clone https://github.com/x0lg0n/Real-Time-Ephemeral-Chat-System cd real-time-ephemeral-chat-system -
Install dependencies
# Using npm npm install # Using yarn yarn install # Using pnpm pnpm install # Using bun bun install
-
Environment Setup
Create a
.env.localfile in the root directory:# Upstash Redis Configuration UPSTASH_REDIS_REST_URL=your_redis_rest_url UPSTASH_REDIS_REST_TOKEN=your_redis_rest_token # Upstash Realtime Configuration UPSTASH_REALTIME_URL=your_realtime_url UPSTASH_REALTIME_TOKEN=your_realtime_token # Application Settings NEXT_PUBLIC_APP_URL=http://localhost:3000 ROOM_EXPIRY_TIME=3600 # Room expiry time in seconds
-
Run the development server
npm run dev # or yarn dev # or pnpm dev # or bun dev
-
Open your browser Navigate to http://localhost:3000
-
Create a Chat Room
- Visit the homepage
- Your temporary identity will be generated automatically
- Click "CREATE SECURE ROOM" to start a new chat session
-
Share the Room
- Copy the room URL and share it with participants
- Anyone with the link can join the chat
-
Chat Features
- Real-time messaging between participants
- Messages are encrypted in transit
- Room automatically expires after the set time period
- All messages are permanently deleted when the room expires
-
Room Expiry
- Rooms automatically self-destruct after the configured time
- All data is permanently removed from the system
- No data retention beyond room lifetime
real-time-ephemeral-chat-system/
βββ src/
β βββ app/ # Next.js app router
β β βββ api/ # API routes
β β βββ room/[roomId]/ # Room page
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # React components
β βββ hooks/ # Custom hooks
β βββ lib/ # Utility libraries
βββ public/ # Static assets
βββ elysia/ # API server (separate)
βββ README.md
βββ package.json
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
We welcome contributions from the community! Here's how you can help make this project better:
-
Fork the Repository
- Click the "Fork" button at the top right of this repository
- Clone your forked repository to your local machine
git clone
https://github.com/x0lg0n/real-time-ephemeral-chat-system.gitcd real-time-ephemeral-chat-system
-
Set Up Development Environment
- Install dependencies:
bun install - Create your
.env.localfile (see Environment Variables section) - Start the development server:
bun run dev
- Install dependencies:
-
Create a Feature Branch git checkout -b feature/your-feature-name Use descriptive branch names like:
feature/add-user-authenticationbugfix/fix-room-expiry-issueenhancement/improve-ui-components
Code Quality Standards:
- β Use TypeScript for all new code
- β Follow the existing ESLint configuration
- β Write clear, descriptive commit messages
- β Include tests for new functionality
- β Ensure all existing tests pass before submitting
Commit Message Format:
type(scope): brief description
Detailed explanation of changes (optional)
- Specific changes made
- Reason for changes
- Impact on functionality
Resolves: #issue-number (if applicable)
Commit Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or modifying testschore: Maintenance tasks
-
Before Pushing:
-
Run code quality checks
bun run lint bun run build
-
Ensure all tests pass
bun test
-
-
Push Your Changes:
git push origin feature/-your-feature-name
-
Create Pull Request:
- Go to your fork on GitHub
- Click "New Pull Request"
- Select your feature branch
- Provide a clear title and detailed description
- Link any related issues
Areas for Contribution:
- π Bug fixes and performance improvements
- β¨ New features and enhancements
- π Documentation improvements
- π¨ UI/UX enhancements
- π§ͺ Test coverage expansion
- π± Mobile responsiveness improvements
Good First Issues:
Check our GitHub Issues for issues labeled good first issue or help wanted.
- Be respectful and inclusive
- Provide constructive feedback
- Help others learn and grow
- Follow our Code of Conduct
- Ask questions in our Discussions
- Initial Review: Maintainers will review your PR within 48 hours
- Feedback: Address any requested changes
- Approval: Once approved, your PR will be merged
- Celebration: π Your contribution is now part of the project!
- Check our Documentation
- Join our Discord Community
- Create a GitHub Discussion
- Contact maintainers via email
Thank you for contributing to make this project amazing! π
- Use TypeScript for all new code
- Follow ESLint configuration
- Write meaningful commit messages
- Include tests for new functionality
- Ensure all existing tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
For support, questions, or feature requests:
- Create an issue in the GitHub Issues
- Contact the maintainer via email
- Next.js - React framework
- Upstash - Redis and Realtime services
- Tailwind CSS - Styling framework
- React Query - Server state management
- Elysia.js - API framework
Made with β€οΈ and β