{"id":15034828,"url":"https://github.com/1995parham-teaching/fandogh","last_synced_at":"2025-04-09T22:52:32.045Z","repository":{"id":57619410,"uuid":"380261970","full_name":"1995parham-teaching/fandogh","owner":"1995parham-teaching","description":"Backend implementation demonstration in go with JWT, MongoDB, etc.","archived":false,"fork":false,"pushed_at":"2025-04-07T12:55:41.000Z","size":354,"stargazers_count":20,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T22:52:27.882Z","etag":null,"topics":["go","golang","golang-examples","golang-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1995parham-teaching.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":"2021-06-25T14:23:34.000Z","updated_at":"2025-04-07T12:55:42.000Z","dependencies_parsed_at":"2024-06-21T16:51:40.384Z","dependency_job_id":"868e6482-e4d9-4d78-954d-9a8ce5f1a1d1","html_url":"https://github.com/1995parham-teaching/fandogh","commit_stats":null,"previous_names":["1995parham/fandogh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Ffandogh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Ffandogh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Ffandogh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-teaching%2Ffandogh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1995parham-teaching","download_url":"https://codeload.github.com/1995parham-teaching/fandogh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125641,"owners_count":21051766,"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":["go","golang","golang-examples","golang-server"],"created_at":"2024-09-24T20:26:29.819Z","updated_at":"2025-04-09T22:52:32.020Z","avatar_url":"https://github.com/1995parham-teaching.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Fandogh 🌰 \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/1995parham-teaching/fandogh/ci.yaml?logo=github\u0026style=for-the-badge\"\u003e\n  \u003cimg alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/1995parham-teaching/fandogh?logo=codecov\u0026style=for-the-badge\"\u003e\n  \u003cimg alt=\"GitHub go.mod Go version\" src=\"https://img.shields.io/github/go-mod/go-version/1995parham-teaching/fandogh?logo=go\u0026style=for-the-badge\"\u003e\n\u003c/p\u003e\n\n## APIs\n\nRegister new user with JSON request as follows:\n\n```bash\ncurl 127.0.0.1:1378/register -X POST -d '{ \"email\": \"parham.alvani@gmail.com\", \"name\": \"Parham Alvani\", \"password\": \"123456\" }' -H 'Content-Type: application/json'\n```\n\n```json\n{\n  \"Email\": \"parham.alvani@gmail.com\",\n  \"Password\": \"123456\",\n  \"Name\": \"Parham Alvani\"\n}\n```\n\nLogin into system and getting the token:\n\n```bash\ncurl 127.0.0.1:1378/login -X POST -d '{ \"email\": \"parham.alvani@gmail.com\", \"password\": \"123456\" }' -H 'Content-Type: application/json'\n```\n\n```json\n{\n  \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1c2VyIiwiZXhwIjoxNjI1MzU4MDQ1LCJqdGkiOiI4NTYxYzA4NC1kYzAxLTQ0ZmEtODEyZS05ZjNhZDJlNDcxNTAiLCJpYXQiOjE2MjUzNTQ0NDUsImlzcyI6ImZhbmRvZ2giLCJuYmYiOjE2MjUzNTQ0NDUsInN1YiI6InBhcmhhbS5hbHZhbmlAZ21haWwuY29tIn0.hUiEGqQxCSTQOFDPBypKkdI85q7TxSGENY6IwA2QR7E\",\n  \"Email\": \"parham.alvani@gmail.com\",\n  \"Password\": \"123456\",\n  \"Name\": \"Parham Alvani\"\n}\n```\n\nCreating new home requires using the POST request with form data because it contains images:\n\n```bash\ncurl -vvv 127.0.0.1:1378/api/homes -X POST  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1c2VyIiwiZXhwIjoxNjI1Mzc5MDE3LCJqdGkiOiI4NDRhMzQ4Yy03OGVjLTRlNTctODJhZi03YjU3NTNmNjk5ZjciLCJpYXQiOjE2MjUzNzU0MTcsImlzcyI6ImZhbmRvZ2giLCJuYmYiOjE2MjUzNzU0MTcsInN1YiI6InBhcmhhbS5hbHZhbmlAZ21haWwuY29tIn0.EZUWQ-sLP1ClA0vtK6vZEcQ4qf3ZaBm9VpFV6smEwUc' -F 'title=sweet' -F 'location=italy' -F 'description=a place to live' -F 'peoples=3' -F 'room=good' -F 'bed=single' -F 'rooms=4' -F'bathrooms=1' -F'contract=good' -F'price=100' -F'security_deposit=1000' -F'photos=1,2' -F'1=@1.png' -F'2=@2.png'\n```\n\n```json\n{\n  \"ID\": \"60e1535541e125c415973cd2\",\n  \"Owner\": \"parham.alvani@gmail.com\",\n  \"Title\": \"sweet\",\n  \"Location\": \"italy\",\n  \"Description\": \"a place to live\",\n  \"Peoples\": 3,\n  \"Room\": \"good\",\n  \"Bed\": 1,\n  \"Rooms\": 4,\n  \"Bathrooms\": 1,\n  \"Smoking\": false,\n  \"Guest\": false,\n  \"Pet\": false,\n  \"BillsIncluded\": false,\n  \"Contract\": \"good\",\n  \"SecurityDeposit\": 1000,\n  \"Photos\": {\n    \"1\": \"60e1535541e125c415973cd2_1\",\n    \"2\": \"60e1535541e125c415973cd2_2\"\n  },\n  \"Price\": 100\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-teaching%2Ffandogh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1995parham-teaching%2Ffandogh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-teaching%2Ffandogh/lists"}