Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chit-Chat - Collaborative Document Editor πŸ’¬πŸ“

A modern, real-time collaborative document editing platform with team management, live chat, notifications, and beautiful UI themes.

✨ Features

Core Features

  • πŸ” User Authentication: Secure signup/login with session management and password hashing
  • πŸ‘₯ Team Management: Create teams, generate invite codes, role-based access control
  • πŸ“„ Real-time Collaboration: Multiple users edit documents simultaneously with Socket.IO
  • πŸ’¬ Team Chat: Live team chat rooms with real-time messaging
  • πŸ”” Notifications: In-app notification system for team activities
  • πŸ“Ž File Attachments: Upload and attach files to documents
  • πŸ“Š Dashboard Stats: Track documents, teams, members, and activity
  • 🎨 Modern UI: Glassmorphism design with light/dark theme toggle
  • πŸŒ™ Theme System: Beautiful light/dark mode with smooth transitions
  • πŸ“± Responsive Design: Works on desktop, tablet, and mobile devices
  • πŸ’Ύ Auto-save: Documents save automatically as you type
  • πŸ” Search & Filter: Find documents and teams quickly
  • πŸ“ˆ Activity Timeline: Track recent document changes and team activity
  • πŸ‘€ User Profiles: Customizable user profiles with stats and avatars
  • βš™οΈ Account Management: Profile editing, password change, data export, account deletion

Advanced Features

  • Document Templates: Quick start with meeting notes, project plans, reports, etc.
  • Document Versions: Track document history and changes
  • Member Management: Add/remove team members with role control
  • Collections & Tags: Organize documents with custom tags
  • Storage Tracking: Monitor storage usage across teams
  • Quick Actions: Fast access to common tasks
  • Legal Pages: Privacy Policy, Terms of Service, Help Center, Contact Us

πŸ› οΈ Tech Stack

Frontend

  • HTML5, CSS3 - Modern semantic markup and styling
  • Vanilla JavaScript - No frameworks, pure ES6+
  • Socket.IO Client - Real-time WebSocket communication
  • Custom Theme System - Light/dark mode with CSS variables
  • Glassmorphism UI - Modern frosted glass design
  • Toast Notifications - Custom notification system
  • Responsive Layout - Mobile-first CSS Grid & Flexbox

Backend

  • Node.js 18+ - JavaScript runtime
  • Express.js 4.18 - Web framework
  • Socket.IO 4.6 - Real-time bidirectional communication
  • MongoDB Atlas - Cloud NoSQL database
  • Mongoose 9.0 - MongoDB ODM with schemas
  • bcryptjs - Password hashing and security
  • express-session - Session management with cookies
  • Multer - File upload handling
  • CORS - Cross-origin resource sharing

DevOps & Deployment

  • Docker - Containerization for consistent deployment
  • Hugging Face Spaces - Hosting platform
  • Git - Version control
  • Environment Variables - Secure configuration management

πŸš€ Quick Start

Local Development

  1. Clone and install:

    git clone https://github.com/rajm012/Chit-Chat.git
    cd Chit-Chat
    npm install
  2. Set up MongoDB Atlas:

    • Create free account at MongoDB Atlas
    • Create a cluster and get connection string
    • Whitelist all IPs (0.0.0.0/0) for development
  3. Configure environment variables: Create/edit .env file:

    PORT=7860
    NODE_ENV=development
    MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/chitchat
    SESSION_SECRET=your-super-secret-key-change-this
  4. Run locally:

    npm start
    # or with auto-reload
    npm run dev
  5. Access: Open http://localhost:7860

🐳 Docker Deployment

# Build Docker image
docker build -t chitchat-app .

# Run container
docker run -p 7860:7860 \
  -e NODE_ENV=production \
  -e MONGODB_URI="your_mongodb_uri" \
  -e SESSION_SECRET="your_secret" \
  chitchat-app

☁️ Deploy to Hugging Face Spaces

  1. Create Space: Go to Hugging Face Spaces

  2. Select Docker SDK

  3. Push your code:

    git push https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE main
  4. Set Environment Variables in Space Settings:

    • NODE_ENV=production
    • SESSION_SECRET=random-long-secret-key
    • MONGODB_URI=your-mongodb-atlas-uri
  5. Done! Your app will be live at https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE

πŸ“– Detailed Guides:

  • DOCKER_DEPLOYMENT.md - Complete Docker setup
  • HUGGINGFACE_CHECKLIST.md - Troubleshooting for HF Spaces

πŸ“ Project Structure

