{"id":15034995,"url":"https://github.com/bonnevoyager/basicserver","last_synced_at":"2026-02-06T23:02:57.779Z","repository":{"id":57567113,"uuid":"165908204","full_name":"BonneVoyager/basicserver","owner":"BonneVoyager","description":"basicserver is a preconfigured Iris web server with JWT user authentication and MongoDB storage.","archived":false,"fork":false,"pushed_at":"2019-11-12T18:38:01.000Z","size":40,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T10:29:06.966Z","etag":null,"topics":["go","golang","iris-golang","jwt","mongodb","server-side"],"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/BonneVoyager.png","metadata":{"files":{"readme":"README.md","changelog":"change_post.go","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-15T19:11:13.000Z","updated_at":"2021-09-17T09:19:59.000Z","dependencies_parsed_at":"2022-08-31T05:01:36.440Z","dependency_job_id":null,"html_url":"https://github.com/BonneVoyager/basicserver","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/BonneVoyager/basicserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fbasicserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fbasicserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fbasicserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fbasicserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BonneVoyager","download_url":"https://codeload.github.com/BonneVoyager/basicserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonneVoyager%2Fbasicserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403127,"owners_count":23923404,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","golang","iris-golang","jwt","mongodb","server-side"],"created_at":"2024-09-24T20:27:07.788Z","updated_at":"2026-02-06T23:02:57.764Z","avatar_url":"https://github.com/BonneVoyager.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basicserver\n\n## What is this\n\nbasicserver is a preconfigured [Iris based](https://iris-go.com/) web server with user authentication (using [JWT](https://jwt.io/) token) and key/values+files storage (based on [MongoDB](https://www.mongodb.com/)).\n\n## Examples usage\n\n.env\n\n```ini\nMONGO=mongodb://127.0.0.1:27017/project\nPORT=8081\nSECRET=mySecretKey\nLOG_LEVEL=info\nSMTP_URL=smtp.gmail.com\nSMTP_PORT=587\nSMTP_USER=...@gmail.com\nSMTP_PASS=...\n```\n\nmain.go\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/bonnevoyager/basicserver\"\n\t\"github.com/joho/godotenv\"\n)\n\ntype MyApp struct{}\n\nfunc getSettings() *basicserver.Settings {\n\tgodotenv.Load()\n\n\tsecret := os.Getenv(\"SECRET\")\n\tmongoString := os.Getenv(\"MONGO\")\n\tserverPort := os.Getenv(\"PORT\")\n\tlogLevel := os.Getenv(\"LOG_LEVEL\")\n\n\tsmtpURL := os.Getenv(\"SMTP_URL\")\n\tsmtpPort, _ := strconv.Atoi(os.Getenv(\"SMTP_PORT\"))\n\tsmtpUser := os.Getenv(\"SMTP_USER\")\n\tsmtpPass := os.Getenv(\"SMTP_PASS\")\n\n\tSMTPSettings := \u0026basicserver.SMTPSettings{\n\t\tURL:  smtpURL,\n\t\tPort: smtpPort,\n\t\tUser: smtpUser,\n\t\tPass: smtpPass,\n\t}\n\n\treturn \u0026basicserver.Settings{\n\t\tSecret:      []byte(secret),\n\t\tMongoString: mongoString,\n\t\tServerPort:  serverPort,\n\t\tLogLevel:    logLevel,\n\t\tSMTP:        *SMTPSettings,\n\t}\n}\n\nfunc main() {\n\tsettings := getSettings()\n\n\tmyApp := \u0026MyApp{}\n\n\tapp := basicserver.CreateApp(settings)\n\n\tapi := app.Iris.Party(\"/api\")\n\tapi.Use(app.RequireAuth())\n\t{\n\t\tapi.Get(\"/profile\", myApp.ServeProfileGet(app))\n\t\tapi.Post(\"/profile\", myApp.ServeProfilePost(app))\n\t}\n\n\tapp.Init()\n\tapp.Start(settings.ServerPort)\n}\n\n```\n\nIn order to use basicserver, you need to at least provide `MongoString` and `ServerPort` [configuration options](https://github.com/bonnevoyager/basicserver/blob/master/main.go#L21-L49) to `basicserver.CreateApp(settings)`.\n\nPreconfigured [routes](https://github.com/bonnevoyager/basicserver/blob/master/routes.go#L7-L20) are:\n\n- [POST /register](https://github.com/bonnevoyager/basicserver/blob/master/register_post.go)\n- [POST /signin](https://github.com/bonnevoyager/basicserver/blob/master/signin_post.go)\n- [GET /recover](https://github.com/bonnevoyager/basicserver/blob/master/recover_get.go)\n- [POST /recover](https://github.com/bonnevoyager/basicserver/blob/master/recover_post.go)\n- [POST /change](https://github.com/bonnevoyager/basicserver/blob/master/change_post.go)\n- [DELETE /account](https://github.com/bonnevoyager/basicserver/blob/master/account_delete.go)\n- [GET /keepalive](https://github.com/bonnevoyager/basicserver/blob/master/keepalive_get.go)\n- [POST /api/data](https://github.com/bonnevoyager/basicserver/blob/master/data_post.go)\n- [POST /api/file](https://github.com/bonnevoyager/basicserver/blob/master/file_post.go)\n- [GET /api/data](https://github.com/bonnevoyager/basicserver/blob/master/data_get.go)\n- [GET /api/file/{id:string}](https://github.com/bonnevoyager/basicserver/blob/master/file_get.go)\n- [DELETE /api/data](https://github.com/bonnevoyager/basicserver/blob/master/data_delete.go)\n- [DELETE /api/file](https://github.com/bonnevoyager/basicserver/blob/master/file_delete.go)\n\nYou can add additional routes as in the example above, by adding more handlers.\n\nIn case you need user authorization, you can use [app.RequireAuth()](https://github.com/bonnevoyager/basicserver/blob/master/require_auth.go).\n\n[Godoc link](https://godoc.org/github.com/BonneVoyager/basicserver).\n\n## Testing\n\nSince basicserver needs MongoDB connection, a running instance of MongoDB Server should be running.\n\nTest configuration tries to connect to default `mongodb://127.0.0.1:27017/test`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonnevoyager%2Fbasicserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonnevoyager%2Fbasicserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonnevoyager%2Fbasicserver/lists"}