{"id":21413019,"url":"https://github.com/nascript/golang-starter-standard","last_synced_at":"2025-03-16T18:22:39.594Z","repository":{"id":184955599,"uuid":"621611974","full_name":"nascript/golang-starter-standard","owner":"nascript","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-31T02:47:42.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T05:14:46.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nascript.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}},"created_at":"2023-03-31T02:44:19.000Z","updated_at":"2023-07-31T03:32:11.000Z","dependencies_parsed_at":"2023-07-31T05:43:04.047Z","dependency_job_id":null,"html_url":"https://github.com/nascript/golang-starter-standard","commit_stats":null,"previous_names":["nascript/golang-starter-standard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fgolang-starter-standard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fgolang-starter-standard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fgolang-starter-standard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fgolang-starter-standard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nascript","download_url":"https://codeload.github.com/nascript/golang-starter-standard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910763,"owners_count":20367544,"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":[],"created_at":"2024-11-22T18:16:30.707Z","updated_at":"2025-03-16T18:22:39.573Z","avatar_url":"https://github.com/nascript.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SkilledIN Green Skills API\n\n## Folder Structure\n\n```\n|--cmd/                    - this is where you compose several packages in to main package\n|----api/                  - an example would be `api` for our main package/app\n|------main.go             - holds app initialization\n|--config/                 - this is where put your configuration \n|----config.go             - this file will load environtment \n|----fiber.go              - this file will init fiber engine\n|----mongo.go              - this file will init database connection with mongo driver\n|----redis.go              - this file will init data cache connection with redis\n|--db/                     - this is where you store you database backups or migrations\n|----migrations/           - this is where you store you migrations schema files\n|--docs/                   - this is where api-spec autogenerated by swagger\n|----docs.go               - this file hold generated api spec for embeded to main app\n|----swagger.json          - this file hold json format api-spec \n|----swagger.yml           - this file hold yml format api-spec \n|--misc/                   - this is where you store your miscellaneous\n|----make/                 - this is where you store your Makefile miscellaneous\n|------tools.Makefile      - this is where you save tools needed for development purpose\n|--modules/                - this folder holds list of all modules\n|----example/              - this package holds all account module\n|------common/             - this folder hold common data\n|--------error.go          - this file holds error list for this current module (account)\n|--------constant.go       - this file holds constant list for this current module (account), to avoid magic number, etc.\n|------delivery/           - this holds delivery handler like rest, websocket, server-sent-event, webhook, etc...\n|--------rest/             - this holds rest handler\n|------domain/             - this folder holds module domains\n|--------entity/           - this folder holds entity struct, representate of your database or models or data\n|--------request/          - this folder holds form request stuct\n|--------response/         - this folder holds custom data response \n|--------contract.go       - this fole hold interface contract for this module\n|------repository/         - this folder holds data repository like mongo, postgre, etc.\n|--------mongo/            - this folder all mongo query\n|------service/            - this holds module usecase/service (logic)\n|------provider.go         - this holds this current package initialization and dependencies registrar\n|----...                   - others module\n|----provider.go           - this file holds module registar and default handler\n|--pkg/                    - this is where put your reusable packages \n|----http/                 - this folder hold list of http reusable packages\n|------client/             - this package hold http client to call http/1 (rest, etc.)\n|------middleware/         - this package holds list of reusable middleware for fiber engine\n|------wrapper/            - this package holds reusable wrapper for respond, validation, etc.\n|----password/             - this where put your password package like bcript, script, etc ...\n|----token/                - this is where put your token package e.g: jwt, rsa, etc..\n|--.air.windows.conf\n|--.env\n|--.gitignore\n|--.golangci.yml\n|--Dockerfile\n|--go.mod\n|--go.sum\n|--Makefile\n|--README.md\n```\n\n## Access Flow\n\n```mermaid\nflowchart TB\n   CLIENT_APP\u003c--req,res--\u003e./cmd/api/main.go\n   storage_persistence[(Storage)]\u003c--\u003e./config/*\n   data_cache[(Cache)]\u003c--\u003e./config/*\n    \n   subgraph SERVER_APP\n       ./cmd/api/main.go\u003c--\u003e./config/*\n       ./cmd/api/main.go\u003c--*en, *db--\u003e./modules/providers.go\n       \n       ./modules/providers.go\u003c--register--\u003e./modules/example/provider.go\n       ./modules/providers.go\u003c--register *routerGroup *DB--\u003eMODULE_N...\n       \n       subgraph EXAMPLE_MODULE\n        ./modules/example/provider.go\u003c--*collection--\u003e./modules/example/repository/mongo/example_repository.go\n        ./modules/example/provider.go\u003c--iRepo--\u003e./modules/example/service/example_service.go\n        ./modules/example/provider.go\u003c--iSvc--\u003e./modules/example/delivery/rest/example_handler.go\n        end\n        \n        subgraph MODULE_N...\n        end\n        \n   end\n```\n\n## How To Use?\n\n1. Run the app `make run`\n2. Run with watch file change `make watch`\n3. Crate a mocks `make mock` and then copy to parent folder from `genmocks`\n4. Update API Spec `make api-spec` this will also run `make test`, `make lint` and `make critic`\n   - `make test` is run all the tests function with its coverage\n   - `make lint` is run linter for golang you probably need to install [golangci](https://github.com/golangci/golangci-lint) to run this on your local machine.\n   - `make critic` is run code audit for golang, and also you probably need to install [go-critic](https://github.com/go-critic/go-critic) on your local machine.\n5. You can also make API Spec without run this annoying lint and audit by type `make just-api-spec`, this action will run one and only one command.\n\nPS: if you don't want to install required tools on your local machine you can use `make install-deps`, this will make all the required tool installed on this current package/project.\n\n## Refs:\n- [project-layout](https://github.com/golang-standards/project-layout)\n\n#### More information [Project WIKI](https://github.com/Skilledin/skilledin-green-skills-api/wiki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnascript%2Fgolang-starter-standard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnascript%2Fgolang-starter-standard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnascript%2Fgolang-starter-standard/lists"}