Skip to content

Repository files navigation

🦠 Amolestados - Open Source Anonymous Chat

A chaotic, ephemeral, and totally unhinged chat experience with a biohazard theme.

License: GPL v3 Vercel TypeScript Next.js

☣️ Digital Petri Dish - Where germs, viruses, and chaos meet in real-time conversation

🚀 Live Demo

amolestados.fun

Screenshot

✨ Features

  • 💬 Real-time messaging via WebSocket (Ably)
  • 🦠 Auto-generated pathogen names (Prion-Alpha, Bacilo-X99, etc.)
  • ✏️ Editable usernames - mutate your identity anytime
  • 📝 250 message history persisted in Redis
  • Smart rate limiting - prevents spam and abuse
  • 🚫 Configurable content filtering - block harmful terms
  • 🎨 Biohazard aesthetic - toxic green theme with particle effects
  • 📱 Mobile responsive - works on all devices
  • 🔒 Security hardened - CSP headers, XSS protection, rate limits
  • 💯 100% FREE - runs on free tiers of Vercel + Ably + Upstash

🏗️ Architecture

┌─────────────┐         ┌──────────────┐         ┌─────────────┐
│   Client    │◄───────►│    Ably      │◄───────►│   Client    │
│  (Browser)  │ WebSocket│  (WebSocket) │ WebSocket│  (Browser)  │
└─────────────┘         └──────────────┘         └─────────────┘
                                │
                                ▼
                        ┌──────────────┐
                        │  Next.js API │
                        │   Routes     │
                        └──────────────┘
                                │
                                ▼
                        ┌──────────────┐
                        │ Upstash      │
                        │ Redis        │
                        └──────────────┘

Technology Stack

  • Frontend: Next.js 15 + React 18 + TypeScript
  • Styling: CSS Modules + Google Fonts (Rubik Glitch, VT323, JetBrains Mono)
  • Realtime: Ably (WebSocket pub/sub)
  • Storage: Upstash Redis (message persistence)
  • Deploy: Vercel (serverless edge functions)

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+ or yarn/pnpm
  • Git

Installation

# Clone the repository
git clone https://github.com/aencyorganization/amolestados.git
cd amolestados

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env.local

# Edit .env.local with your API keys (see Configuration section)
nano .env.local

# Run development server
npm run dev

Open http://localhost:3000 in your browser.

⚙️ Configuration

1. Ably Account (WebSocket)

Ably provides the real-time WebSocket infrastructure.

  1. Sign up for a free account at ably.com
  2. Create a new application
  3. Navigate to Settings → API Keys
  4. Copy your root API key (format: APP_ID.KEY_ID:KEY_SECRET)

2. Upstash Account (Redis)

