{"id":15096099,"url":"https://github.com/illud/gojira","last_synced_at":"2026-01-12T00:42:52.890Z","repository":{"id":43910162,"uuid":"378329395","full_name":"illud/gojira","owner":"illud","description":"Gojira is a cli tool to create clean architecture app for you including gin-gonic, bcrypt and jwt.","archived":false,"fork":false,"pushed_at":"2023-08-18T23:27:26.000Z","size":91,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T22:15:44.602Z","etag":null,"topics":["bcrypt","clean-architecture","gin","gin-gonic","go","golang","gorm","jwt","mysql","prisma","prisma-client","prisma-client-go"],"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/illud.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":null,"support":null,"governance":null}},"created_at":"2021-06-19T05:14:47.000Z","updated_at":"2023-11-20T16:36:51.000Z","dependencies_parsed_at":"2023-08-19T00:26:22.466Z","dependency_job_id":null,"html_url":"https://github.com/illud/gojira","commit_stats":null,"previous_names":["illud/gojira","saturnavt/gojira"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illud%2Fgojira","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illud%2Fgojira/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illud%2Fgojira/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illud%2Fgojira/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/illud","download_url":"https://codeload.github.com/illud/gojira/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968917,"owners_count":21191162,"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":["bcrypt","clean-architecture","gin","gin-gonic","go","golang","gorm","jwt","mysql","prisma","prisma-client","prisma-client-go"],"created_at":"2024-09-25T15:45:27.327Z","updated_at":"2026-01-12T00:42:52.853Z","avatar_url":"https://github.com/illud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gojira\n\n![](https://raw.githubusercontent.com/illud/eskolvar.github.io/main/assets/img/gojira.png)\n\n[![Test Status](https://github.com/illud/gojira/actions/workflows/go.yml/badge.svg)](https://github.com/illud/gojira/actions/workflows/go.yml/badge.svg)\n[![GoDoc](https://pkg.go.dev/badge/github.com/illud/gojira?status.svg)](https://pkg.go.dev/github.com/illud/gojira?tab=doc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/illud/gojira)](https://goreportcard.com/report/github.com/illud/gojira)\n## Create project with Clean Architecture folder structure\n\n\\\nGojira is a cli tool to create clean architecture app for you including gin-gonic, bcrypt and jwt.\n\n- Creates Clean Architecture project for you\n\n\n## Features\n- Clean Architecture Folder Structure (https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)\n- Gin Gonic (https://github.com/gin-gonic/gin)\n- [Swagger](#swagger) (https://github.com/swaggo/gin-swagger)\n- Jwt (https://github.com/dgrijalva/jwt-go)\n- Bcrypt (https://golang.org/x/crypto/bcrypt)\n- [Async](#async) - Async functions\n- Auto add swagger for your endpoint\n- [Modules](#modules) - Auto generate module with crud flow\n- [Database Service](#database-service) - Auto generate db service client \n  - Mysql\n  - Gorm\n  - Prisma\n- Example tasks api\n- [Testing](#testing)  (Auto generate test example when creating a new modules)\n\n## Installation\n\nGojira requires [Go](https://golang.org/) v1.11+ to run.\n\nInstall the dependencies.\n\n```sh\ngo get github.com/illud/gojira\n```\nOr\n\n```sh\ngo install github.com/illud/gojira@latest\n```\n## How to use\n\nIn your terminal type to see all avaible commands:\n\n```sh\ngojira\n```\n\nTo create a new gin-gonic with clean architecture project(This includes a crud example with the name of Tasks):\n\n```\n[x] New project\n[ ] Module\n[ ] Module with crud\n[ ] DB service\n\nEnter Project Name: yourprojectname\n```\n\n## Modules\nTo create a new module with simple example flow:\nplease use snake_case when the module name consist of two or more words\n\n```\n[ ] New project\n[x] Module\n[ ] Module with crud\n[ ] DB service\n\nEnter Module Name: your_module_name\n```\n\nTo create a new module with crud flow:\nplease use snake_case when the module name consist of two or more words\n```\n[ ] New project\n[ ] Module\n[x] Module with crud\n[ ] DB service\n\nEnter Module Name: your_module_name\n```\n\n## Database service\nTo create a new db service client with Mysql, Gorm or Prisma:\n\n```\n[ ] New project\n[ ] Module\n[ ] Module with crud\n[x] DB service\n```\n\nMysql - to learn more visit (https://github.com/go-sql-driver/mysql)\n```\nEnter DB(mysql, gorm or prisma) Name: mysql\n```\n\nGorm - to learn more visit (https://github.com/jinzhu/gorm)\n```\nEnter DB(mysql, gorm or prisma) Name: gorm\n```\n\nPrisma - to learn more visit (https://github.com/prisma/prisma-client-go)\n```\nEnter DB(mysql, gorm or prisma) Name: prisma\n```\n\n## This will generate a database connection in infraestructure/databases/client.go\n\n\u003cbr/\u003e\n\n### For Mysql and Gorm import the service in your repository like for example:\n\n```go\ndb \"github.com/yourProjectName/infraestructure/databases\"\n```\n\nExample for Mysql:\n```go\n// Insert new tasks\nres, err := db.Client().Exec(\"INSERT INTO tasks VALUES(DEFAULT, 'Title', 'Desc')\")\nif err != nil {\n  fmt.Println(\"ERROR: \", err)\n}\nfmt.Println(res)\n```\nTo learn more visit (https://github.com/go-sql-driver/mysql)\n\n\u003cbr/\u003e\n\nExample for Gorm:\n```go\n// Insert new tasks\nerr := db.Client().Save(\u0026tasksEntity.Task{\n  Title:       \"TEST\",\n  Description: \"This is a description\",\n})\n\nif err != nil {\n  fmt.Println(err)\n}\n```\nTo learn more visit (https://github.com/jinzhu/gorm)\n\n\u003cbr/\u003e\n\nFor prisma import:\n```go\ndbClient \"github.com/yourProjectName/infraestructure/databases\"\n\"github.com/yourProjectName/infraestructure/databases/prisma/db\"\n```\nExample for prisma:\n```go\n// Insert new tasks\ncreatedTask, err := dbClient.Client().Tasks.CreateOne(\n  db.Tasks.Title.Set(\"Hi from Prisma!\"),\n  db.Tasks.Description.Set(\"Prisma is a database toolkit and makes databases easy.\"),\n).Exec(dbClient.Context)\n\nif err != nil {\n  fmt.Println(err)\n}\n\nresult, _ := json.MarshalIndent(createdTask, \"\", \"  \")\nfmt.Printf(\"created task: %s\\n\", result)\n```\nTo learn more visit (https://github.com/prisma/prisma-client-go)\n\n\u003cbr/\u003e\n\n## Async\nHow to use async:\n\n```go\npackage main\n\nimport async \"github.com/yourProjectName/utils/async\"\n\n//This functions wait 3 seconds to return 1\nfunc DoneAsync() int {\n\tfmt.Println(\"Warming up ...\")\n\ttime.Sleep(3 * time.Second)\n\tfmt.Println(\"Done ...\")\n\treturn 1\n}\n\nfunc main() {\n\tfmt.Println(\"Let's start ...\")\n\n  //Here you call the function as async function\n\tfuture := async.Exec(func() interface{} {\n\t\treturn DoneAsync()//The function that will await\n\t}).Await()\n\n\tfmt.Println(\"Done is running ...\")\n\tfmt.Println(future)\n}\n```\n\n# Swagger\n\nBuild your application and after that, go to http://localhost:5000/swagger/index.html , you to see your Swagger UI.\n\nWhen you create a new module swagger will be added automatically then you only need to modified what you need, but remember each time you modified swagger use the next command \n\n```shell\nswag init\n```\nTo learn more visit (https://github.com/swaggo/gin-swagger)\n\n\u003cbr/\u003e\n\n# Testing\n\nTo run tests use\n```go\ngo test -v ./...\n```\nTo get coverage\n```go\ngo test -v -cover --coverprofile=coverage.out  -coverpkg=./... ./...\n```\nTo view test coverage on your browser\n```go\ngo tool cover -html=coverage.out\n```\nTotal coverage\n\nWindows\n```go\ngo tool cover -func=coverage.out | findstr total:\n```\nLinux\n```go\ngo tool cover -func=coverage.out | grep total:\n```\n\nFolder Structure:\n\n```\n\n|-- controller\n|        |      \n|        |-tasks --\u003e This is and example package(Create your own packages)\n|            |       \n|            |-tasks.controller.go --\u003e This is and example controller file(Create your own controllers)\n|            \n|-- domain\n|      |\n|      |-usecase\n|            |\n|            |-tasks --\u003e This is and example package(Create your own packages)\n|                | \n|                |-task.usecase.go --\u003e This is and example usecase file(Create your own usecases)\n|\n|-- infraestructure\n|           |\n|           |-databases\n|           |      |\n|           |      |-client.go\n|           |\n|           |-entities\n|           |      |\n|           |      |-tasks --\u003e This is and example package(Create your own packages)\n|           |          |\n|           |          |-tasks.entity.go --\u003e This is and example entity file(Create your own entity)\n|           |\n|           |-respository\n|                  |\n|                  |-tasks --\u003e This is and example package(Create your own packages)\n|                      | \n|                      |-tasks.repository.go --\u003e This is and example repository file(Create your own repositories)\n|                       \n|-- utils\n|       |\n|       |-async\n|       |    |\n|       |    |-async.go\n|       |\n|       |-errors\n|       |    |\n|       |    |-errros.go\n|       |\n|       |-services\n|               |\n|               |-jwt\n|               |   |\n|               |   |-jwt.go\n|               |\n|               |-bcrypt\n|                   |\n|                   |-bcrypt.go\n|\n|-- env\n|     |\n|     |-env.go --\u003e This is the env service\n|\n|\n|-- routing\n|       |\n|       |-routing.go --\u003e This is where all your routes lives\n|\n|\n|-- test --\u003e This is the test folder\n|       |\n|       |-tasks --\u003e This is a test example folder\n|       |   |\n|       |   |-getTasks_test.go --\u003e This is a test example file\n|       |\n|       |-other test folder --\u003e your other test folder\n```\n\n```mermaid\nflowchart TD\n    C{Folder Structure}\n    C --\u003e|controller| D[task] --\u003eN(task.go) \n    C --\u003e|domain| E[usecase] --\u003eÑ(task) --\u003eO(task.usecase.go) \n    C --\u003e|infraestructure| F[databases]\n    C --\u003e|utils| G[databases]\n    C --\u003e|env| K[env.go]\n    C --\u003e|routing| L[routing.go]\n    C --\u003e|test| M[test.go]\n```\n\n## License\n\nMIT\n\nGojira is [MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fillud%2Fgojira","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fillud%2Fgojira","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fillud%2Fgojira/lists"}