Snippetbox is a web application similar to Ubuntu Pastebin or GitHub Gist, designed for users to create and save text snippets. Registered users can create their own snippets, set an expiration time for each snippet, and view saved snippets.
- Create Account/Login: Users can create an account or log in to access their snippets.
- Create Snippets: Users can create and save their snippets.
- Set Lifetime: Each snippet can have an expiration time set by the user.
- View Snippets: Users can view their created snippets.
- HTML, CSS, Bootstrap, JavaScript
- Go (Golang)
- MySQL
- Pat Router
- Alice Middleware Manager
- Golangcollege Session Manager
- Justin NoSurf Package for CSRF Protection
- Features such as search or tagging are not yet implemented. However, I am working on it.
The homepage provides an overview of the application and options to log in or register. Unregistered users can only view the snippets, but to create and save snippets, users need to register or log in if they already have an account.
Users can register by filling in the registration form. If more than one user enters the same email, an error message will be displayed indicating that the user already exists.
Users can log in to create their snippets.
Users can create and save new snippets and set expiration times.
Users can view their saved snippets.
Download the source code for "Snippetbox":
-
For Linux Only
-
FIRST, download the source code.
-
Extract the file and copy the "Snippetbox" folder.
-
Open this folder in your favorite editor (e.g., VS Code).
-
Install XAMPP and run the following command to start MySQL:
sudo /opt/lampp/lampp start
-
Open PHPMyAdmin (http://localhost/phpmyadmin)
-
Create a database named snippetbox.
-
Import the
snippetbox.sql
file into the newly created database. -
Open a terminal, navigate to your project directory, and run these two commands:
go mod tidy
go run cmd/web/*
-
Open your browser and go to http://localhost:8080/
LOGIN DETAILS
You can register a new user and log in to create new snippets.
Hopefully, you can run this project successfully. If you encounter any issues, feel free to contact me using the email link provided in the last section.
Wow, that’s amazing! Thank you so much for your interest and support.
If you’ve enjoyed working with this project, a ⭐️ would be greatly appreciated. Your support motivates me to keep improving and working on more projects.
Feel free to share any advice or thoughts you have—I’d love to hear from you!
Once again, thank you for your encouragement! 😊