Codebin is a lightweight alternative to Pastebin built on top of the Laravel PHP Framework. Feel free to use this as a reference, inspiration, or a base for your new project.
Codebin is a privacy focused text sharing application which I designed and developed within a very small timeframe for my academic display on a programming course in Information and Communications Technology. I do not recommend using this in production unless you are skilled enough with Laravel to perform your own tests. The purpose for this repository is simply a Proof of Concept.
- Cleanly written Controllers, Models, and Helpers following the official standards defined in Laravel documentation
- hCAPTHCA protection against robots based on scyllaly/hCaptcha
- Automatic paste deletion, if expiry is set
- Password protected pastes
- Option to view syntax highlighted snippet, or simply just a raw plain text version
- Responsive user interface for all devices
Purchase a VPS for developing and deploying applications in staging and/or production. You may install it locally as well for development and testing purposes, steps below.
- Run
composer install
to install Laravel and its dependencies - Run
npm i
to install Tailwind and Vite - Edit the
.env
file and fill in your MySQL host and its credentials - Run the database migrations with
php artisan migrate
- Launch Laravel in development mode with
php artisan serve
and Vite withnpm run dev
- Sign up and create an API key for hCaptcha and place them accordingly in your
.env
file - In order for the expired paste deletion to work properly, set an automatic task with command
php artisan app:process-expired-pastes
once a minute (eg. Crontab for Linux and Task Scheduler for Windows operating systems)
Contributors are welcome. Please follow the existing naming, and syntax policy for your pull request to be accepted.
- Finish the optional user account system to allow users edit their own pastes when authenticated
- Add light theme
- Improve overall user experience
- Add a server-side encryption for contents of password protected pastes
- Implement a rate-limiting algorithm to prevent mass scraping (this can be achieved with eg. Cloudflare for now)
- Purchase a domain and setup a live demo in production