A modern, feature-rich pastebin platform with AI-powered assistance, syntax highlighting, and comprehensive API support.
- ๐จ Syntax Highlighting - Support for 99+ programming languages
- ๐ค AI Assistant - Language detection, code explanation, and completion
- ๐ Live Preview - Markdown, HTML, and SVG preview functionality
- ๐ REST API - Complete API system with comprehensive documentation
- โฐ Paste Expiration - Set automatic deletion times (10 minutes to 1 month)
- ๐ Privacy Controls - Public and private pastes
- ๐ค User Accounts - Registration, login, and paste history
- ๐ Search - Find public pastes by title or content
- ๐ฑ Mobile Friendly - Responsive design works on all devices
- ๐ด Fork Pastes - Create copies of existing pastes
- ๐ Statistics - View counts and user stats
- ๐ฅ Download - Save pastes as files
- ๐ Unlimited Creation - No rate limiting restrictions
- Python 3.8+
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/gpbot-org/Dustbin.git cd Dustbin -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Initialize database
python create_db.py
-
Run the application
python app.py
-
Access the application
- Web Interface: http://127.0.0.1:5000
- API Documentation: http://127.0.0.1:5000/docs
To enable full AI features (code completion, enhanced language detection):
-
Get Hugging Face API Token
- Visit: https://huggingface.co/settings/tokens
- Create a new token
-
Set Environment Variable
export HUGGINGFACE_API_TOKEN=your_token_here -
Restart the application
python app.py
Dustbin/
โโโ ๐ app.py # Main Flask application
โโโ ๐ค ai_helper.py # AI integration module
โโโ ๐๏ธ create_db.py # Database initialization
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐จ static/ # CSS, JS, and assets
โโโ ๐ templates/ # HTML templates
โโโ ๐ง highlight/ # Language configurations
โโโ ๐ docs/ # Documentation files
โ โโโ README.md
โ โโโ API_SYSTEM.md
โ โโโ FEATURES_IMPLEMENTED.md
โ โโโ PREVIEW_FEATURES.md
โโโ ๐งช tests/ # Test suite
โโโ test_all_apis.py # Comprehensive API tests
โโโ test_ai_features.py # AI functionality tests
โโโ test_preview.py # Preview feature tests
โโโ run_tests.py # Test runner
โโโ ...
Create a paste:
curl -X POST http://127.0.0.1:5000/api/v1/pastes \
-H "Content-Type: application/json" \
-d '{
"title": "Hello World",
"content": "print(\"Hello from API!\")",
"language": "python",
"is_public": true
}'Get paste content:
curl http://127.0.0.1:5000/api/v1/pastes/abc123AI language detection:
curl -X POST http://127.0.0.1:5000/api/ai/detect-language \
-H "Content-Type: application/json" \
-d '{"code": "function hello() { console.log(\"Hi!\"); }"}'Complete API documentation: http://127.0.0.1:5000/docs
cd tests
python run_tests.py# API functionality
python tests/test_all_apis.py
# AI features
python tests/test_ai_features.py
# Preview functionality
python tests/test_preview.py- Overall Success Rate: 85.7% (6/7 test files passing)
- API Tests: 88.2% success rate (15/17 tests)
- Core API: 100% success rate (7/7 tests)
- AI Features: 85.7% success rate (6/7 tests)
- Preview Features: 100% success rate (all formats working)
- API Documentation:
/docs- Interactive API reference - Feature Guide:
docs/FEATURES_IMPLEMENTED.md - Preview Guide:
docs/PREVIEW_FEATURES.md - API System:
docs/API_SYSTEM.md
- Edit
highlight/languages.json - Add language configuration with Pygments lexer
- Restart the application
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
python tests/run_tests.py - Submit a pull request
HUGGINGFACE_API_TOKEN- Enable full AI featuresSECRET_KEY- Flask secret key (auto-generated if not set)DATABASE_URL- Database connection string (defaults to SQLite)
- Rate Limiting: Removed for better UX
- AI Features: Work with/without API token
- Preview: Automatic for Markdown, HTML, SVG
- Authentication: Optional for most features
- Developers: Code sharing with syntax highlighting and AI assistance
- Teams: Collaborative code review and sharing
- Education: Teaching with live code examples and explanations
- Documentation: Markdown preview for README files and docs
- Prototyping: Quick HTML/CSS/SVG testing and sharing
- API key authentication
- Webhook support
- Bulk operations
- Advanced search with filters
- Official SDKs (Python, JavaScript, Go)
- Real-time collaborative editing
- More AI models integration
This project is open source. See the repository for license details.
- Issues: GitHub Issues
- Documentation:
/docsendpoint - API Help: Interactive docs at
/docs
Built with โค๏ธ for the developer community