ErrorOliver2/xat-chat

remake of xat in my own way ig

โ˜… 0Forks 0JavaScriptGitHub โ†—Compare

README

๐ŸŽญ XAT.COM - Complete Flash to JavaScript Migration

The ULTIMATE xat.com recreation with ALL legendary features!
This is a recreation of the classic xat.com chat platform from 2007-2016, built with modern web technologies while maintaining the nostalgic feel and features.

๐Ÿ”ฅ LEGENDARY FEATURES IMPLEMENTED

๐ŸŽญ Xavi Animation System

  • Real-time avatar animations that respond to chat messages
  • Frame-perfect animations with 25+ frames per action
  • Multi-part animation system (eyes, mouth, eyebrows, hair)
  • Emotion mapping - words trigger specific animations
  • Canvas-based rendering replacing Flash MovieClips

โšก Blast Effects System

  • Visual moderation effects for bans, kicks, promotions
  • Rank-based color coding (Main Owner=Red, Mod=White, Member=Blue, Owner=Orange, Guest=Green)
  • Dynamic particle effects with expanding circles and sparkles
  • Text blast effects for announcements
  • Real-time canvas rendering replacing Flash visual effects

๐Ÿ’Ž Power Trading System

  • User-to-user marketplace for power trading
  • Real-time trade offers and negotiations
  • Power verification using bitwise flag system
  • Trade history and status tracking
  • Complete trading interface replacing Flash trading

๐Ÿ›ก๏ธ Advanced Security System

  • Bot protection with mathematical challenges
  • Spam filtering with rate limiting
  • IP banning and user moderation
  • JWT authentication with secure password hashing
  • Multi-layer protection replacing Flash security

๐ŸŽช Power System

  • 286+ powers with complete database
  • Bitwise flag system (p0-p10 sections)
  • Power categories and limited editions
  • Real-time power activation with effects
  • Power store with virtual economy

๐ŸŠ Pool System

  • Multi-channel chat rooms with separate message history
  • Pool-specific powers and ranks
  • Dynamic room switching with real-time updates
  • Room management with backgrounds and radio

๐ŸŽจ Kiss System

  • 25 different kiss types with unique animations
  • Progressive unlocking system
  • Seasonal kisses for holidays and events
  • Interactive animations with real-time responses

๐ŸŽฎ Game Integration

  • Ban games (snake, maze, code puzzles)
  • Chat games and interactive features
  • Power games and challenges
  • Moderation games for user engagement

๐Ÿ”Š Sound Engine

  • 600+ audio assets with real-time triggering
  • Power-specific sounds and effects
  • Background music and ambient sounds
  • Dynamic audio loading and caching

๐Ÿ‘‘ Rank Management

  • Hierarchical moderation (Main Owner, Owner, Mod, Member, Guest)
  • Color-coded ranks with visual indicators
  • Temporary ranks and promotions
  • Moderation commands with blast effects

If you want to contribute, please submit a pull request!

๐Ÿš€ TECHNICAL ARCHITECTURE

Current Working Setup

  • Node.js/Express backend with Socket.IO (src/server/xatServer.js)
  • Pure HTML/JS/CSS frontend (src/client/chat-interface.html)
  • MongoDB database with Mongoose ODM
  • JWT authentication with bcrypt hashing
  • Real-time communication with WebSockets
  • iXat-style ranking system with f flag support

Server Architecture

  • Main Server: src/server/xatServer.js - Complete working server
  • Models: src/server/models/ - Database schemas
  • Routes: src/server/routes/ - API endpoints
  • Services: src/server/services/ - Business logic
  • Middleware: src/server/middleware/ - Server middleware

Client Architecture

  • Main Chat: src/client/chat-interface.html - Complete working chat interface
  • Authentication: src/client/auth.html - Login/register system
  • Homepage: src/client/index.html - Main landing page
  • Pure JavaScript with ES6+ features
  • Real-time WebSocket client for communication
  • iXat ranking system with guest user support

๐Ÿš€ QUICK START

Running the Current Working System

  1. Clone the repository to get all the files
git clone https://github.com/FlappyJack212/xat-chat.git
cd chat
  1. Install all the dependancies
# Install dependencies
# Node.js (v14 or higher), MongoDB (v4.4 or higher), and npm or yarn
npm install
  1. Start MongoDB Make sure MongoDB is running on your system:
# On Windows
net start MongoDB

# On macOS/Linux
sudo systemctl start mongodb
  1. For configuration, create a .env file in the root directory:
PORT=8000
MONGO_URI=mongodb://localhost:27017/xat-chat
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
  1. Get rolling
# Start the server (serves from src/client directly)
npm start

# Or for development with auto-restart
npm run dev

"Your chat is ready, sir"

