{"id":21427854,"url":"https://github.com/dimasprasetyo71/golang_nextjs","last_synced_at":"2026-05-14T13:35:24.782Z","repository":{"id":264139174,"uuid":"884504539","full_name":"Dimasprasetyo71/golang_nextjs","owner":"Dimasprasetyo71","description":"project golang backend implementasi golang framework gin dan ","archived":false,"fork":false,"pushed_at":"2024-12-16T16:35:33.000Z","size":8093,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"vercel","last_synced_at":"2025-01-23T07:47:41.494Z","etag":null,"topics":["api","ci-cd","controller","dto","environment","gin-gonic","golang","makefile","testing","validation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dimasprasetyo71.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T21:49:29.000Z","updated_at":"2024-12-23T18:24:13.000Z","dependencies_parsed_at":"2024-11-22T08:43:28.967Z","dependency_job_id":null,"html_url":"https://github.com/Dimasprasetyo71/golang_nextjs","commit_stats":null,"previous_names":["dimasprasetyo71/golang_nextjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimasprasetyo71%2Fgolang_nextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimasprasetyo71%2Fgolang_nextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimasprasetyo71%2Fgolang_nextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimasprasetyo71%2Fgolang_nextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dimasprasetyo71","download_url":"https://codeload.github.com/Dimasprasetyo71/golang_nextjs/tar.gz/refs/heads/vercel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933734,"owners_count":20371051,"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":["api","ci-cd","controller","dto","environment","gin-gonic","golang","makefile","testing","validation"],"created_at":"2024-11-22T22:07:23.319Z","updated_at":"2025-10-16T03:39:10.479Z","avatar_url":"https://github.com/Dimasprasetyo71.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gin Web Framework\n\n# Project Folder Structure\n\nThis document provides an overview of the project folder structure golang gin framework.\n```sh \n📦config\n ┣ 📂fakers\n ┃ ┣ 📜addres.go\n ┃ ┣ 📜product.fakers.go\n ┃ ┗ 📜user.fakers.go\n ┣ 📂seeders\n ┃ ┗ 📜seders.go\n ┗ 📜database.go\n 📦deployment\n ┗ 📜docker-compose.yml\n 📦controllers\n ┣ 📜addresController.go\n ┣ 📜CategoryController.go\n ┣ 📜ProductControllers.go\n ┣ 📜ProductImageControllers.go\n ┗ 📜UserControllers.go\n 📦repositories\n ┣ 📜addres_repository.go\n ┣ 📜categoy.repository.go\n ┣ 📜productimage.go\n ┣ 📜product_repository.go\n ┗ 📜user_repository.go\n 📦models\n ┣ 📜addres.go\n ┣ 📜category.go\n ┣ 📜payment.go\n ┣ 📜product.go\n ┣ 📜productimages.go\n ┗ 📜user.go\n 📦docs\n ┣ 📜product.yaml\n ┗ 📜user.yaml\n 📦dto\n ┣ 📜addres_dto.go\n ┣ 📜category_dto.go\n ┣ 📜midtrans.dto.go\n ┣ 📜product_dto.go\n ┣ 📜product_image_dto.go\n ┗ 📜user_dto.go\n 📦services\n ┣ 📜category_service.go\n ┣ 📜product_service.go\n ┗ 📜user_service.go\n 📦middleware\n ┣ 📜auth.go\n ┣ 📜error.handling.go\n ┗ 📜rate.limiting.go\n 📦validations\n ┣ 📜addres_validation.go\n ┣ 📜category_validation.go\n ┣ 📜productimage_validation.go\n ┣ 📜product_validation.go\n ┗ 📜user_validation.go\n 📦utils\n ┣ 📜generate.slug.go\n ┣ 📜jwt.token.go\n ┣ 📜logger.go\n ┗ 📜random.go\n 📦helpers\n ┣ 📜formatter.go\n ┣ 📜json.go\n ┣ 📜parser.go\n ┗ 📜string.go\n 📦testing\n ┣ 📜address_testing.go\n ┣ 📜category_testing.go\n ┣ 📜test.go\n ┗ 📜user_testing.go\n 📦routes\n ┗ 📜route.go\n```\n\n## Root Folders and Files\n\n- `.github/`: Contains GitHub configuration files such as workflows for CI/CD pipelines.\n- `.vercel/`: Configuration files for Vercel deployment.\n- `.vscode/`: Settings and configurations for VS Code workspace.\n- `cmd/`: Contains the entry point for the application, typically a main file for launching services.\n- `config/`: Configuration files and settings (e.g., database configuration, application settings).\n- `controllers/`: Controller files that handle requests and responses.\n- `deployment/`: Docker, Kubernetes, and other deployment-related files.\n- `docs/`: Documentation files, possibly including API documentation.\n- `dto/`: Data Transfer Objects, used for structuring data that’s sent or received.\n- `go/`: A general folder for Go-related dependencies or tools.\n- `helpers/`: Helper functions or utilities used across the application.\n- `middleware/`: Middleware functions for request processing (e.g., authentication, logging).\n- `models/`: Models representing the structure of database tables or domain objects.\n- `repositories/`: Repository layer for data access logic.\n- `routes/`: Routing files that define the API endpoints and link them to controllers.\n- `services/`: Service layer containing business logic.\n- `testing/`: Contains testing files and related configurations.\n- `utils/`: Utility functions or classes used throughout the project.\n- `validations/`: Validation rules and schemas for input data validation.\n\n## Root Files\n\n- `.env`: Environment variables for sensitive configurations.\n- `.gitignore`: Specifies files and folders to be ignored by Git.\n- `code_of_conduct.md`: Project code of conduct.\n- `CONTRIBUTING.md`: Guidelines for contributing to the project.\n- `Dockerfile`: Docker configuration for containerizing the application.\n- `go.mod`: Module file listing dependencies.\n- `go.sum`: Sum file for dependency verification.\n- `LICENSE`: Project license file.\n- `LICENSE.txt`: Text-based license file.\n- `main.go`: Main entry point for the Go application.\n- `makefile`: A makefile for build automation.\n- `README.md`: Project overview, setup instructions, and documentation.\n- `SECURITY.md`: Security policy or guidelines for reporting vulnerabilities.\n- `swagger.yaml`: Swagger configuration file for API documentation.\n\n## Additional Files\n\n\u003c!-- BY DIMAS PRASETYO --\u003e\n\n\u003cimg align=\"right\" width=\"159px\" src=\"https://raw.githubusercontent.com/gin-gonic/logo/master/color.png\"\u003e\n\n[![Build Status](https://github.com/gin-gonic/gin/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/gin-gonic/gin/actions?query=branch%3Amaster)\n[![codecov](https://codecov.io/gh/gin-gonic/gin/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-gonic/gin)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gin-gonic/gin)](https://goreportcard.com/report/github.com/gin-gonic/gin)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gin-gonic/gin?status.svg)](https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc)\n[![Sourcegraph](https://sourcegraph.com/github.com/gin-gonic/gin/-/badge.svg)](https://sourcegraph.com/github.com/gin-gonic/gin?badge)\n[![Open Source Helpers](https://www.codetriage.com/gin-gonic/gin/badges/users.svg)](https://www.codetriage.com/gin-gonic/gin)\n[![Release](https://img.shields.io/github/release/gin-gonic/gin.svg?style=flat-square)](https://github.com/gin-gonic/gin/releases)\n[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/gin-gonic/gin)](https://www.tickgit.com/browse?repo=github.com/gin-gonic/gin)\n\nGin is a web framework written in [Go](https://go.dev/). It features a martini-like API with performance that is up to 40 times faster thanks to [httprouter](https://github.com/julienschmidt/httprouter).\nIf you need performance and good productivity, you will love Gin.\n\n**Gin's key features are:**\n\n- authentication\n- JWT TOKEN\n- Login with goggle\n- login with github\n- docker\n- Route grouping\n- Error management\n- Built-in rendering\n- ecomerce \n\n\n## Getting started\n\n### Prerequisites\n\nGin requires [Go](https://go.dev/) version [1.21](https://go.dev/doc/devel/release#go1.21.0) or above.\n\n### Getting Gin\n\nWith [Go's module support](https://go.dev/wiki/Modules#how-to-use-modules), `go [build|run|test]` automatically fetches the necessary dependencies when you add the import in your code:\n\n```sh\nimport \"github.com/gin-gonic/gin\"\n```\n\nAlternatively, use `go get`:\n\n```sh\ngo get -u github.com/gin-gonic/gin\n```\n\n### how to clone you project \n\n```sh\n     git clone https://github.com/Dimasprasetyo71/golang_nextjs?tab=security-ov-file\n    #  install all \n     go get \n    # running port you golang \n    go run main.go\n```\n\n### Running Gin\n\nA basic example:\n\n```go\npackage main\n\nimport (\n  \"net/http\"\n\n  \"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n\t// Load environment variables\n\tif err := godotenv.Load(); err != nil {\n\t\tlog.Fatal(\"Error loading .env file\")\n\t}\n\n\tport := os.Getenv(\"GOLANG_PORT\")\n\tif port == \"\" {\n\t\tlog.Fatal(\"$GOLANG_PORT must be set\")\n\t}\n\n\trouter := gin.New()\n\trouter.Use(cors.Default())\n\trouter.Use(middleware.ErrorHandlerMiddleware())\n\trouter.Use(middleware.RateLimitMiddleware())\n\n    db := config.ConnectDB()\n\tgin.SetMode(gin.ReleaseMode)\n\n\n\t// Set up routes\n\troutes.UserRoutes(router, db)\n\troutes.AddressRoutes(router, db)\n\troutes.CategoryRoutes(router, db)\n\troutes.ProductImageRoutes(router, db)\n\troutes.ProductRoutes(router, db)\n\n\t// Set up seeders\n\t// seeders.DBSeed(db)\n\n\trouter.GET(\"/\", func(c *gin.Context) {\n\t\tc.JSON(http.StatusOK, gin.H{\n\t\t\t\"message\": \"Hello World!\",\n\t\t})\n\t})\n\trouter.Static(\"/swagger-ui\", \"./static/swagger-ui\")\n\trouter.GET(\"/swagger.yaml\", func(c *gin.Context) {\n    c.File(\"./swagger.yaml\")\n\t})\n\n\tlog.Println(\"Server running on port \" + port)\n\tif err := router.Run(\":\" + port); err != nil {\n\t\tlog.Fatal(\"Failed to run server: \", err)\n\t}\n}\n\n```\n\nTo run the code, use the `go run` command, like:\n\n```sh\n$ go run main.go\n```\n\n2024/11/06 23:29:34 Server running on port localhost:3000\n\n### See more examples\n\n#### Quick Start\n\nLearn and practice with the [Gin Quick Start](docs/doc.md), which includes API examples and builds tag.\n\n#### Examples\n\nA number of ready-to-run examples demonstrating various use cases of Gin are available in the [Gin examples](https://github.com/gin-gonic/examples) repository.\n\n## Documentation\n\nSee the [API documentation on go.dev](https://pkg.go.dev/github.com/gin-gonic/gin).\n\nThe documentation is also available on [gin-gonic.com](https://gin-gonic.com) in several languages:\n\n- [English](https://gin-gonic.com/docs/)\n- [简体中文](https://gin-gonic.com/zh-cn/docs/)\n- [繁體中文](https://gin-gonic.com/zh-tw/docs/)\n- [日本語](https://gin-gonic.com/ja/docs/)\n- [Español](https://gin-gonic.com/es/docs/)\n- [한국어](https://gin-gonic.com/ko-kr/docs/)\n- [Turkish](https://gin-gonic.com/tr/docs/)\n- [Persian](https://gin-gonic.com/fa/docs/)\n- [Português](https://gin-gonic.com/pt/docs/)\n\n### Articles\n\n- [Tutorial: Developing a RESTful API with Go and Gin](https://go.dev/doc/tutorial/web-service-gin)\n\n## Benchmarks\n\nGin uses a custom version of [HttpRouter](https://github.com/julienschmidt/httprouter), [see all benchmarks](/BENCHMARKS.md).\n\n| Benchmark name                 |       (1) |             (2) |          (3) |             (4) |\n| ------------------------------ | ---------:| ---------------:| ------------:| ---------------:|\n| BenchmarkGin_GithubAll         | **43550** | **27364 ns/op** |   **0 B/op** | **0 allocs/op** |\n| BenchmarkAce_GithubAll         |     40543 |     29670 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkAero_GithubAll        |     57632 |     20648 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkBear_GithubAll        |      9234 |    216179 ns/op |   86448 B/op |   943 allocs/op |\n| BenchmarkBeego_GithubAll       |      7407 |    243496 ns/op |   71456 B/op |   609 allocs/op |\n| BenchmarkBone_GithubAll        |       420 |   2922835 ns/op |  720160 B/op |  8620 allocs/op |\n| BenchmarkChi_GithubAll         |      7620 |    238331 ns/op |   87696 B/op |   609 allocs/op |\n| BenchmarkDenco_GithubAll       |     18355 |     64494 ns/op |   20224 B/op |   167 allocs/op |\n| BenchmarkEcho_GithubAll        |     31251 |     38479 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkGocraftWeb_GithubAll  |      4117 |    300062 ns/op |  131656 B/op |  1686 allocs/op |\n| BenchmarkGoji_GithubAll        |      3274 |    416158 ns/op |   56112 B/op |   334 allocs/op |\n| BenchmarkGojiv2_GithubAll      |      1402 |    870518 ns/op |  352720 B/op |  4321 allocs/op |\n| BenchmarkGoJsonRest_GithubAll  |      2976 |    401507 ns/op |  134371 B/op |  2737 allocs/op |\n| BenchmarkGoRestful_GithubAll   |       410 |   2913158 ns/op |  910144 B/op |  2938 allocs/op |\n| BenchmarkGorillaMux_GithubAll  |       346 |   3384987 ns/op |  251650 B/op |  1994 allocs/op |\n| BenchmarkGowwwRouter_GithubAll |     10000 |    143025 ns/op |   72144 B/op |   501 allocs/op |\n| BenchmarkHttpRouter_GithubAll  |     55938 |     21360 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkHttpTreeMux_GithubAll |     10000 |    153944 ns/op |   65856 B/op |   671 allocs/op |\n| BenchmarkKocha_GithubAll       |     10000 |    106315 ns/op |   23304 B/op |   843 allocs/op |\n| BenchmarkLARS_GithubAll        |     47779 |     25084 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkMacaron_GithubAll     |      3266 |    371907 ns/op |  149409 B/op |  1624 allocs/op |\n| BenchmarkMartini_GithubAll     |       331 |   3444706 ns/op |  226551 B/op |  2325 allocs/op |\n| BenchmarkPat_GithubAll         |       273 |   4381818 ns/op | 1483152 B/op | 26963 allocs/op |\n| BenchmarkPossum_GithubAll      |     10000 |    164367 ns/op |   84448 B/op |   609 allocs/op |\n| BenchmarkR2router_GithubAll    |     10000 |    160220 ns/op |   77328 B/op |   979 allocs/op |\n| BenchmarkRivet_GithubAll       |     14625 |     82453 ns/op |   16272 B/op |   167 allocs/op |\n| BenchmarkTango_GithubAll       |      6255 |    279611 ns/op |   63826 B/op |  1618 allocs/op |\n| BenchmarkTigerTonic_GithubAll  |      2008 |    687874 ns/op |  193856 B/op |  4474 allocs/op |\n| BenchmarkTraffic_GithubAll     |       355 |   3478508 ns/op |  820744 B/op | 14114 allocs/op |\n| BenchmarkVulcan_GithubAll      |      6885 |    193333 ns/op |   19894 B/op |   609 allocs/op |\n\n- (1): Total Repetitions achieved in constant time, higher means more confident result\n- (2): Single Repetition Duration (ns/op), lower is better\n- (3): Heap Memory (B/op), lower is better\n- (4): Average Allocations per Repetition (allocs/op), lower is better\n\n## Middleware\n\nYou can find many useful Gin middlewares at [gin-contrib](https://github.com/gin-contrib).\n\n## Uses\n\nHere are some awesome projects that are using the [Gin](https://github.com/gin-gonic/gin) web framework.\n\n- [gorush](https://github.com/appleboy/gorush): A push notification server.\n- [fnproject](https://github.com/fnproject/fn): A container native, cloud agnostic serverless platform.\n- [photoprism](https://github.com/photoprism/photoprism): Personal photo management powered by Google TensorFlow.\n- [lura](https://github.com/luraproject/lura): Ultra performant API Gateway with middleware.\n- [picfit](https://github.com/thoas/picfit): An image resizing server.\n- [dkron](https://github.com/distribworks/dkron): Distributed, fault tolerant job scheduling system.\n\n## Contributing\n\nGin is the work of hundreds of contributors. We appreciate your help!\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimasprasetyo71%2Fgolang_nextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimasprasetyo71%2Fgolang_nextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimasprasetyo71%2Fgolang_nextjs/lists"}