{"id":30847592,"url":"https://github.com/ktauchathuranga/notebud","last_synced_at":"2025-09-07T02:45:31.373Z","repository":{"id":312645434,"uuid":"1041190249","full_name":"ktauchathuranga/notebud","owner":"ktauchathuranga","description":"A simple note-taking and chat app designed for university labs","archived":false,"fork":false,"pushed_at":"2025-09-01T04:15:00.000Z","size":282,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T06:45:03.893Z","etag":null,"topics":["classnotes","notebud","notepad"],"latest_commit_sha":null,"homepage":"https://notebud.cc","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktauchathuranga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-20T05:50:39.000Z","updated_at":"2025-09-01T04:07:53.000Z","dependencies_parsed_at":"2025-09-01T06:45:13.028Z","dependency_job_id":"65a61fdb-b617-43ac-a936-48761cfb35a3","html_url":"https://github.com/ktauchathuranga/notebud","commit_stats":null,"previous_names":["ktauchathuranga/notebud"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ktauchathuranga/notebud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktauchathuranga%2Fnotebud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktauchathuranga%2Fnotebud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktauchathuranga%2Fnotebud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktauchathuranga%2Fnotebud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktauchathuranga","download_url":"https://codeload.github.com/ktauchathuranga/notebud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktauchathuranga%2Fnotebud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273989799,"owners_count":25203261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classnotes","notebud","notepad"],"created_at":"2025-09-07T02:45:26.257Z","updated_at":"2025-09-07T02:45:31.353Z","avatar_url":"https://github.com/ktauchathuranga.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# notebud\n\nA simple note-taking and chat app designed for university labs with flexible session management. Quick login with both temporary and permanent session options, automatic cleanup, and seamless cloud or local database support.\n\n![notebud-preview](https://github.com/user-attachments/assets/a4ec8595-59ff-49d6-b2e1-1ebbee244d02)\n\n\n## Why notebud?\n\nPerfect for uni labs where you can't access OneDrive/Google Drive due to 2FA hassles. Choose between temporary sessions (4-hour auto-logout) or permanent sessions (logout only when you want). Notes auto-clear in 30 days to keep things tidy. Connect with classmates through real-time chat.\n\n\u003e [!TIP]\n\u003e - **Visit us at**: [notebud.cc](https://notebud.cc)\n\u003e - Alternative Domain: [notebud-t6u9.onrender.com](https://notebud-t6u9.onrender.com/)\n\n## ⚠️ Important User Responsibility\n\n**PRIVACY \u0026 SECURITY WARNING**: notebud is designed for temporary academic use. Users are solely responsible for:\n\n- **Never sharing private, sensitive, or confidential information** through notes or chat\n- **Not using the platform for illegal activities** or inappropriate content\n- **Understanding that data may be visible to system administrators** for maintenance purposes\n- **Accepting that all content is automatically deleted after 30 days**\n- **Using the service at your own risk** - we provide no guarantees of data security or privacy\n\nBy using notebud, you acknowledge these limitations and agree to use the platform responsibly and legally.\n\n## Features\n\n### Core Features\n- **Flexible login** - Choose temporary (4h) or permanent sessions\n- **Session management** - Permanent users can logout all temporary sessions\n- **Simple authentication** - No 2FA required\n- **Auto-delete** - Notes and chat data vanish after 30 days\n- **Modern UI** - Dark theme, responsive design with inline SVG icons\n- **Auto-save** - Notes save after 30 seconds of inactivity\n- **Edit notes** - Click to modify existing notes\n- **Search functionality** - Quick search through your notes\n- **Character counter** - Track note length with warnings\n- **Share notes** - You can share notes using usernames\n\n### Chat Features\n- **Real-time messaging** - WebSocket-powered instant communication\n- **Username-based contacts** - Find and chat with other users by username\n- **Chat requests** - Send and receive connection requests\n- **Session status** - See when users are online/offline\n- **Mobile responsive** - Full chat functionality on mobile devices\n- **Professional interface** - Clean, modern chat experience\n\n### Session Types\n- **Temporary Sessions**: 4-hour duration, perfect for lecture sessions\n- **Permanent Sessions**: Stay logged in until manual logout\n- **Session Control**: Permanent users can logout all temporary sessions across devices\n\n### Database Options\n- **Local Docker MongoDB** - Full local development setup\n- **MongoDB Atlas** - Cloud database with free tier support\n\n## Quick Start\n\n### Option 1: Local Development (Docker MongoDB)\n```bash\ngit clone https://github.com/yourusername/notebud.git\ncd notebud\ncp .env.local .env\n# Edit .env with your passwords\ndocker-compose up -d\n```\n\n### Option 2: Cloud Database (MongoDB Atlas)\n```bash\ngit clone https://github.com/yourusername/notebud.git\ncd notebud\ncp .env.cloud .env\n# Edit .env with your Atlas connection string\ndocker-compose up -d web websocket\n```\n\nAccess the app at `http://localhost:8090` for local development or visit [https://notebud.cc](https://notebud.cc) for the live version.\n\n## Architecture\n\nnotebud consists of three main services:\n\n1. **Web Service** (PHP) - Handles authentication, notes, and serves the frontend\n2. **WebSocket Service** (Rust) - Powers real-time chat functionality  \n3. **MongoDB** - Stores users, notes, chat messages, and chat requests\n\n### Service Ports\n- **Web**: `8090` (HTTP interface)\n- **WebSocket**: `8092` (Chat server)\n- **MongoDB**: `27017` (Database)\n\n## Database Configuration\n\n### Local Docker MongoDB\nUse `.env.local` configuration:\n```env\nDB_HOST=mongo\nDB_PORT=27017\nDB_NAME=notebud\nDB_USER=admin\nDB_PASS=your_secure_password\nMONGO_INITDB_ROOT_USERNAME=admin\nMONGO_INITDB_ROOT_PASSWORD=your_secure_password\nMONGODB_URI=\nJWT_SECRET=your_very_long_random_secret_key\n```\n\n### MongoDB Atlas Cloud\nUse `.env.cloud` configuration:\n```env\nDB_HOST=cluster0.xxxxx.mongodb.net\nDB_NAME=notebud\nDB_USER=notebud_user\nDB_PASS=your_atlas_password\nMONGODB_URI=mongodb+srv://notebud_user:password@cluster0.xxxxx.mongodb.net/notebud?retryWrites=true\u0026w=majority\nJWT_SECRET=your_very_long_random_secret_key\n```\n\n## Setting Up MongoDB Atlas (Cloud)\n\n1. **Create account** at [mongodb.com/atlas](https://mongodb.com/atlas)\n2. **Create free M0 cluster**\n3. **Add database user** with read/write permissions\n4. **Allow network access** from anywhere (0.0.0.0/0)\n5. **Get connection string** and update `.env.cloud`\n6. **Copy to .env**: `cp .env.cloud .env`\n\n## Switching Between Databases\n\n### Manual Method\n```bash\n# Use local Docker MongoDB\ncp .env.local .env\ndocker-compose up -d\n\n# Use MongoDB Atlas\ncp .env.cloud .env\ndocker-compose up -d web websocket\n```\n\n### Script Method\nCreate `switch.sh`:\n```bash\n#!/bin/bash\nif [ \"$1\" = \"local\" ]; then\n    cp .env.local .env\n    echo \"Switched to local Docker MongoDB\"\n    docker-compose up -d\nelif [ \"$1\" = \"cloud\" ]; then\n    cp .env.cloud .env  \n    echo \"Switched to MongoDB Atlas\"\n    docker-compose up -d web websocket\nelse\n    echo \"Usage: ./switch.sh [local|cloud]\"\nfi\n```\n\nUsage: `./switch.sh local` or `./switch.sh cloud`\n\n## Chat System\n\n### How Chat Works\n\n1. **User Discovery**: Find other users by their username\n2. **Connection Requests**: Send chat requests to initiate conversations\n3. **Real-time Messaging**: Once accepted, chat in real-time via WebSocket\n4. **Session Awareness**: See when contacts are online/offline\n5. **Mobile Support**: Full functionality on mobile devices\n\n### Chat Security Considerations\n\n- All chat messages are stored temporarily and auto-deleted after 30 days\n- Users can only see their own conversations\n- WebSocket connections are authenticated via JWT tokens\n- No end-to-end encryption - messages are visible to system administrators\n- Chat history is limited to active sessions\n\n### Chat Usage Guidelines\n\n- Use professional, appropriate language\n- Respect other users' privacy and time\n- Remember that conversations are not permanently stored\n- Report inappropriate behavior through proper channels\n- Understand that chat logs may be reviewed for maintenance purposes\n\n## Security\n\n- JWT authentication with HttpOnly cookies\n- Users only see their own notes and conversations\n- Input validation and sanitization\n- Flexible session timeout (4-hour temporary or permanent)\n- Session management for permanent users\n- Auto-deletion after 30 days for all data\n- WebSocket authentication\n- HTTPS support for production\n\n## Development\n\n### Requirements\n- Docker and Docker Compose\n- PHP 8+ (if running without Docker)\n- Rust 1.70+ (for WebSocket service development)\n- MongoDB (local) or Atlas account (cloud)\n\n### Local Development\n```bash\n# Start all services\ndocker-compose up -d\n\n# View logs for specific services\ndocker-compose logs -f web\ndocker-compose logs -f websocket\ndocker-compose logs -f mongo\n\n# Stop services  \ndocker-compose down\n\n# Rebuild containers\ndocker-compose build --no-cache\n```\n\n### Database Management\n- **Local**: MongoDB runs in Docker container\n- **Cloud**: Managed by MongoDB Atlas\n- **TTL Index**: Automatically deletes notes and chat data after 30 days\n- **Collections**: `users`, `notes`, `chat_requests`, `chats`, `chat_messages`\n\n### WebSocket Development\n\nThe chat system uses a Rust-based WebSocket server for real-time communication:\n\n```bash\n# Access WebSocket container\ndocker-compose exec websocket bash\n\n# View WebSocket logs\ndocker-compose logs -f websocket\n\n# Rebuild WebSocket service\ndocker-compose build websocket\n```\n\n### Project Structure\n```\nnotebud\n├── docker\n│   ├── mongo\n│   │   └── init-mongo.js\n│   ├── php\n│   │   ├── 000-default.conf\n│   │   ├── Dockerfile\n│   │   └── supervisord.conf\n│   └── websocket\n│       └── Dockerfile\n├── docker-compose.yml\n├── init-mongo.js\n├── README.md\n├── src\n│   ├── api\n│   │   ├── auth.php\n│   │   ├── db.php\n│   │   ├── delete_note.php\n│   │   ├── get_chat_requests.php\n│   │   ├── get_notes.php\n│   │   ├── get_online_users.php\n│   │   ├── jwt.php\n│   │   ├── login.php\n│   │   ├── logout_all_temp.php\n│   │   ├── logout.php\n│   │   ├── register.php\n│   │   ├── reset_password.php\n│   │   ├── save_note.php\n│   │   └── update_note.php\n│   ├── public\n│   │   ├── 404.html\n│   │   ├── chat.php\n│   │   ├── css\n│   │   │   └── style.css\n│   │   ├── favicon\n│   │   ├── index.php\n│   │   ├── js\n│   │   │   ├── chat.js\n│   │   │   └── notes.js\n│   │   ├── login.html\n│   │   ├── notes.php\n│   │   ├── register.html\n│   │   └── reset-password.html\n│   └── websocket\n│       └── notebud_websocket\n│           ├── Cargo.lock\n│           ├── Cargo.toml\n│           └── src\n│               ├── auth.rs\n│               ├── database.rs\n│               ├── handlers.rs\n│               ├── main.rs\n│               └── types.rs\n└── switch.sh\n```\n\n## Contributing\n\nWe welcome contributions to notebud! Please follow these guidelines:\n\n### Getting Started\n\n1. **Fork the repository** on GitHub\n2. **Clone your fork** locally:\n   ```bash\n   git clone https://github.com/yourusername/notebud.git\n   cd notebud\n   ```\n3. **Create a feature branch**:\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n### Environment File Handling\n\nThis repository contains `.env.local` and `.env.cloud` files as **templates only**.\n- Do **not** commit real passwords or API keys.\n- Treat these files as \"locked\" — changes should not be pushed.\n\nTo prevent accidental commits, run the following after cloning:\n\n```bash\ngit update-index --skip-worktree .env.local\ngit update-index --skip-worktree .env.cloud\n```\n\n#### Commit Messages\nUse conventional commit format:\n```\ntype(scope): description\n\nfeat(auth): add permanent login session support\nfeat(chat): implement real-time messaging system\nfix(notes): resolve auto-save timing issue\ndocs(readme): update installation instructions\n```\n\nTypes: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`\n\n#### Testing\n- Test your changes with both local MongoDB and Atlas configurations\n- Verify functionality in multiple browsers\n- Test both temporary and permanent session flows\n- Test chat functionality with multiple users\n- Ensure mobile responsiveness for both notes and chat\n\n### Pull Request Process\n\n1. **Update documentation** if needed\n2. **Test thoroughly** with both database configurations\n3. **Test chat features** with multiple browser sessions\n4. **Create detailed PR description** with:\n   - What changes were made\n   - Why the changes are necessary\n   - How to test the changes\n   - Screenshots for UI changes\n\n4. **PR Title Format**:\n   ```\n   feat: Add session management for permanent users\n   feat(chat): Add real-time messaging system\n   fix: Resolve note deletion confirmation dialog\n   docs: Update contributing guidelines\n   ```\n\n### Issue Reporting\n\nWhen reporting issues, please include:\n\n- **Environment details** (OS, browser, Docker version)\n- **Service details** (which service: web, websocket, mongo)\n- **Steps to reproduce** the issue\n- **Expected vs actual behavior**\n- **Screenshots** if applicable\n- **Database configuration** (local/cloud)\n- **Browser console errors** (if applicable)\n\n### Feature Requests\n\nFor new features:\n- Check existing issues to avoid duplicates\n- Provide clear use case and rationale\n- Consider implementation complexity\n- Discuss breaking changes\n- Specify if feature affects notes, chat, or both\n\n### Development Setup\n\n1. **Environment setup**:\n   ```bash\n   cp .env.local .env\n   # Edit database credentials\n   ```\n\n2. **Start development environment**:\n   ```bash\n   docker-compose up -d\n   ```\n\n3. **Access application**: `http://localhost:8090`\n\n4. **Monitor logs**:\n   ```bash\n   # All services\n   docker-compose logs -f\n   \n   # Specific service\n   docker-compose logs -f websocket\n   ```\n\n### Code Review Checklist\n\nBefore submitting:\n- [ ] Code follows project style guidelines\n- [ ] All tests pass\n- [ ] Documentation updated\n- [ ] No sensitive data in commits\n- [ ] Changes work with both database options\n- [ ] UI changes are responsive\n- [ ] Session management works correctly\n- [ ] Chat functionality tested with multiple users\n- [ ] WebSocket connections handle disconnections gracefully\n\n### Community\n\n- Be respectful and constructive in discussions\n- Help review other contributors' PRs\n- Share knowledge and best practices\n- Follow the code of conduct\n\n## Privacy \u0026 Legal Disclaimers\n\n### Data Handling\n- All user data (notes, messages, accounts) is automatically deleted after 30 days\n- System administrators may access data for maintenance and security purposes\n- No data recovery is possible after deletion\n- We do not guarantee data security, privacy, or availability\n\n### User Responsibilities\n- Users must not share sensitive, private, or confidential information\n- Users must comply with all applicable laws and regulations\n- Users must not engage in harassment, illegal activities, or inappropriate behavior\n- Users acknowledge that conversations and notes are not private or secure\n\n### Limitation of Liability\n- notebud is provided \"as-is\" without warranties of any kind\n- We are not liable for any data loss, privacy breaches, or damages\n- Users assume all risks associated with using the platform\n- The service may be discontinued or modified at any time\n\n### Academic Use Only\nThis platform is designed specifically for temporary academic collaboration and note-taking in university lab environments. It is not suitable for:\n- Sensitive or confidential communications\n- Long-term data storage\n- Business or commercial use\n- Storage of personally identifiable information\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n\n## Support\n\nIf you encounter issues or have questions:\n- Check existing [GitHub Issues](https://github.com/yourusername/notebud/issues)\n- Create a new issue with detailed information\n- Join discussions in existing issues\n- Visit [https://notebud.cc](https://notebud.cc) for the live application\n\n---\n\n**Perfect for university students who need quick, flexible note-taking and communication without authentication hassles. Use responsibly and at your own risk.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktauchathuranga%2Fnotebud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktauchathuranga%2Fnotebud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktauchathuranga%2Fnotebud/lists"}