|
1 | | -# Codebin |
2 | | -A lighter alternative to Pastebin using Laravel |
| 1 | +<h1>Codebin</h1> |
| 2 | +<div> |
| 3 | + <p>Codebin is a lightweight alternative to <a href="https://en.wikipedia.org/wiki/Pastebin" target="_blank"><img src="https://i.imgur.com/A4SH1Ak.png" width="14" height="14" alt="Pastebin"> Pastebin</a> built on top of <a href="https://github.com/laravel/laravel">the Laravel PHP Framework</a>. Feel free to use this as a reference, inspiration, or a base for your new project.</p> |
| 4 | + <p><a href="https://github.com/laravel/laravel"><img src="https://img.shields.io/badge/Framework-Laravel-f55247" alt="Laravel" /></a> <a href="https://github.com/mtfy"><img src="https://img.shields.io/badge/Author-mtfy-399cbd" alt="Laravel" /></a></p> |
| 5 | +</div> |
| 6 | +<br /> |
| 7 | +<h2>About Codebin</h2> |
| 8 | +<div> |
| 9 | + <p>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.</p> |
| 10 | + <ul> |
| 11 | + <li>Cleanly written Controllers, Models, and Helpers following the official standards defined in <a href="https://laravel.com/docs/10.x/">Laravel documentation</a></li> |
| 12 | + <li>hCAPTHCA protection against robots based on <a href="https://github.com/scyllaly/hCaptcha">scyllaly/hCaptcha</a></li> |
| 13 | + <li>Automatic paste deletion, if expiry is set</li> |
| 14 | + <li>Password protected pastes</li> |
| 15 | + <li>Option to view syntax highlighted snippet, or simply just a raw plain text version</li> |
| 16 | + <li>Responsive user interface for all devices</li> |
| 17 | + </ul> |
| 18 | +</div> |
| 19 | +<br /> |
| 20 | +<h2>Demo</h2> |
| 21 | +<div> |
| 22 | + <a href="https://www.youtube.com/watch?v=xsyQqKXHgOE"><img src="https://i.imgur.com/DnOjdxN.jpg" width="426" height="240" alt="Codebin demo - 2024-05-23" /></a> |
| 23 | + <br /> |
| 24 | + <a href="https://www.youtube.com/watch?v=xsyQqKXHgOE">▶️ <strong>Watch on YouTube</strong></a> |
| 25 | +</div> |
| 26 | + |
| 27 | +<br /> |
| 28 | +<h2>Installation</h2> |
| 29 | +<div> |
| 30 | + <p>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.</p> |
| 31 | + <ol> |
| 32 | + <li>Run <code>composer install</code> to install Laravel and its dependencies</li> |
| 33 | + <li>Run <code>npm i</code> to install <a href="https://tailwindcss.com/docs/installation">Tailwind</a> and <a href="https://vitejs.dev/">Vite</a></li> |
| 34 | + <li>Edit the <code>.env</code> file and fill in your MySQL host and its credentials</li> |
| 35 | + <li>Run the database migrations with <code>php artisan migrate</code></li> |
| 36 | + <li>Launch Laravel in development mode with <code>php artisan serve</code> and Vite with <code>npm run dev</code></li> |
| 37 | + </ol> |
| 38 | +</div> |
| 39 | +<br /> |
| 40 | +<h2>Remarks</h2> |
| 41 | +<div> |
| 42 | + <ul> |
| 43 | + <li>Sign up and create an API key for <a href="https://www.hCaptcha.com/">hCaptcha</a> and place them accordingly in your <code>.env</code> file</li> |
| 44 | + <li>In order for the expired paste deletion to work properly, set an automatic task with command <code>php artisan app:process-expired-pastes</code> once a minute (eg. <a href="https://crontab.guru/examples.html">Crontab</a> for Linux and <a href="https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page">Task Scheduler</a> for Windows operating systems)</li> |
| 45 | + </ul> |
| 46 | +</div> |
| 47 | +<br /> |
| 48 | +<h2>Contributing</h2> |
| 49 | +<div> |
| 50 | + <p>Contributors are welcome. Please follow the existing naming, and syntax policy for your pull request to be accepted.</p> |
| 51 | +</div> |
| 52 | +<br /> |
| 53 | +<h2>Plans for Future</h2> |
| 54 | +<div> |
| 55 | + <ul> |
| 56 | + <li>Finish the optional user account system to allow users edit their own pastes when authenticated</li> |
| 57 | + <li>Add light theme</li> |
| 58 | + <li>Improve overall user experience</li> |
| 59 | + <li>Add a server-side encryption for contents of password protected pastes</li> |
| 60 | + <li>Implement a rate-limiting algorithm to prevent mass scraping (this can be achieved with eg. Cloudflare for now)</li> |
| 61 | + <li>Purchase a domain and setup a live demo in production</li> |
| 62 | + </ul> |
| 63 | +</div> |
0 commit comments