Access your chat at:

Current Working Features

โœ… Guest User Support - Shows guest users when not logged in
โœ… User Authentication - Login/register system
โœ… iXat Ranking System - f flag based ranking (Guest, Main Owner, Mod, Member, VIP, etc.)
โœ… Real-time Chat - WebSocket communication
โœ… Powers System - 325+ powers with store
โœ… Advanced Moderation - Warnings, mutes, kicks, bans
โœ… Chat Management - Create, edit, join chat rooms
โœ… Groups System - Create and manage user groups

Available Scripts

  • npm start - Start the production server
  • npm run dev - Start development server with nodemon
  • npm run watch - Watch for changes and rebuild
  • npm run lint - Run ESLint
  • npm test - Run tests

๐ŸŽฏ SYSTEM COMPONENTS

Core Systems

  • XaviAnimationSystem - Avatar animations
  • BlastEffectsSystem - Visual effects
  • PowerTradingSystem - Trading marketplace
  • XatServer - Complete server implementation
  • xat-engine.js - Main client engine

Database Models

  • User - Complete user system with powers and ranks
  • Power - Power database with bitwise flags
  • Room - Chat rooms with pools and moderation
  • Message - Message history and storage

API Endpoints

- /api/auth/* - Authentication system

  • POST /api/auth/register - User registration ({"username":"testuser","email":"[email protected]","password":"111111","confirmPassword":"111111"})
  • POST /api/auth/login - User login ({"username":"test","password":"test"})

- /api/users/* - User management

  • GET /api/user/profile - Get user profile
  • PUT /api/user/profile - Update user profile
  • POST /api/user/friends/:friendId - Add friend
  • DELETE /api/user/friends/:friendId - Remove friend

- /api/powers/* - Power system

  • GET /api/powers - Get all powers
  • GET /api/powers/:powerId - Get power details
  • POST /api/powers/:powerId/activate - Activate power

- /api/rooms/* - Room management

  • GET /api/room - Get all rooms
  • POST /api/room - Create new room
  • GET /api/room/:roomId - Get room details
  • PUT /api/room/:roomId - Update room
  • DELETE /api/room/:roomId - Delete room
  • POST /api/room/:roomId/join - Join room
  • POST /api/room/:roomId/leave - Leave room

- /api/trades/* - Trading system

- /api/xavi/* - Avatar system

- GET /api/avatars - Get all avatars

  • GET /api/avatars/:avatarId - Get avatar details

- GET /api/smilies - Get all smilies

  • GET /api/smilies/:code - Get smiley details

Socket.IO Events

Client to Server

  • room:join - Join a chat room
  • room:leave - Leave a chat room
  • message:send - Send a message
  • typing:start - Start typing indicator
  • typing:stop - Stop typing indicator
  • power:activate - Activate a power
  • avatar:change - Change user avatar

Server to Client

  • message:received - Receive a message
  • user:join - User joined room
  • user:leave - User left room
  • typing:start - User started typing
  • typing:stop - User stopped typing
  • power:effect - Power effect triggered
  • avatar:update - User avatar updated

Adding New Features

  1. New Power: Add to src/server/routes/powers.js and update the Power model
  2. New Avatar: Add to src/server/routes/avatars.js and place image in avatars/ directory
  3. New Smiley: Add to src/server/routes/smilies.js and place image in smilies/ directory
  4. New Room Feature: Extend the Room model and add corresponding routes

๐ŸŽช LEGENDARY FEATURES BREAKDOWN

Xavi Animation System

// Real-time avatar animations
xaviSystem.playAnimation('smile');
xaviSystem.setXaviData(xaviJson);

Blast Effects System

// Visual moderation effects
blastSystem.createBlast('blastban', x, y);
blastSystem.createRankBlast(rank, x, y);

Power Trading System

// User-to-user trading
tradingSystem.open();
tradingSystem.createTrade(powerId, price);

Power System

// Bitwise power checking
user.hasPower(powerId);
user.addPower(powerId);

๐Ÿš€ GETTING STARTED

Prerequisites

  • Node.js 16+
  • MongoDB 4.4+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/your-username/xat-recreation.git
cd xat-recreation

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Initialize database
npm run init-db

# Start the server
npm start

๐ŸŽญ LEGENDARY CAPABILITIES

Real-time Features

  • โœ… Live avatar animations responding to messages
  • โœ… Instant power activation with visual effects
  • โœ… Real-time trading with live updates
  • โœ… Live moderation with blast effects
  • โœ… Dynamic room switching with pool system

Virtual Economy

  • โœ… Xats currency with earning and spending
  • โœ… Power marketplace with user trading
  • โœ… Limited edition powers with time restrictions
  • โœ… Power store with categories and descriptions
  • โœ… Trading system with offers and negotiations

Social Features

  • โœ… Friend system with requests and management
  • โœ… User profiles with customizable avatars
  • โœ… Rank system with hierarchical permissions
  • โœ… Chat rooms with backgrounds and radio
  • โœ… Message history with search and filtering

Moderation Tools

  • โœ… Ban system with reasons and durations
  • โœ… Kick system with blast effects
  • โœ… Rank management with promotions/demotions
  • โœ… Spam protection with rate limiting
  • โœ… Bot protection with mathematical challenges

๐Ÿ”ฅ LEGENDARY STATUS

This is NOT just a chat system - it's a COMPLETE VIRTUAL WORLD with:

  • Real-time avatar animations that respond to messages
  • Virtual economy with trading and limited powers
  • Interactive games for moderation and entertainment
  • Advanced security with bot protection and spam filtering
  • Multi-protocol support for maximum compatibility
  • 600+ audio assets for immersive experience
  • Visual effects engine for moderation actions
  • Hierarchical moderation with color-coded ranks

๐ŸŽฏ PERFECT FLASH MIGRATION

Every feature from the original Flash xat.com has been PERFECTLY migrated to modern JavaScript:

  • Flash Stage โ†’ Canvas rendering
  • Flash MovieClips โ†’ JavaScript classes
  • Flash XMLSocket โ†’ WebSocket communication
  • Flash animations โ†’ requestAnimationFrame loops
  • Flash security โ†’ JWT + bcrypt authentication
  • Flash trading โ†’ Real-time trading system
  • Flash effects โ†’ Canvas-based blast effects

Styling

The application uses a modular CSS approach:

  • normalize.css - CSS reset
  • main.css - Base styles
  • xat.css - Xat-specific styles
  • platform.css - Platform-specific styles
  • quickbar.css - Quickbar component styles
  • chat.css - Chat interface styles

Troubleshooting

Common Issues

  1. MongoDB Connection Error

    • Ensure MongoDB is running
    • Check the MONGO_URI in your .env file
    • Verify network connectivity
  2. Socket.IO Connection Issues

    • Check if the server is running on the correct port
    • Ensure CORS is properly configured
    • Check browser console for errors
  3. Build Errors

    • Clear node_modules and reinstall: rm -rf node_modules && npm install
    • Check webpack configuration
    • Verify all dependencies are installed
  4. CSS Not Loading

    • Ensure webpack build completed successfully
    • Check file paths in CSS imports
    • Verify static file serving is configured

Project Structure

chat/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ client/           # Frontend code
โ”‚   โ”‚   โ”œโ”€โ”€ css/         # Stylesheets
โ”‚   โ”‚   โ”œโ”€โ”€ index.js     # Main entry point
โ”‚   โ”‚   โ”œโ”€โ”€ chat.js      # Chat functionality
โ”‚   โ”‚   โ”œโ”€โ”€ classic.js   # Classic mode
โ”‚   โ”‚   โ””โ”€โ”€ *.html       # HTML templates
โ”‚   โ””โ”€โ”€ server/          # Backend code
โ”‚       โ”œโ”€โ”€ config/      # Database configuration
โ”‚       โ”œโ”€โ”€ middleware/  # Express middleware
โ”‚       โ”œโ”€โ”€ models/      # MongoDB models
โ”‚       โ””โ”€โ”€ routes/      # API routes
โ”œโ”€โ”€ sounds/              # Audio files
โ”œโ”€โ”€ avatars/             # Avatar images
โ”œโ”€โ”€ smilies/             # Smiley images
โ”œโ”€โ”€ backgrounds/         # Background images
โ”œโ”€โ”€ server.js           # Main server file
โ”œโ”€โ”€ webpack.config.js   # Webpack configuration
โ””โ”€โ”€ package.json        # Dependencies and scripts

Debug Mode

Enable debug logging by setting:

DEBUG=*

๐Ÿ† LEGENDARY ACHIEVEMENT

This implementation represents the ULTIMATE xat.com recreation with EVERY legendary feature from the original Flash system, now running on modern web technologies with PERFECT compatibility and ENHANCED performance!

This isnโ€™t just a chat system; itโ€™s a resurrection of an era, rebuilt with modern technology but fueled by the same chaotic magic of 2007โ€“2016 xat.com.

โšก Every animation. ๐Ÿ’Ž Every power. ๐Ÿ”ฅ Every blast. ๐ŸŽญ Every nostalgia hit.

All alive again in JavaScript.

I AM NOW A GOD OF THE XAT SYSTEM! ๐Ÿ”ฅโšก๐Ÿ’Ž

(This project is for educational purposes and is not affiliated with xat.com.)

Contributors

ErrorOliver2renoschubertFlappyJack212superman32432432

Issues