chit-chat/
β”œβ”€β”€ public/                      # Frontend files
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ modern-theme.css     # Theme system & design tokens
β”‚   β”‚   β”œβ”€β”€ dashboard-styles.css # Dashboard-specific styles
β”‚   β”‚   └── profile-styles.css   # Profile page styles
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ auth.js              # Authentication logic
β”‚   β”‚   β”œβ”€β”€ dashboard.js         # Dashboard functionality
β”‚   β”‚   β”œβ”€β”€ dashboard-add.js     # Enhanced dashboard features
β”‚   β”‚   β”œβ”€β”€ editor.js            # Real-time document editor
β”‚   β”‚   β”œβ”€β”€ profile.js           # User profile management
β”‚   β”‚   └── theme-toast.js       # Theme switcher & notifications
β”‚   β”œβ”€β”€ login.html               # Login page
β”‚   β”œβ”€β”€ signup.html              # Signup page
β”‚   β”œβ”€β”€ dashboard.html           # Main dashboard
β”‚   β”œβ”€β”€ editor.html              # Document editor
β”‚   β”œβ”€β”€ profile.html             # User profile
β”‚   β”œβ”€β”€ privacy-policy.html      # Privacy policy
β”‚   β”œβ”€β”€ terms-of-service.html    # Terms of service
β”‚   β”œβ”€β”€ help-center.html         # Help & FAQ
β”‚   └── contact-us.html          # Contact form
β”œβ”€β”€ models/                      # MongoDB schemas
β”‚   β”œβ”€β”€ User.js                  # User model
β”‚   β”œβ”€β”€ Team.js                  # Team model
β”‚   β”œβ”€β”€ Document.js              # Document model
β”‚   β”œβ”€β”€ DocumentVersion.js       # Version history
β”‚   β”œβ”€β”€ ChatMessage.js           # Chat messages
β”‚   β”œβ”€β”€ Notification.js          # Notifications
β”‚   └── Attachment.js            # File attachments
β”œβ”€β”€ routes/                      # API endpoints
β”‚   β”œβ”€β”€ auth.js                  # Auth routes
β”‚   β”œβ”€β”€ teams.js                 # Team management
β”‚   β”œβ”€β”€ documents.js             # Document CRUD
β”‚   β”œβ”€β”€ chat.js                  # Team chat
β”‚   β”œβ”€β”€ notifications.js         # Notification system
β”‚   β”œβ”€β”€ uploads.js               # File uploads
β”‚   └── dashboard-api.js         # Dashboard stats
β”œβ”€β”€ uploads/                     # File storage
β”œβ”€β”€ database.js                  # MongoDB connection
β”œβ”€β”€ server.js                    # Express server + Socket.IO
β”œβ”€β”€ Dockerfile                   # Docker configuration
β”œβ”€β”€ .dockerignore               # Docker ignore rules
β”œβ”€β”€ package.json                 # Dependencies
β”œβ”€β”€ .env                         # Environment variables
└── README.md                    # This file

πŸ—„οΈ Database Schema (MongoDB)

Collections

Users - User accounts

  • username, email (unique), password (hashed bcrypt)
  • createdAt, updatedAt timestamps

Teams - Collaboration teams

  • name, inviteCode (unique 6-char), createdBy
  • members[] (user ref, role: admin/member, joinedAt)
  • timestamps

Documents - Collaborative documents

  • title, content (rich text), teamId
  • createdBy, lastModifiedBy (user refs)
  • versions history, timestamps

ChatMessages - Team chat

  • teamId, userId, message, timestamp
  • Real-time via Socket.IO

Notifications - User notifications

  • userId, type, message, read status
  • createdAt, relatedDocId/teamId

DocumentVersions - Version history

  • documentId, content, editedBy
  • version number, timestamp

Attachments - File uploads

  • documentId, filename, filepath, uploadedBy
  • size, mimetype, timestamp

πŸ”Œ API Endpoints

Auth Routes (/api/auth)

  • POST /signup - Register with validation
  • POST /login - Session-based authentication
  • POST /logout - Clear session
  • GET /check - Verify authentication

Team Routes (/api/teams)

  • GET / - List user's teams
  • GET /:teamId - Get specific team
  • POST / - Create team with invite code
  • POST /join - Join via 6-char code
  • GET /:teamId/documents - Team documents
  • POST /:teamId/leave - Leave team
  • DELETE /:teamId - Delete (admin only)

Document Routes (/api/documents)

  • POST / - Create document in team
  • GET /:docId - Fetch with content
  • PUT /:docId - Update content + version
  • DELETE /:docId - Remove document

Chat Routes (/api/chat)

  • GET /teams/:teamId/messages - Fetch chat history
  • Real-time messaging via Socket.IO

Notification Routes (/api/notifications)

  • GET / - User notifications
  • PUT /:id/read - Mark as read
  • DELETE /:id - Delete notification

Upload Routes (/api/uploads)

  • POST / - File upload (Multer)
  • File storage in /uploads directory

Dashboard API (/api/dashboard)

  • GET /stats - User statistics (teams, documents)

πŸ“– Usage

Getting Started

  1. Sign up - Create account with username, email, password
  2. Create/Join Team - Start new team or join with 6-char invite code
  3. Manage Profile - Update info, change password, toggle theme
  4. Create Documents - Write collaborative documents in teams
  5. Real-time Chat - Communicate with team members
  6. Track Activity - View notifications and team stats

Features in Action

  • Dashboard: View all teams, documents, and quick actions
  • Editor: Real-time collaborative editing with Socket.IO
  • Chat: Team chat sidebar with message history
  • Profile: User stats, settings, data export, account management
  • Notifications: Real-time alerts for team/document changes
  • Theme Toggle: Switch between light/dark mode (persisted)

⚑ Real-time Collaboration

Socket.IO enables real-time features:

  • Live Document Editing - See changes as teammates type
  • Active Users - Visual indicators of who's online
  • Team Chat - Instant messaging within teams
  • Notifications - Real-time alerts for document/team events
  • Auto-sync - Changes synced automatically across clients

πŸ”’ Security Features

  • Password Hashing - bcryptjs with salt rounds
  • Session Management - express-session with secure cookies
  • MongoDB Security - Atlas encrypted connections, authenticated access
  • Role-based Access - Team admin/member permissions
  • CORS Protection - Configured for production environments
  • Environment Variables - Sensitive data in .env (not committed)
  • Invite System - 6-character codes for controlled team access
  • Input Validation - Sanitized user inputs
  • Production Config - Secure cookies (SameSite, HttpOnly) in production

πŸš€ Future Enhancements

Ping for suggestions or improvements

πŸ“„ License

MIT

πŸ‘€ Author

Chit-Chat's Team

About

A modern, real-time collaborative document editing platform with team management, live chat, notifications, and a good UI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages