{"id":20041564,"url":"https://github.com/go-nunu/nunu-layout-basic","last_synced_at":"2025-05-05T08:32:19.550Z","repository":{"id":172519948,"uuid":"648983257","full_name":"go-nunu/nunu-layout-basic","owner":"go-nunu","description":"Go web best practices.","archived":false,"fork":false,"pushed_at":"2024-08-14T16:00:35.000Z","size":228,"stargazers_count":7,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T19:47:58.175Z","etag":null,"topics":["gin","go","golang","golang-cli","wire"],"latest_commit_sha":null,"homepage":null,"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/go-nunu.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-06-03T12:08:23.000Z","updated_at":"2025-03-15T16:04:28.000Z","dependencies_parsed_at":"2024-11-13T10:47:13.802Z","dependency_job_id":"27afd8cb-fe80-48e7-a1d8-1ec61424f468","html_url":"https://github.com/go-nunu/nunu-layout-basic","commit_stats":null,"previous_names":["go-nunu/nunu-layout","go-nunu/nunu-layout-base","go-nunu/nunu-layout-basic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nunu%2Fnunu-layout-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nunu%2Fnunu-layout-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nunu%2Fnunu-layout-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nunu%2Fnunu-layout-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-nunu","download_url":"https://codeload.github.com/go-nunu/nunu-layout-basic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466817,"owners_count":21752442,"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":["gin","go","golang","golang-cli","wire"],"created_at":"2024-11-13T10:47:06.579Z","updated_at":"2025-05-05T08:32:19.186Z","avatar_url":"https://github.com/go-nunu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nunu-layout-basic - Basic Layout\n\nNunu is an application scaffold based on Golang. Its name comes from a game character in League of Legends, a little boy riding on the shoulder of a yeti. Like Nunu, this project also stands on the shoulders of giants. It is a composition of various popular libraries from the Golang ecosystem, which can help you quickly build efficient and reliable applications.\n\n[简体中文介绍](https://github.com/go-nunu/nunu-layout-basic/blob/main/README_zh.md)\n\n![Nunu](https://github.com/go-nunu/nunu/blob/main/.github/assets/banner.png)\n\n## Documentation\n* [User Guide](https://github.com/go-nunu/nunu/blob/main/docs/en/guide.md)\n* [Architecture](https://github.com/go-nunu/nunu/blob/main/docs/en/architecture.md)\n* [Getting Started Tutorial](https://github.com/go-nunu/nunu/blob/main/docs/en/tutorial.md)\n\n## Features\n- **Gin**: https://github.com/gin-gonic/gin\n- **Gorm**: https://github.com/go-gorm/gorm\n- **Wire**: https://github.com/google/wire\n- **Viper**: https://github.com/spf13/viper\n- **Zap**: https://github.com/uber-go/zap\n- **Golang-jwt**: https://github.com/golang-jwt/jwt\n- **Go-redis**: https://github.com/go-redis/redis\n- **Testify**: https://github.com/stretchr/testify\n- **Sonyflake**: https://github.com/sony/sonyflake\n- **gocron**:  https://github.com/go-co-op/gocron\n- More...\n\n## Highlights\n* **Low Learning Curve and Customization**: Nunu encapsulates popular libraries that Gophers are familiar with. You can easily customize the application to meet specific requirements.\n* **High Performance and Scalability**: Nunu aims to be high-performance and scalable. It utilizes the latest technologies and best practices to ensure your application can handle high traffic and large data volumes.\n* **Security and Reliability**: Nunu uses stable and reliable third-party libraries to ensure the security and reliability of your application.\n* **Modularity and Extensibility**: Nunu is designed to be modular and extensible. You can easily add new features and functionalities by using third-party libraries or writing your own modules.\n* **Comprehensive Documentation and Test Coverage**: Nunu has comprehensive documentation and test coverage. It provides detailed documentation and examples to help you get started quickly. It also includes a test suite to ensure your application works as expected.\n\n## Nunu CLI\n\n![Nunu](https://github.com/go-nunu/nunu/blob/main/.github/assets/screenshot.jpg)\n\n## Directory Structure\n```\n.\n├── cmd\n│   └── server\n│       ├── main.go\n│       ├── wire.go\n│       └── wire_gen.go\n├── config\n│   ├── local.yml\n│   └── prod.yml\n├── internal\n│   ├── handler\n│   │   ├── handler.go\n│   │   └── user.go\n│   ├── middleware\n│   │   └── cors.go\n│   ├── model\n│   │   └── user.go\n│   ├── repository\n│   │   ├── repository.go\n│   │   └── user.go\n│   ├── server\n│   │   └── http.go\n│   └── service\n│       ├── service.go\n│       └── user.go\n├── pkg\n├── LICENSE\n├── README.md\n├── README_zh.md\n├── go.mod\n└── go.sum\n\n```\n\nThis is a classic directory structure for a Golang project, which includes the following directories:\n\n- cmd: Contains the entry points of the application, including the main function and dependency injection code.\n  - server: The main entry point of the application, including the main function and dependency injection code.\n    - main.go: The main function used to start the application.\n    - wire.go: The dependency injection code generated using Wire.\n    - wire_gen.go: The dependency injection code generated using Wire.\n\n- config: Contains the configuration files of the application.\n  - local.yml: The configuration file for the local environment.\n  - prod.yml: The configuration file for the production environment.\n\n- internal: Contains the internal code of the application.\n  - handler: Contains the handlers for handling HTTP requests.\n    - handler.go: The common handler for handling HTTP requests.\n    - user.go: The handler for handling user-related HTTP requests.\n  - middleware: Contains the middleware code.\n    - cors.go: The CORS (Cross-Origin Resource Sharing) middleware.\n  - model: Contains the data model code.\n    - user.go: The user data model.\n  - repository: Contains the data access code.\n    - repository.go: The common interface for data access.\n    - user.go: The implementation of the user data access interface.\n  - server: Contains the server code.\n    - http.go: The implementation of the HTTP server.\n  - service: Contains the business logic code.\n    - service.go: The common interface for business logic.\n    - user.go: The implementation of the user business logic.\n\n- pkg: Contains the public packages of the application.\n- storage: Contains the storage files of the application.\n- go.mod: The Go module file.\n- go.sum: The dependency versions file for the Go module.\n\n## Requirements\nTo use Nunu, you need to have the following software installed on your system:\n\n* Golang 1.16 or higher\n* Git\n\n### Installation\n\nYou can install Nunu using the following command:\n\n```bash\ngo install github.com/go-nunu/nunu@latest\n```\n\n### Creating a New Project\n\nYou can create a new Golang project using the following command:\n\n```bash\nnunu new projectName\n```\n\nBy default, it will pull from the GitHub repository, but you can also use a mirror repository for faster access:\n\n```\n// Use the basic template\nnunu new projectName -r https://gitee.com/go-nunu/nunu-layout-basic.git\n// Use the advanced template\nnunu new projectName -r https://gitee.com/go-nunu/nunu-layout-advanced.git\n```\n\nThis command will create a directory named `projectName` and generate an elegant Golang project structure within it.\n\n### Creating Components\n\nYou can create handlers, services, repositories, and models for your project using the following commands:\n\n```bash\nnunu create handler user\nnunu create service user\nnunu create repository user\nnunu create model user\n```\nor\n```\nnunu create all user\n```\n\nThese commands will create components named `UserHandler`, `UserService`, `UserDao`, and `UserModel` respectively and place them in the correct directories.\n\n### Starting the Project\n\nYou can quickly start your project using the following command:\n\n```bash\nnunu run\n```\n\nThis command will start your Golang project and support hot-reloading of files.\n\n### Compiling wire.go\n\nYou can quickly compile `wire.go` using the following command:\n\n```bash\nnunu wire\n```\n\nThis command will compile your `wire.go` file and generate the required dependencies.\n\n## Contribution\n\nIf you find any issues or have any improvement suggestions, please feel free to raise an issue or submit a pull request. Your contributions are highly appreciated!\n\n## License\n\nNunu is released under the MIT License. See the [LICENSE](LICENSE) file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-nunu%2Fnunu-layout-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-nunu%2Fnunu-layout-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-nunu%2Fnunu-layout-basic/lists"}