Upstash provides serverless Redis for message persistence.

  1. Sign up for a free account at upstash.com
  2. Create a new Redis database
  3. In the database details, copy:
    • UPSTASH_REDIS_REST_URL (e.g., https://apt-abc123.upstash.io)
    • UPSTASH_REDIS_REST_TOKEN

3. Environment Variables

Create a .env.local file in the project root:

# Required: Ably API Key for WebSocket
ABLY_API_KEY=your_ably_api_key_here

# Required: Upstash Redis credentials
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_token_here

# Optional: Custom blocked terms (comma-separated)
# Default: cp,csam,pedo
BLOCKED_TERMS=cp,csam,pedo,spam

⚠️ Never commit .env.local to git! It's already in .gitignore.

4. Deploy to Production

Option A: Vercel CLI

# Install Vercel CLI globally
npm install -g vercel

# Login to Vercel
vercel login

# Deploy to production
vercel --prod

Option B: Git Integration (Recommended)

  1. Push your code to GitHub
  2. Import the repository on vercel.com
  3. Add your environment variables in the Vercel dashboard
  4. Auto-deploy on every push to main branch!

5. Custom Domain

To use your own domain (e.g., amolestados.fun):

  1. In Vercel dashboard → Settings → Domains
  2. Add your domain
  3. Update DNS at your registrar:
    • Type: CNAME
    • Name: @ (or subdomain like chat)
    • Value: cname.vercel-dns.com
  4. SSL certificate is provisioned automatically

🛡️ Security

This project implements multiple security layers:

  • Content Security Policy (CSP) - Prevents XSS attacks
  • Rate Limiting - IP-based and client-based limits
  • Input Sanitization - All user input is escaped
  • XSS Headers - X-XSS-Protection, X-Frame-Options
  • Configurable Blocklist - Block harmful terms via env vars

See SECURITY.md for detailed security documentation.

🧪 Amolestados Terminology

We've gamified the entire experience with biological terms:

Traditional Amolestados
Chat Room Petri Dish
Users Hosts / Pathogens
Join Chat Infect
Leave Chat Neutralized
Change Username Mutate
Online Users Spreading
Moderation Immune System
Messages Viral Load
Rate Limit Incubation Period

🎨 Theme & Design

Color Palette

Color Hex Usage
Absolute Void #050705 Background
Mutation Green #39FF14 Primary, buttons, links
Necrotic Moss #153A15 Cards, secondary backgrounds
Biohazard Orange #FF4500 Alerts, errors, warnings
Prion Purple #8B00FF Accents, highlights
Spore White #D4E8D4 Text, content

Typography

  • Rubik Glitch - Logo and dramatic headings
  • VT323 - UI elements, buttons, labels
  • JetBrains Mono - Body text, chat messages

📝 API Documentation

Endpoints

POST /api/chat

Main chat operations endpoint.

Request Body:

{
  "type": "sendMessage", // or "getHistory", "rename"
  "clientId": "unique-client-id",
  "data": {
    "content": "Hello World!",
    "authorName": "Prion-Alpha-1234"
  }
}

Response:

{
  "success": true,
  "message": {
    "id": "1234567890-client-id",
    "authorId": "client-id",
    "authorName": "Prion-Alpha-1234",
    "content": "Hello World!",
    "timestamp": 1234567890,
    "type": "text"
  }
}

GET /api/ably/token?clientId=xxx

Generates an Ably token for WebSocket authentication.

Response:

{
  "keyName": "...",
  "timestamp": 1234567890,
  "nonce": "...",
  "mac": "..."
}

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit with clear messages (git commit -m 'Add amazing feature')
  5. Push to your fork (git push origin feature/amazing-feature)
  6. Open a Pull Request

Code Style

  • TypeScript: Strict mode enabled
  • ESLint: Follows Next.js recommended rules
  • Formatting: Use Prettier with default config
  • Commits: Follow conventional commits format

🐛 Troubleshooting

Common Issues

Build fails with "Cannot find module"

rm -rf node_modules package-lock.json
npm install

WebSocket connection fails

  • Check if ABLY_API_KEY is set correctly
  • Ensure your Ably app is active
  • Check browser console for CORS errors

Messages not persisting

  • Verify UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
  • Check Upstash dashboard for database status
  • Ensure Redis commands are within free tier limits

Rate limit errors

  • Normal behavior - wait 3 seconds between messages
  • IP-based limit: max 20 messages/minute

📊 Monitoring

Track your usage:

  • Vercel: Dashboard → Analytics
  • Ably: Dashboard → App → Stats
  • Upstash: Database → Metrics

📜 License

This project is licensed under the GNU General Public License v3.0

See LICENSE for the full license text.

🙏 Acknowledgments

  • Ably - For the excellent WebSocket infrastructure
  • Upstash - For serverless Redis
  • Vercel - For the seamless deployment platform
  • Google Fonts - Rubik Glitch, VT323, JetBrains Mono

⚠️ Disclaimer

This is an experimental project created for educational and entertainment purposes:

  • Messages are ephemeral (only last 250 kept)
  • No user accounts or persistent identity
  • No guarantee of message delivery
  • Use at your own risk
  • Not responsible for content posted by users

💬 Community


☣️ Zero Containment Laboratory ☣️
No germs were preserved in the making of this chat
Made with 💚 and radioactivity by the Amolestados team

About

Rede de comunicação anárquica simples!

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages