Skip to content

billu-beep/PingUp

Β 
Β 

Repository files navigation

🟒 PingUp β€” Real-Time Community Chat Platform

A Discord-inspired, full-stack real-time chat platform for modern communities. Channels, direct messaging, voice/music lounges, role-based moderation, and a full admin panel β€” all in one app.

React Node.js Socket.io MongoDB Express License


πŸ”— Repositories

Part Repository
πŸ–₯️ Frontend github.com/sabeenaviklar/PingUp-Frontend
βš™οΈ Backend github.com/sabeenaviklar/PingUp-Backend

πŸ’‘ What is PingUp?

PingUp is a real-time community chat platform that brings people together through organized channels, direct messaging, and shared music experiences. It was built from scratch using React, Node.js, Socket.IO, and MongoDB.

Think of it as a lightweight, self-hostable Discord β€” with a clean forest-green aesthetic, a Stranger Things music lounge, and a powerful owner panel to manage your community in real time.


✨ Feature Overview

πŸ’¬ Real-Time Messaging

  • Instant messages delivered via WebSockets (Socket.IO) β€” zero page refreshes
  • Live typing indicators with animated bouncing dots
  • Message pinning β€” moderators can pin important messages, visible at the top of every channel
  • Soft message deletion β€” deleted messages show [message deleted] rather than disappearing
  • Auto-scroll to latest message on new activity

πŸ—‚οΈ Channel & Category System

  • Channels are organized inside collapsible categories (exactly like Discord)
  • Owners can create, delete, and rename channels and categories live β€” all users see updates instantly
  • Each channel supports a custom emoji and description
  • Per-channel toggleable settings:
    • πŸ”‡ Read-only β€” only owners can send messages
    • πŸ”’ Locked β€” no one can send messages
    • πŸ‘οΈ Private β€” only specific users can see and join
  • Channel status badges displayed in the header and sidebar

🎡 Music Lounge (Voice Channel)

  • A special Stranger Things themed music lounge channel
  • Built-in YouTube-powered audio player β€” no API key required
  • Playlist of 5 tracks:
    • πŸŒ€ Stranger Things β€” Main Theme (Kyle Dixon & Michael Stein)
    • πŸ”΄ Running Up That Hill (Kate Bush)
    • ⚑ Should I Stay or Should I Go (The Clash)
    • 🌊 Every Breath You Take (The Police)
    • πŸ”₯ Master of Puppets (Metallica)
  • Discord-style lobby screen before joining β€” shows who's listening
  • Animated spinning album art with per-track colour theming
  • Real-time listening members panel with sound wave animations
  • Previous / Stop / Next controls + volume slider + mute toggle

πŸ‘€ Role-Based Permissions

PingUp has a strict 3-tier role system:

Role Badge Capabilities
πŸ‘‘ Owner Gold Everything β€” full server control
πŸ›‘οΈ Moderator Teal Delete/pin messages, kick members
πŸ‘€ Member Grey Send messages, read channels
  • The first user to register is automatically made Owner
  • Roles are enforced server-side β€” the client UI only reflects server decisions
  • Role-coloured avatars, username colours, and pills throughout the entire UI

πŸ“¨ Direct Messages (DMs)

  • Private 1-on-1 conversations between any users
  • Persistent message history stored in MongoDB
  • Unread message badges on the DM list
  • Toast pop-up notifications for incoming DMs while in a channel
  • Live typing indicators in DM conversations
  • Click any username in the member panel to open a DM

πŸ›‘οΈ Admin Panel

  • Full server statistics: total users, online count, messages, channels
  • User management table: see all users, change roles, kick, or ban
  • Channel management: create/delete channels, toggle read-only/lock/private
  • All changes take effect instantly across all connected clients

⌨️ Slash Commands

Type /help in any channel for a full command list:

Command Who What it does
/help All Show all commands
/online All List currently online users
/whoami All Show your profile details
/rooms All List all channels and their status
/kick <username> Mod+ Kick a user from the server
/pin <messageId> Mod+ Pin or unpin a message
/delete <messageId> Mod+ Delete a message
/promote <user> <role> Owner Set a user's role
/ban <username> Owner Permanently ban a user
/reroll <username> Owner Randomly re-assign a user's role
/newchannel <cat> <name> Owner Create a new channel in a category
/delchannel <name> Owner Delete a channel
/renamechannel <old> <new> Owner Rename a channel
/newcategory <name> Owner Create a new category
/readonly <channel> Owner Toggle read-only on a channel
/lock <channel> Owner Toggle lock on a channel
/private <channel> Owner Toggle private on a channel
/clear Owner Wipe all messages in the current channel
/stats Owner View server statistics

πŸ—οΈ Tech Stack

Layer Technology Why
Frontend React 18 + Vite Fast, component-based UI with HMR
Styling Pure CSS3 (custom design system) Full control, no utility class bloat
Backend Node.js + Express.js Lightweight, fast REST API
Real-time Socket.IO 4.x Bi-directional WebSocket events
Database MongoDB + Mongoose Flexible schema for messages/users
Auth JWT (JSON Web Tokens) Stateless, scalable authentication
Audio YouTube iFrame embed No API key, browser-native playback

πŸ—‚οΈ Project Structure

PingUp/
β”‚
β”œβ”€β”€ PingUp-Frontend/               # React + Vite client
β”‚   β”œβ”€β”€ public/
β”‚   └── src/
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ DMSidebar.jsx      # Left sidebar β€” channels, categories, user bar
β”‚       β”‚   β”œβ”€β”€ MessageList.jsx    # Chat message feed with pinning/deletion
β”‚       β”‚   β”œβ”€β”€ MessageInput.jsx   # Message compose bar with typing events
β”‚       β”‚   β”œβ”€β”€ UserPanel.jsx      # Right sidebar β€” member list with roles
β”‚       β”‚   β”œβ”€β”€ VoiceChannel.jsx   # Stranger Things music lounge player
β”‚       β”‚   β”œβ”€β”€ DMChat.jsx         # Direct message chat window
β”‚       β”‚   β”œβ”€β”€ DMList.jsx         # DM conversation list panel
β”‚       β”‚   β”œβ”€β”€ AdminPanel.jsx     # Owner admin dashboard
β”‚       β”‚   β”œβ”€β”€ FriendsPanel.jsx   # Friends & online users view
β”‚       β”‚   β”œβ”€β”€ ProfileModal.jsx   # User profile edit modal
β”‚       β”‚   β”œβ”€β”€ Login.jsx          # Login page
β”‚       β”‚   └── Register.jsx       # Registration page
β”‚       β”œβ”€β”€ App.jsx                # Root component β€” socket wiring, routing logic
β”‚       β”œβ”€β”€ socket.js              # Socket.IO client singleton
β”‚       β”œβ”€β”€ index.css              # Full design system (CSS variables + all styles)
β”‚       └── main.jsx               # React entry point
β”‚
└── PingUp-Backend/                # Node.js + Express server
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ User.js                # User schema: role, banned, online, loginCount
    β”‚   β”œβ”€β”€ Room.js                # Channel schema: isPrivate, isReadOnly, isLocked, isVoice
    β”‚   β”œβ”€β”€ Message.js             # Message schema: pinned, deleted, roomName
    β”‚   └── DirectMessage.js       # DM schema: conversationId, read, participants
    β”œβ”€β”€ middleware/
    β”‚   └── auth.js                # JWT sign/verify + socket auth middleware
    β”œβ”€β”€ server.js                  # Main file: Express routes + Socket.IO handlers
    β”œβ”€β”€ .env                       # Environment variables (not committed)
    └── package.json

⚑ Setup & Installation

Prerequisites

Make sure you have the following installed:


Step 1 β€” Clone Both Repositories

Open your terminal and run:

# Clone the frontend
git clone https://github.com/sabeenaviklar/PingUp-Frontend.git

# Clone the backend
git clone https://github.com/sabeenaviklar/PingUp-Backend.git

You'll now have two folders: PingUp-Frontend/ and PingUp-Backend/


Step 2 β€” Set Up MongoDB Atlas

  1. Go to mongodb.com/atlas and sign in
  2. Create a free cluster (M0 tier)
  3. Under Database Access β†’ Add a new database user with username & password
  4. Under Network Access β†’ Add 0.0.0.0/0 (allow all IPs) for development
  5. Click Connect β†’ Connect your application β†’ Copy the connection string

It will look like:

mongodb+srv://youruser:yourpassword@cluster0.xxxxx.mongodb.net/pingup

Step 3 β€” Configure the Backend

cd PingUp-Backend
npm install

Create a .env file in the PingUp-Backend/ folder by copying the example:

# PingUp-Backend/.env (copy from .env.example)
cp .env.example .env

Then set your real values in PingUp-Backend/.env:

  • MONGO_URI: your MongoDB Atlas connection string
  • JWT_SECRET: a strong, unique secret (rotate if it was ever exposed)
  • PORT: server port (e.g. 3001)

⚠️ Never commit .env to GitHub. This repo includes PingUp-Backend/.env.example with placeholder values.

⚠️ Never commit .env to GitHub. Make sure it's in your .gitignore.

Start the backend server:

npm run dev OR node server.js

You should see:

βœ… MongoDB connected
βœ… Default rooms seeded
πŸš€ Server on http://localhost:3001

Step 4 β€” Configure the Frontend

Open a new terminal window, then:

cd PingUp-Frontend
npm install

Create a .env file in the PingUp-Frontend/ folder:

# PingUp-Frontend/.env

VITE_API_URL=http://localhost:3001
VITE_SOCKET_URL=http://localhost:3001

Start the frontend:

npm run dev

You should see:

  VITE v5.x.x  ready in xxx ms
  ➜  Local:   http://localhost:5173/

Step 5 β€” Open PingUp

  1. Open http://localhost:5173 in your browser
  2. Click Register and create your first account
    • βœ… The first user to register is automatically made Owner
  3. Open a second browser tab or incognito window and register another user
    • This user will be a Member
  4. You can now chat between the two accounts in real time!

Step 6 β€” Test All Features

Feature How to test
Real-time chat Send messages from two different browser windows
Typing indicator Start typing in one window β€” see it appear in the other
Owner panel Log in as the first user β†’ click Admin Panel in the sidebar
Music lounge Click #music-lounge in the sidebar β†’ Join Lounge β†’ pick a track
Direct messages Click any online user in the right panel β†’ start a DM
Slash commands Type /help in any channel
Channel settings As owner, click the πŸ”‡ πŸ”’ πŸ‘οΈ buttons in the channel header
Role management Admin Panel β†’ Users β†’ change a user's role

πŸ”Œ API Reference

REST Endpoints

Method Endpoint Auth Description
POST /api/register ❌ Register new user
POST /api/login ❌ Login, receive JWT token
GET /api/structure βœ… JWT Get categories + channels
GET /api/rooms ❌ Get all rooms (legacy)
GET /api/users βœ… Mod+ Get all users
PUT /api/profile βœ… JWT Update profile info
GET /api/dm/:otherUserId βœ… JWT Get DM history
GET /api/dm βœ… JWT Get all DM conversations

Key Socket.IO Events

Client β†’ Server:

channel:join          { channelId }
message:send          { channelId, text }
typing:start          { channelId }
typing:stop           { channelId }
message:pin           { channelId, messageId }
message:delete        { channelId, messageId }
channel:create        { categoryId, name, emoji, description }
channel:delete        { channelId }
channel:toggleReadOnly { channelId }
channel:toggleLock    { channelId }
channel:togglePrivate { channelId }
category:create       { name }
category:delete       { categoryId }
user:setrole          { targetId, role }
user:kick             { targetId }
user:ban              { targetId }
voice:join            { channelId }
voice:leave           { channelId }
dm:join               { otherUserId }
dm:send               { toUserId, text }

Server β†’ Client:

structure:update      β†’ full category/channel tree refreshed
users:update          β†’ online users list changed
channel:history       β†’ message history for joined channel
message:new           β†’ new message arrived
message:deleted       β†’ message was deleted
message:pinned        β†’ message was pinned
message:unpinned      β†’ message was unpinned
room:settings         β†’ channel settings changed
room:notification     β†’ system message (join/leave/kick/etc.)
typing:update         β†’ typing status changed
role:updated          β†’ your own role was changed
kicked                β†’ you were kicked or banned
voice:joined          β†’ someone joined the voice channel
voice:left            β†’ someone left the voice channel
voice:members         β†’ current voice members list
dm:message            β†’ new direct message received
dm:notification       β†’ toast notification for new DM

πŸ” Security

  • Passwords hashed with bcrypt (10 salt rounds) β€” never stored in plain text
  • All protected routes require a valid JWT Bearer token in the Authorization header
  • Every Socket.IO connection is authenticated via JWT middleware at connection time
  • Banned users are rejected at both the REST API and WebSocket level
  • All permission checks (kick, ban, promote, toggle channel settings) are enforced server-side only β€” the client UI is cosmetic and cannot bypass server rules
  • Private channel access verified on every channel:join event

🎨 Design System

PingUp uses a custom forest/sage green dark theme built entirely in CSS variables:

--bg-primary: #1a2a22 /* Deep forest background */ --bg-secondary: #1e2f26
  /* Sidebar backgrounds */ --bg-elevated: #243322
  /* Cards, inputs, elevated surfaces */ --accent: #4a9e8e
  /* Teal green β€” buttons, active states */ --accent-hover: #5ab5a4
  /* Accent on hover */ --accent-muted: rgba(74, 158, 142, 0.12)
  /* Soft accent backgrounds */ --urgent: #bc6c25
  /* Warm amber β€” warnings, danger */ --text-primary: #e8f0ec
  /* Main text β€” soft white */ --text-muted: #7a9e8a
  /* Secondary text β€” muted sage */;

The Music Lounge overrides these with per-track dynamic gradients based on the currently playing song.

πŸ‘¨β€πŸ’» Built By

| **Sabeena


NOTE: For admin login, the username : josh and password : 1234

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgements


🟒 PingUp β€” Ping your people, build your community.
Frontend Β· Backend

deployed link: https://pingupsite.onrender.com

Backend API: https://pingup-backend-1.onrender.com

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 58.4%
  • CSS 41.5%
  • HTML 0.1%