A modern, real-time collaborative document editing platform with team management, live chat, notifications, and beautiful UI themes.
- π 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
- 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
- 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
- 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
- Docker - Containerization for consistent deployment
- Hugging Face Spaces - Hosting platform
- Git - Version control
- Environment Variables - Secure configuration management
-
Clone and install:
git clone https://github.com/rajm012/Chit-Chat.git cd Chit-Chat npm install -
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
-
Configure environment variables: Create/edit
.envfile:PORT=7860 NODE_ENV=development MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/chitchat SESSION_SECRET=your-super-secret-key-change-this
-
Run locally:
npm start # or with auto-reload npm run dev -
Access: Open
http://localhost:7860
# 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-
Create Space: Go to Hugging Face Spaces
-
Select Docker SDK
-
Push your code:
git push https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE main
-
Set Environment Variables in Space Settings:
NODE_ENV=productionSESSION_SECRET=random-long-secret-keyMONGODB_URI=your-mongodb-atlas-uri
-
Done! Your app will be live at
https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE
π Detailed Guides:
DOCKER_DEPLOYMENT.md- Complete Docker setupHUGGINGFACE_CHECKLIST.md- Troubleshooting for HF Spaces
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
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
POST /signup- Register with validationPOST /login- Session-based authenticationPOST /logout- Clear sessionGET /check- Verify authentication
GET /- List user's teamsGET /:teamId- Get specific teamPOST /- Create team with invite codePOST /join- Join via 6-char codeGET /:teamId/documents- Team documentsPOST /:teamId/leave- Leave teamDELETE /:teamId- Delete (admin only)
POST /- Create document in teamGET /:docId- Fetch with contentPUT /:docId- Update content + versionDELETE /:docId- Remove document
GET /teams/:teamId/messages- Fetch chat history- Real-time messaging via Socket.IO
GET /- User notificationsPUT /:id/read- Mark as readDELETE /:id- Delete notification
POST /- File upload (Multer)- File storage in
/uploadsdirectory
GET /stats- User statistics (teams, documents)
- Sign up - Create account with username, email, password
- Create/Join Team - Start new team or join with 6-char invite code
- Manage Profile - Update info, change password, toggle theme
- Create Documents - Write collaborative documents in teams
- Real-time Chat - Communicate with team members
- Track Activity - View notifications and team stats
- 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)
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
- 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
Ping for suggestions or improvements
MIT
Chit-Chat's Team