Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
/ snippetbox Public archive

A webpage that allows you to share snippets.

License

Notifications You must be signed in to change notification settings

edbar42/snippetbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snippetbox

Snippetbox is a web application designed to store and manage user-submitted code snippets. It leverages Go's templating engine for dynamic HTML rendering and utilizes MySQL for data storage.

The server uses self-signed certificates to handle HTTPS requests.

The script to generate these certificates comes embedded with the Go toolchain (see the Makefile under tls for details).

✨ Usage

Pre-requisites

Running the app

Clone this repository:

git clone [email protected]:edbar42/snippetbox.git

Go to the directory where you cloned the app in and install its Go dependencies:

go mod tidy

Run the make env to generate a template .env file for the project.

make env

Be sure to edit that .env file to suit your database setup.

You may then run the SQL scripts under pkg/db/migrations/mysql/.

Run the make tls script to generate self-signed TLS certificates for the HTTPS server:

make tls

Warning

Since these certificates are self-signed, your browser will (probably) give you a warning when trying to access the website.

Finally, you can use make run to start the application:

make run

Your server should now be running on https://localhost/42069 (nice).

If you would like to delete the files generated by make, simply run make clean.

make clean

Testing

To run the full test suite shipped with the app, run make test.

make test

🤝 Contributing

You can contribute by forking this repo and opening pull requests with your suggestion.

All pull requests should be submitted to the main branch.

⚖️ License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

Thanks to Alex Edwards for illustrating the development process for this app in his book Let's Go!

About

A webpage that allows you to share snippets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published