{"id":15095976,"url":"https://github.com/caknoooo/go-gin-clean-starter","last_synced_at":"2025-04-06T05:15:33.143Z","repository":{"id":181632490,"uuid":"614695448","full_name":"Caknoooo/go-gin-clean-starter","owner":"Caknoooo","description":"⭐ A simple backend implementation of Clean Code using Gin/Gorm with Dependency Injection, JWT Authentication, and Hot Auto Reload","archived":false,"fork":false,"pushed_at":"2025-03-28T03:43:18.000Z","size":18679,"stargazers_count":132,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T04:08:50.773Z","etag":null,"topics":["clean-architecture","docker","docker-compose","docker-golang","docker-images","docker-implementation","gin-gonic","golang-application","gorm","hot-reload","logger","logger-interface","postgresql","restful-api","template"],"latest_commit_sha":null,"homepage":"https://documenter.getpostman.com/view/29665461/2s9YJaZQCG","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/Caknoooo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-16T05:54:41.000Z","updated_at":"2025-03-30T00:11:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf3d1fc5-d169-4dd2-91ae-f0a81072d313","html_url":"https://github.com/Caknoooo/go-gin-clean-starter","commit_stats":{"total_commits":102,"total_committers":1,"mean_commits":102.0,"dds":0.0,"last_synced_commit":"a1d713fb47884c2a04e3899a2173bff644a7e279"},"previous_names":["caknoooo/golang-clean-template","caknoooo/go-gin-clean-template","caknoooo/go-gin-clean-architecture","caknoooo/go-gin-clean-starter"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caknoooo%2Fgo-gin-clean-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caknoooo%2Fgo-gin-clean-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caknoooo%2Fgo-gin-clean-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caknoooo%2Fgo-gin-clean-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Caknoooo","download_url":"https://codeload.github.com/Caknoooo/go-gin-clean-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436285,"owners_count":20938533,"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":["clean-architecture","docker","docker-compose","docker-golang","docker-images","docker-implementation","gin-gonic","golang-application","gorm","hot-reload","logger","logger-interface","postgresql","restful-api","template"],"created_at":"2024-09-25T15:44:30.161Z","updated_at":"2025-04-06T05:15:32.934Z","avatar_url":"https://github.com/Caknoooo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Gin Gorm Starter\nYou can join in the development (Open Source). **Let's Go!!!**\n\n## Introduction 👋\n\u003e Clean Architecture is an approach to organizing code in an application that focuses on separating responsibilities and dependencies between components. In the context of Golang, Clean Architecture refers to the application of Clean Architecture principles in developing applications using the Go programming language.\n\n\n![image](https://github.com/user-attachments/assets/0b011bcc-f9c6-466e-a9da-964cce47a8bc)\n\n## Logs Feature 📋\n\nThe application includes a built-in logging system that allows you to monitor and track system queries. You can access the logs through a modern, user-friendly interface.\n\n### Accessing Logs\nTo view the logs:\n1. Make sure the application is running\n2. Open your browser and navigate to:\n```bash\nhttp://your-domain/logs\n```\n\n### Features\n- **Monthly Filtering**: Filter logs by selecting different months\n- **Real-time Refresh**: Instantly refresh logs with the refresh button\n- **Expandable Entries**: Click on any log entry to view its full content\n- **Modern UI**: Clean and responsive interface with glass-morphism design\n\n![Logs Interface](https://github.com/user-attachments/assets/adda0afb-a1e4-4e05-b44e-87225fe63309)\n\n\n## Prerequisite 🏆\n- Go Version `\u003e= go 1.20`\n- PostgreSQL Version `\u003e= version 15.0`\n\n## How To Use\n1. Clone the repository or **Use This Template**\n  ```bash\n  git clone https://github.com/Caknoooo/go-gin-clean-starter.git\n  ```\n2. Navigate to the project directory:\n  ```bash\n  cd go-gin-clean-starter\n  ```\n3. Copy the example environment file and configure it:\n  ```bash \n  cp .env.example .env\n  ```\nThere are 2 ways to do running\n### With Docker\n1. Build Docker\n  ```bash\n  make up\n  ```\n2. Run Initial UUID V4 for Auto Generate UUID\n  ```bash\n  make init-uuid\n  ```\n3. Run Migration and Seeder\n  ```bash\n  make migrate-seed\n  ```\n\n### Without Docker\n1. Configure `.env` with your PostgreSQL credentials:\n  ```bash\n  DB_HOST=localhost\n  DB_USER=postgres\n  DB_PASS=\n  DB_NAME=\n  DB_PORT=5432\n  ```\n2. Open the terminal and follow these steps:\n  - If you haven't downloaded PostgreSQL, download it first.\n  - Run:\n    ```bash\n    psql -U postgres\n    ```\n  - Create the database according to what you put in `.env` =\u003e if using uuid-ossp or auto generate (check file **/entity/user.go**):\n    ```bash\n    CREATE DATABASE your_database;\n    \\c your_database\n    CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"; // remove default:uuid_generate_v4() if you not use you can uncomment code in user_entity.go\n    \\q\n    ``` \n3. Run the application:\n  ```bash\n  go run main.go\n  ```\n\n## Run Migrations, Seeder, and Script\nTo run migrations, seed the database, and execute a script while keeping the application running, use the following command:\n\n```bash\ngo run main.go --migrate --seed --run --script:example_script\n```\n\n- ``--migrate`` will apply all pending migrations.\n- ``--seed`` will seed the database with initial data.\n- ``--script:example_script`` will run the specified script (replace ``example_script`` with your script name).\n- ``--run`` will ensure the application continues running after executing the commands above.\n\n#### Migrate Database \nTo migrate the database schema \n```bash\ngo run main.go --migrate\n```\nThis command will apply all pending migrations to your PostgreSQL database specified in `.env`\n\n#### Seeder Database \nTo seed the database with initial data:\n```bash\ngo run main.go --seed\n```\nThis command will populate the database with initial data using the seeders defined in your application.\n\n#### Script Run\nTo run a specific script:\n```bash\ngo run main.go --script:example_script\n```\nReplace ``example_script`` with the actual script name in **script.go** at script folder\n\nIf you need the application to continue running after performing migrations, seeding, or executing a script, always append the ``--run`` option.\n\n## What did you get?\nBy using this template, you get a ready-to-go architecture with pre-configured endpoints. The template provides a structured foundation for building your application using Golang with Clean Architecture principles.\n\n### Postman Documentation\nYou can explore the available endpoints and their usage in the [Postman Documentation](https://documenter.getpostman.com/view/29665461/2s9YJaZQCG). This documentation provides a comprehensive overview of the API endpoints, including request and response examples, making it easier to understand how to interact with the API.\n\n### Issue / Pull Request Template\n\nThe repository includes templates for issues and pull requests to standardize contributions and improve the quality of discussions and code reviews.\n\n- **Issue Template**: Helps in reporting bugs or suggesting features by providing a structured format to capture all necessary information.\n- **Pull Request Template**: Guides contributors to provide a clear description of changes, related issues, and testing steps, ensuring smooth and efficient code reviews.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaknoooo%2Fgo-gin-clean-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaknoooo%2Fgo-gin-clean-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaknoooo%2Fgo-gin-clean-starter/lists"}