Loading repository data…
Loading repository data…
BenaliOssama / repository
An open-source Snippetbox, built with Go, inspired by the book Let's Go by Alex Edwards (2022). Designed as a hands-on learning project for developers to explore web development with Go. Contributions and feedback are welcome!
SnippetBox is an open-source web application for managing and sharing code snippets. This project is inspired by the work of Alex Edwards, based on his book "Let's Go!" and his original SnippetBox application. This version is modified to use SQLite3 instead of MySQL and minimal dependencies to provide a lightweight and simple solution.
/cmd/web/ - Contains the main entry point for the application, with the main package and HTTP request handlers for managing snippets./internal/models/ - Defines data models and handles interactions with SQLite3 for storing and retrieving snippets./internal/sessions/ - A simplified, custom session management system, based on the core concepts from Alex Edwards' original scs package, but further reduced for educational purposes./internal/store/ - Contains the logic for interacting with the SQLite3 database, including storing and retrieving data for sessions and snippets./internal/validator/ - Provides validation functionality for user input, ensuring that data adheres to the correct format before being processed. mkdir tls
cd tls
and then To generate TLS certificates for localhost, run the following command:
go run $(go env GOROOT)/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost
This project was inspired by Alex Edwards' "Let's Go!" book and his original SnippetBox project. It is a simplified, functional implementation of the concepts he introduced, with a specific focus on:
scs package, but reduced and modified to work with SQLite3 for educational purposes. make run
or:
Clone the repository:
git clone https://github.com/BenaliOssama/myforum.git
cd myforum
Install the dependencies:
go mod tidy
Create and migrate the SQLite database: (not implemented yet)
go run ./cmd/migrate/main.go
Run the application:
make run
Open your browser and go to http://localhost:9999 to access the application.
This project is based on the original work by Alex Edwards, whose book "Let's Go!" and code from the SnippetBox project inspired much of this work. The session management in this project is heavily influenced by the Alex Edwards' scs package, which has been modified for this project to work with SQLite3.
Many thanks to Alex Edwards for his excellent resources and contributions to the Go community!
This project is licensed under the MIT License - see the LICENSE file for details.