{"id":21427851,"url":"https://github.com/sam-haff/go-samurai-chat-api","last_synced_at":"2026-01-12T02:11:23.275Z","repository":{"id":262896147,"uuid":"850605029","full_name":"sam-haff/go-samurai-chat-api","owner":"sam-haff","description":"REST API and services for the chat application","archived":false,"fork":false,"pushed_at":"2025-02-10T19:36:58.000Z","size":335,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T20:33:46.719Z","etag":null,"topics":["docker","docker-compose","firebase","firebase-auth","gin","gin-framework","gin-gonic","go","golang","mongodb","nginx","rest","rest-api","testify"],"latest_commit_sha":null,"homepage":"","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/sam-haff.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-01T09:04:20.000Z","updated_at":"2025-02-10T20:08:23.000Z","dependencies_parsed_at":"2025-01-11T05:30:09.030Z","dependency_job_id":"8904b4d3-b537-4873-85b6-2f45e88d9b94","html_url":"https://github.com/sam-haff/go-samurai-chat-api","commit_stats":null,"previous_names":["sam-haff/go-samurai-chat-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-haff%2Fgo-samurai-chat-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-haff%2Fgo-samurai-chat-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-haff%2Fgo-samurai-chat-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-haff%2Fgo-samurai-chat-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sam-haff","download_url":"https://codeload.github.com/sam-haff/go-samurai-chat-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933449,"owners_count":20370989,"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":["docker","docker-compose","firebase","firebase-auth","gin","gin-framework","gin-gonic","go","golang","mongodb","nginx","rest","rest-api","testify"],"created_at":"2024-11-22T22:05:39.114Z","updated_at":"2026-01-12T02:11:18.232Z","avatar_url":"https://github.com/sam-haff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go REST API for the chat web application\nAPI and services for the chat web application. Application is live at https://samuraichat.net (frontend code is in \u003cem\u003e./mini_client\u003c/em\u003e). \n\n\u003cimg src=\"https://github.com/user-attachments/assets/277df0c0-5d3c-4858-8c69-e3de080db830\" width=400\u003e \n\n___\n\n**Stack:**\n- Go\n- Gin\n- Gorilla WebSocket\n- Go native tests + Testify\n- MongoDB\n- Firebase Auth\n- FCM\n- GitHub Actions\n  \u003cbr/\u003e\u003cbr/\u003e\n## Getting started...\n### Remote server\n1. Create **Firebase** account\n    - Create **Firebase project**\n    - Activate **Authentication** component for the project\n    - Activate **Cloud Messaging** component for the project\n    - Download service account credentials file from **Project settings-\u003eService accounts-\u003eGenerate new private key**\n    - Copy the file to the project root\n2. Create **MongoDB Atlas** account\n    - Create shared cluster\n3. On your remote server, where you intend to host the api,\n perform all the instructions mentioned in **scripts/server_setup_readme.txt**\n4. Now, read comments in **scripts/build_and_transfer.sh**. Run the script while complying to the instructions in the script file.\n You can look at the **deploy** job in the .github/workflows/workflow.yml for the example.\n\n### Local server\nIf you want to run locally, you are still required to perform the first step(unfortunately, no fully local setup for FirebaseAuth and FCM is possible) from the instructions for **Remote server** setup. Then:\n1. Launch local mongodb:\n~~~\ncd test_mongodb\ndocker compose up\n~~~\n2. Copy your firebase credentials file to Build the API image:\n~~~\ncd scripts\nMONGODB_CONNECTION_URL=mongodb://127.0.0.1 FIREBASE_CREDS_FILE=firebase-config.json SERVER_BUILD_NUMBER=0 bash ./build_chat_api.sh\ncd ..\n~~~\n3. Run the API server:\n~~~\ncd images\ndocker run -p 8080 -d go-chat-app-api\n~~~\n\n### Web Client\nRun server:\n~~~\ncd mini_client\nnpm run dev -- --port 80\n~~~\nYou can now access the client on \u003cem\u003ehttp://localhost:80\u003c/em\u003e\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-haff%2Fgo-samurai-chat-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsam-haff%2Fgo-samurai-chat-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-haff%2Fgo-samurai-chat-api/lists"}