{"id":25051170,"url":"https://github.com/benaliossama/snippetbox","last_synced_at":"2026-02-16T16:10:26.880Z","repository":{"id":266110469,"uuid":"897420004","full_name":"BenaliOssama/snippetbox","owner":"BenaliOssama","description":"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!","archived":false,"fork":false,"pushed_at":"2025-01-28T19:53:23.000Z","size":172,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T05:28:38.805Z","etag":null,"topics":["backend","css","frontend","go","html","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenaliOssama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-02T15:46:50.000Z","updated_at":"2025-02-10T11:32:23.000Z","dependencies_parsed_at":"2025-03-31T05:36:58.338Z","dependency_job_id":null,"html_url":"https://github.com/BenaliOssama/snippetbox","commit_stats":null,"previous_names":["benaliossama/myforum","benaliossama/snippetbox"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenaliOssama%2Fsnippetbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenaliOssama%2Fsnippetbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenaliOssama%2Fsnippetbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenaliOssama%2Fsnippetbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenaliOssama","download_url":"https://codeload.github.com/BenaliOssama/snippetbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252802318,"owners_count":21806473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","css","frontend","go","html","sqlite"],"created_at":"2025-02-06T09:43:51.389Z","updated_at":"2026-02-16T16:10:26.839Z","avatar_url":"https://github.com/BenaliOssama.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SnippetBox\n\n**SnippetBox** is an open-source web application for managing and sharing code snippets. This project is inspired by the work of [Alex Edwards](https://www.alexedwards.net/), 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.\n\n## Features\n\n- Simple and efficient session management using SQLite.\n- Built with minimal external dependencies to make it easier to learn and understand.\n\n\n## Project Structure\n\n- `/cmd/web/` - Contains the main entry point for the application, with the `main` package and HTTP request handlers for managing snippets.\n- `/internal/models/` - Defines data models and handles interactions with SQLite3 for storing and retrieving snippets.\n- `/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.\n- `/internal/store/` - Contains the logic for interacting with the SQLite3 database, including storing and retrieving data for sessions and snippets.\n- `/internal/validator/` - Provides validation functionality for user input, ensuring that data adheres to the correct format before being processed.\n\n## security \n## Generating Certificates\n```bash\n   mkdir tls\n   cd tls\n```\nand then To generate TLS certificates for localhost, run the following command:\n\n```bash\n go run $(go env GOROOT)/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost\n```\n## Motivation\n\nThis 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:\n\n- Using **SQLite3** for data storage instead of MySQL.\n- Stripping down unnecessary dependencies and code to make the project easy to understand and focus on the core concepts.\n- Custom session management, based on the core ideas from Alex Edwards' `scs` package, but reduced and modified to work with SQLite3 for educational purposes.\n\n## Getting Started\n\n### Prerequisites\n\n- Go 1.18 or higher.\n- SQLite3 database.\n\n### Installation\n## default configuratio\n```bash\n   make run\n```\nor: \n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/BenaliOssama/myforum.git\n   cd myforum\n   ```\n\n2. Install the dependencies:\n\n   ```bash\n   go mod tidy\n   ```\n\n3. Create and migrate the SQLite database: (not implemented yet)\n\n   ```bash\n   go run ./cmd/migrate/main.go\n   ```\n\n4. Run the application:\n\n   ```bash\n   make run\n   ```\n\n5. Open your browser and go to `http://localhost:9999` to access the application.\n\n## Acknowledgments\n\nThis project is based on the original work by **[Alex Edwards](https://www.alexedwards.net/)**, 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](https://github.com/alexedwards/scs), which has been modified for this project to work with SQLite3.\n\nMany thanks to Alex Edwards for his excellent resources and contributions to the Go community!\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenaliossama%2Fsnippetbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenaliossama%2Fsnippetbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenaliossama%2Fsnippetbox/lists"}