{"id":23785025,"url":"https://github.com/spy16/moonshot","last_synced_at":"2026-03-03T19:01:29.516Z","repository":{"id":42175409,"uuid":"510617887","full_name":"spy16/moonshot","owner":"spy16","description":"🌔 A boilerplate Go library for quickly setting up backend for your next moonshot idea!","archived":false,"fork":false,"pushed_at":"2023-01-06T15:34:00.000Z","size":64,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-06T02:42:27.198Z","etag":null,"topics":["api-rest","go-api","golang"],"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/spy16.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}},"created_at":"2022-07-05T06:42:36.000Z","updated_at":"2022-08-16T15:05:15.000Z","dependencies_parsed_at":"2023-02-06T06:01:59.860Z","dependency_job_id":null,"html_url":"https://github.com/spy16/moonshot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/spy16/moonshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fmoonshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fmoonshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fmoonshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fmoonshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spy16","download_url":"https://codeload.github.com/spy16/moonshot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fmoonshot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30056056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-rest","go-api","golang"],"created_at":"2025-01-01T13:13:50.815Z","updated_at":"2026-03-03T19:01:29.501Z","avatar_url":"https://github.com/spy16.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌔 Moonshot \n\n**NOTICE**: I wanted to grow this project to a customisable Firebase/Supabase alternative. But I think the smart folks at https://pocketbase.io/ nailed it!. So I would highly recommend trying that out.\n\nA boilerplate Go library for quickly setting up your next moonshot idea!\n\n## Features\n\n* ⚙️ Config management\n    * Create struct, pass its pointer to `moonshot.App`. \n    * Moonshot will take care of loading configs from environment/files. \n    * File can be overriden by `--config` flag also.\n    * You can run `./myapp configs` to see the actual loaded configs.\n\n* 🌍 HTTP Server setup\n    * HTTP server is pre-configured with graceful shutdown enabled.\n    * Server is pre-configured with handlers for `/health`, NotFound, MethodNotAllowed.\n    * Panic recovery is enabled.\n    * You can set the `Routes` field in `moonshot.App` to add custom routes or override.\n\n* 🗃️ Static File Server\n   * Pass `--staic-dir` \u0026 `--static-route` flags to serve static files on the HTTP server.\n   * This can be used to serve front-end app or static assets for your frontend. \n\n* 🗒️ Logging\n   * `log` package is automatically configured based on `--log-level` and `--log-format` flags.\n   * Pass log-context using `log.Inject(ctx, fields)`\n\n* ❌ Errors package\n    * An easy-to-use errors package with common category of errors pre-defined.\n    * Just do `errors.ErrInvalid.WithMsgf()` or `WithCausef()` to add additional context.\n\n\u003e Refer `./_example` for a demo application.\n\n## Usage\n\n1. Create `main.go`.\n2. Initiailise `moonshot.App`:\n\n   ```go\n   package main\n   \n   import \"github.com/spy16/moonshot\"\n\n   var myConfig struct {\n       Database string `mapstructure:\"database\"`\n   }\n\n   func main() {\n    app := moonshot.App{\n        Name: \"myapp\",\n        Short: \"MyApp does cool things\",\n        CfgPtr: \u0026myConfig,\n        Routes: func(r *chi.Mux) {\n            r.Get(\"/\", myAppHomePageHandler)\n        },\n    }\n\n    os.Exit(app.Launch())\n   }\n   ```\n3. Build the app `go build -o myapp main.go`\n4. Run the app: \n\n   ```shell\n   $ ./myapp --help\n   MyApp does cool things\n   \n   Usage:\n   myapp [command]\n   \n   Available Commands:\n   configs     Show currently loaded configurations\n   help        Help about any command\n   serve       Start HTTP server.\n   \n   Flags:\n   -c, --config string   Config file path override\n   -h, --help            help for moonshot-demo\n   \n   Use \"moonshot-demo [command] --help\" for more information about a command.\n   ```\n\n* You can run `./myapp serve --addr=\"localhost:8080\"` for starting server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspy16%2Fmoonshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspy16%2Fmoonshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspy16%2Fmoonshot/lists"}