{"id":20016632,"url":"https://github.com/rafaelclaumann/snippetbox","last_synced_at":"2026-04-09T18:07:02.198Z","repository":{"id":238174149,"uuid":"796028156","full_name":"RafaelClaumann/snippetbox","owner":"RafaelClaumann","description":"Project developed along the book Let's Go, by Alex Edwards.","archived":false,"fork":false,"pushed_at":"2024-06-15T12:08:23.000Z","size":7015,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T15:45:26.196Z","etag":null,"topics":["docker","docker-compose","go","mysql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RafaelClaumann.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-05-04T18:05:30.000Z","updated_at":"2024-06-15T12:08:27.000Z","dependencies_parsed_at":"2025-01-12T15:42:37.330Z","dependency_job_id":"ca23a874-671d-4f72-b9b3-5c2b6e448675","html_url":"https://github.com/RafaelClaumann/snippetbox","commit_stats":null,"previous_names":["rafaelclaumann/snippetbox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelClaumann%2Fsnippetbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelClaumann%2Fsnippetbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelClaumann%2Fsnippetbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelClaumann%2Fsnippetbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RafaelClaumann","download_url":"https://codeload.github.com/RafaelClaumann/snippetbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241451667,"owners_count":19964901,"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":["docker","docker-compose","go","mysql"],"created_at":"2024-11-13T08:12:20.956Z","updated_at":"2025-12-31T01:06:59.015Z","avatar_url":"https://github.com/RafaelClaumann.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snippetbox\n\n## About\n\n**Snippetbox** is a project developed along with the book \"Let's Go\" by Alex Edwards. It is a web application built using the Go programming language and follows best practices in web development. The project covers various aspects of building a web application, such as routing, middleware, database integration, and authentication.\n\n## Table of Contents\n\n- [Demo](#demo)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Routes](#routes)\n- [Technologies Used](#technologies-used)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Demo\n![](https://github.com/RafaelClaumann/snippetbox/blob/main/demo_snippetbox.gif)\n\n## Features\n\n- User authentication and authorization\n- Create, view, and manage code snippets\n- Secure password handling\n- Middleware implementation for enhanced functionality\n- Database integration with MySQL\n- Graceful error handling and logging\n\n## Installation\n\nTo set up Snippetbox locally, follow these steps:\n\n1. **Clone the repository:**\n    ```bash\n    git clone https://github.com/RafaelClaumann/snippetbox.git\n    cd snippetbox\n    ```\n\n2. **Run the MySQL container using Docker Compose:**\n\n   Ensure you have Docker and Docker Compose installed on your machine.\n\n   ```bash\n   docker-compose up -d\n   ```\n\n   This command will start the MySQL database in detached mode (`-d`).\n\n3. **Build and run the application:**\n    ```bash\n    go build ./cmd/web\n    ./web\n\n    # or\n\n    go run ./cmd/web\n    ```\n\n4. **To run integrated tests you need to create 'test_snippetbox' database:**\n    ```bash\n    CREATE DATABASE test_snippetbox CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n    ```\n\n5. **Running application tests:**\n    ```bash\n    go test -v ./...\n    ```    \n\n## Usage\n\nOnce the application is running, you can access it via `https://localhost:4000`. The following routes are available:\n\n## Routes\n\n| Method | URL                        | Function                | Description                                                           | Access   |\n|--------|----------------------------|-------------------------|-----------------------------------------------------------------------|----------|\n| `GET`  | `/`                        | `app.home`              | Displays the home page of the application.                            | Public   |\n| `GET`  | `/about`                   | `app.about`             | Displays the \"About\" page of the application.                         | Public   |\n| `GET`  | `/snippet/view/:id`        | `app.snippetView`       | Displays a specific snippet based on the provided ID in the URL.      | Public   |\n| `GET`  | `/user/signup`             | `app.userSignup`        | Displays the user signup form.                                        | Public   |\n| `POST` | `/user/signup`             | `app.userSignupPost`    | Processes the user signup form data.                                  | Public   |\n| `GET`  | `/user/login`              | `app.userLogin`         | Displays the user login form.                                         | Public   |\n| `POST` | `/user/login`              | `app.userLoginPost`     | Processes the user login form data.                                   | Public   |\n| `GET`  | `/account/password/update` | `app.updatePassword`    | Displays the form to update the user's password.                      | Protected|\n| `POST` | `/account/password/update` | `app.updatePasswordPost`| Processes the password update form data.                              | Protected|\n| `GET`  | `/account/view`            | `app.accountView`       | Displays the user's account information.                              | Protected|\n| `GET`  | `/snippet/create`          | `app.snippetCreate`     | Displays the form to create a new snippet.                            | Protected|\n| `POST` | `/snippet/create`          | `app.snippetCreatePost` | Processes the new snippet creation form data.                         | Protected|\n| `POST` | `/user/logout`             | `app.userLogoutPost`    | Processes the user logout, ending the session.                        | Protected|\n\n## Technologies Used\n\n- **Go**: The main programming language used for the backend.\n- **MySQL**: Used for storing user and snippet data.\n- **HTML/CSS/JavaScript**: For the front-end interface.\n- **Docker**: To facilitate containerization and deployment.\n- **GitHub Actions**: To create CI(Continuous Integration).\n\n## Contributing\n\nContributions are welcome! If you have any improvements or new features you'd like to add, please fork the repository, create a new branch, and submit a pull request. Ensure your code follows the existing style and includes tests where appropriate.\n\n---\n\nFor more information, visit the [repository](https://github.com/RafaelClaumann/snippetbox) on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelclaumann%2Fsnippetbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelclaumann%2Fsnippetbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelclaumann%2Fsnippetbox/lists"}