Skip to content
/ Codebin Public

A lighter alternative to Pastebin using Laravel

License

Notifications You must be signed in to change notification settings

mtfy/Codebin

Repository files navigation

Codebin

Codebin is a lightweight alternative to Pastebin 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.

Laravel Laravel


About Codebin

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

Demo


Installation

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.

  1. Run composer install to install Laravel and its dependencies
  2. Run npm i to install Tailwind and Vite
  3. Edit the .env file and fill in your MySQL host and its credentials
  4. Run the database migrations with php artisan migrate
  5. Launch Laravel in development mode with php artisan serve and Vite with npm run dev

Remarks

  • 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)

Contributing

Contributors are welcome. Please follow the existing naming, and syntax policy for your pull request to be accepted.


Plans for Future

  • 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

About

A lighter alternative to Pastebin using Laravel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published