Skip to content

Repository files navigation

All Contributors

Collaborative Notepad

Version License: MIT Star this repo

A free, open-source real-time collaborative notepad. No sign-up. No friction. Just paste a link and start writing together.

Live Demo Β |Β  Roadmap Β |Β  Contributing Β |Β  Report a Bug


The Story

"The best ideas come from collaboration, water, and probably a bit of back pain."

  • Me, after my 20-hour coding marathon

Welcome to my pride and joy - a real-time collaborative notepad that's more fun than trying to teach your grandma how to Zoom!

After 20 hours of relentless coding, countless water refills, one serious back pain episode (desperately need a chair), and an existential crisis later, this beauty finally went live. Why? Because I believe sharing notes shouldn't be harder than explaining to yourself why you didn't invest in a proper chair before a coding marathon.

The deployment journey - from npm start to "success" - felt like a chiropractor's waiting list. But hey, better late than never.


Features

Core Collaboration

  • Real-time editing - watch your friends type live (while you do some stretching)
  • Custom URLs - create memorable links like my-back-is-killing-me
  • Dark / Light mode - for vampires, developers, and people who've lost track of day and night
  • User presence counter - see how many people are enjoying this
  • Auto-save - because we all have trust issues after losing work that one time
  • Responsive design - works on everything from your fancy phone to that potato you call a laptop

Security and Admin

  • Secret admin panel - hidden URL for your eyes only (no /admin guessing)
  • bcrypt password protection - secure admin login with session management
  • Real-time monitoring - live stats on active notes, users, and system health
  • Note content management - view all notes with previews, timestamps, and cleanup controls
  • Bot protection - prevents automated blank note creation
  • Rate limiting - protects against spam and abuse
  • Suspicious activity monitoring - logs potential security threats automatically

Automated Maintenance

  • Scheduled cleanup - auto-removes empty notes older than 7 days (daily at 2:00 AM UTC)
  • Manual cleanup controls - admin dashboard buttons for immediate spring cleaning
  • Cleanup statistics - real-time breakdown of old vs recent empty notes
  • Health check endpoint - /health for uptime monitoring

Performance

  • Database write batching - reduces DB load by ~95% vs per-keystroke writes
  • In-memory state management - real-time edits cached locally for instant sync
  • 5-second batch commits - periodic database writes instead of hammering on every keystroke
  • Promise.all() batch processing - optimal concurrent database performance

Production-Ready

  • Security headers - Helmet, CSP, HSTS, X-Frame-Options, X-XSS-Protection
  • Professional error pages - friendly 404/500 pages with navigation options
  • SEO controls - robots.txt, sitemap.xml, security.txt
  • Environment-based config - development vs production behavior

Tech Stack

Layer Technology
Runtime Node.js 20.x
Framework Express.js
Real-time Socket.IO
Database MongoDB + Mongoose
Templating EJS
Auth bcrypt + express-session + connect-mongo
Security Helmet + express-rate-limit + dotenv
Scheduling node-cron
Compression compression

Quick Start

# Clone the repo
git clone https://github.com/sh13y/collaborative-notepad.git
cd collaborative-notepad

# Install dependencies (grab some water, this might take a moment)
npm install

# Set up environment variables
cp .env.example .env

Edit your .env file:

MONGODB_URI=your_mongodb_connection_string
SESSION_SECRET=a-long-random-secret-string
ADMIN_SECRET_PATH=your-custom-secret-admin-path
PORT=3000
NODE_ENV=development
# Fire it up
npm start

# Or with auto-reload for development
npm run dev

Visit http://localhost:3000 and prepare to be amazed.


Deployment

Render (Recommended)

  1. Push to GitHub and connect your repo to Render
  2. Set environment variables in the Render dashboard:
    MONGODB_URI, SESSION_SECRET, ADMIN_SECRET_PATH, NODE_ENV=production, PORT=3000
    
  3. Done - Render handles the rest

Vercel

npm i -g vercel
vercel

Netlify

npm i -g netlify-cli
netlify deploy

Admin Panel

The admin panel is not at /admin. It uses a secret path that only you know, so brute-forcing the URL gives you nothing.

Default URLs:

https://yourdomain.com/{ADMIN_SECRET_PATH}/login
https://yourdomain.com/{ADMIN_SECRET_PATH}

First-time setup:

  1. Visit your secret login URL
  2. Enter a password - this creates your admin account
  3. Bookmark the URL privately - it's your kingdom

Dashboard includes:

  • Live stats: active notes, total notes, connected users
  • Note management: view content previews and timestamps
  • Cleanup controls: delete empty notes manually or on schedule
  • Security: reset password, secure logout

Changing your secret path:

# In .env
ADMIN_SECRET_PATH=my-new-secret-path-2025

# Redeploy - new URL takes effect immediately

Use a complex path with letters, numbers, and hyphens. Change it periodically. Never share it.


API Reference

Public Endpoints

Method Path Description
GET /health Server health check
GET /robots.txt SEO crawler control
GET /sitemap.xml Search engine sitemap
GET /security.txt Responsible disclosure info

Admin Endpoints (Behind Secret Path)

Method Path Description
GET /{secret}/login Admin login page
GET /{secret} Admin dashboard
POST /{secret}/delete-empty-notes Manual cleanup trigger
POST /{secret}/cleanup-old-empty-notes Remove notes older than 7 days
GET /{secret}/cleanup-stats Real-time cleanup statistics
POST /{secret}/reset-password Reset admin password
GET /{secret}/logout Secure logout

Contributing

All skill levels welcome! See CONTRIBUTING.md for the full guide.

Quick version:

git checkout main
git pull origin main
git checkout -b feature/your-feature-name
# make your changes
git commit -m "Add: brief description"
git push origin feature/your-feature-name
# open a PR targeting main

Check the Roadmap for ideas on what to build next.


Contributors

Thanks to everyone who made this better:

MD Rehan
MD Rehan

Code Ideas Bugs
Mohammed Saif
Mohammed Saif

Code Design
Dipanjana Dasgupta
Dipanjana Dasgupta

Code Bugs

Want to see your name here? Check out CONTRIBUTING.md and join the fun!

This project follows the all-contributors specification.


Found a Bug?

First, try turning it off and on again. If that doesn't work:

  1. Check if Mercury is in retrograde
  2. Make sure your computer isn't possessed
  3. Open an issue
  4. Or better yet - fix it and send a PR!

Support the Chair Fund

If this project saved you from the horrors of email attachments or helped you procrastinate productively, consider:

  • Back Pain Relief Fund - seriously, 20 hours of coding on a bad chair is NOT fun
  • Starring this repo - it's free and makes the pain slightly more bearable
  • Telling your developer friends to maintain good posture (we all need this reminder)

License

MIT - which means you can do whatever you want with it, just don't blame me if your cat deletes your notes by walking on the keyboard.


Engineered with love from the floor, debugged with determination, powered by water, and brought to you by sh13y - the developer who turned back pain into a feature, not a bug.

P.S. If you've read this far, you deserve a cookie and probably need a hobby (and a better chair than mine).

P.P.S. Yes, this README took longer to write than some of the actual features - mostly because I had to keep standing up to stretch.

About

πŸ“ Real-time collaborative notepad with custom URLs, dark mode, and auto-save. Built with Node.js, Socket.IO, and MongoDB. Share notes instantly, collaborate in real-time.

Topics

Resources

Contributing

Stars

7 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages