{"id":15150397,"url":"https://github.com/anassajja/training_session_microservice","last_synced_at":"2026-01-19T12:01:15.562Z","repository":{"id":254119144,"uuid":"845544738","full_name":"anassajja/Training_Session_Microservice","owner":"anassajja","description":"Golang Microservice Training Session","archived":false,"fork":false,"pushed_at":"2024-08-24T03:57:06.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T06:44:06.552Z","etag":null,"topics":["api-rest","cassandra","gin-gonic","golang","mongodb","postman","qrcode-generator"],"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/anassajja.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-08-21T13:05:11.000Z","updated_at":"2024-11-27T22:04:54.000Z","dependencies_parsed_at":"2025-01-19T18:15:56.427Z","dependency_job_id":null,"html_url":"https://github.com/anassajja/Training_Session_Microservice","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"af64e652dff5ce3cb118e4ac0b3ab6943b6bcf95"},"previous_names":["anassajja/training_session_microservice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anassajja/Training_Session_Microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anassajja%2FTraining_Session_Microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anassajja%2FTraining_Session_Microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anassajja%2FTraining_Session_Microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anassajja%2FTraining_Session_Microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anassajja","download_url":"https://codeload.github.com/anassajja/Training_Session_Microservice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anassajja%2FTraining_Session_Microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28567861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","cassandra","gin-gonic","golang","mongodb","postman","qrcode-generator"],"created_at":"2024-09-26T14:03:44.070Z","updated_at":"2026-01-19T12:01:15.516Z","avatar_url":"https://github.com/anassajja.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Microservice with MongoDB\n\nThis repository contains a Go microservice using the Gin framework and MongoDB. The microservice provides basic CRUD operations for managing users and includes several controllers for various functionalities.\n\n## Prerequisites\n\n- [Go](https://golang.org/doc/install) (version 1.18 or later)\n- [MongoDB](https://www.mongodb.com/try/download/community) (installed and running)\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [curl](https://curl.se/) or [PowerShell's `Invoke-RestMethod`](https://learn.microsoft.com/en-us/powershell/scripting/overview)\n\n## Getting Started\n\n### Clone the Repository\n\nClone the repository to your local machine:\n\n```bash\ngit clone https://github.com/anassajja/Training_Session_Microservice.git\ncd Training_Session_Microservice\n```\n\n### Setup Environment Variables\n\nCreate a `.env` file in the root directory with the following content:\n\n```\nMONGODB_URI=mongodb://localhost:27017\n```\n\n### Install Dependencies\n\nRun the following command to install the required Go packages:\n\n```bash\ngo mod tidy\n```\n\n## Run the Server\n\nStart the server by running:\n\n```bash\ngo run cmd/main.go\n```\n\nThe server should now be running on [http://localhost:8080](http://localhost:8080).\n\n### Testing the API\n\nRecommended to test API endpoints using Postman tool.\n\n#### Test GET Users\n\nRetrieve a list of users:\n\n```bash\ncurl -X GET http://localhost:8080/users\n```\n\nOr in PowerShell:\n\n```powershell\nInvoke-RestMethod -Method Get -Uri http://localhost:8080/users\n```\n\n#### Test POST User\n\nCreate a new user:\n\n```bash\ncurl -X POST http://localhost:8080/users \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"name\": \"John Doe\", \"email\": \"john.doe@example.com\"}'\n```\n\nOr in PowerShell:\n\n```powershell\n$body = @{\n    name  = \"John Doe\"\n    email = \"john.doe@example.com\"\n}\nInvoke-RestMethod -Method Post -Uri http://localhost:8080/users -Body ($body | ConvertTo-Json) -ContentType \"application/json\"\n```\n\n## Controllers Overview\n\n### `SessionController`\n\n- **Scheduling Sessions**: \n  - **Create Session**: Add new training sessions with details such as time, location, and capacity.\n  - **Update Session**: Modify existing sessions, including changes to time, location, or other details.\n  - **Delete Session**: Remove sessions from the schedule.\n\n- **Getting Sessions**: \n  - **Retrieve All Sessions**: List all scheduled sessions.\n  - **Retrieve Session by ID**: Get details of a specific session using its unique identifier.\n\n- **Managing Sessions**: \n  - **Update Session**: Apply updates to sessions as required.\n  - **Cancel Session**: Mark sessions as canceled and handle related notifications.\n  - **Modify Session**: Make adjustments to session details as needed.\n\n### `UserController`\n\n- **User Enrollment**: \n  - **Register User**: Add users to the system and manage their registration.\n  - **Participate in Sessions**: Handle user participation in sessions, including enrollments and withdrawals.\n\n- **User Invitations**: \n  - **Send Invitations**: Manage invitations for private or special sessions.\n  - **Manage Invitations**: Track and manage the status of invitations sent to users.\n\n- **User Cancellation**: \n  - **Cancel Enrollment**: Process user requests to cancel their session participation.\n  - **Process Refunds**: Handle refunds for canceled sessions as required.\n\n- **Feedback**: \n  - **Submit Feedback**: Collect and process user feedback for sessions and coaches.\n  - **Review Management**: Handle reviews submitted by users.\n\n### `CoachController`\n\n- **Coach Management**: \n  - **Manage Coaches**: Handle actions related to coach profiles and their sessions.\n\n- **Coach Role Assignment**: \n  - **Assign Roles**: Allocate roles and responsibilities to coaches and assistants.\n\n- **Coach Session Creation**: \n  - **Create Sessions**: Allow coaches to schedule and manage their own sessions.\n\n### `BusinessController`\n\n- **Business Management**: \n  - **Manage Sessions**: Oversee training sessions from a business perspective.\n\n- **Business Dashboard**: \n  - **Manage Tools**: Provide tools for businesses to oversee and manage their training sessions.\n\n- **Business Session Creation**: \n  - **Create and Manage Sessions**: Facilitate the creation and management of sessions from a business account.\n\n### `ReservationController`\n\n- **Pitch Reservations**: \n  - **Manage Reservations**: Handle reservations for pitches, including availability checks and booking confirmations.\n\n### `NotificationController`\n\n- **Session Notifications**: \n  - **Send Notifications**: Notify users about session updates, cancellations, and reminders.\n\n- **User Notifications**: \n  - **Send Notifications**: Notify users about invitations, changes, and updates related to their sessions.\n\n### `FeedbackController`\n\n- **Session Feedback**: \n  - **Collect Feedback**: Manage the collection and processing of feedback for sessions.\n\n- **Coach Feedback**: \n  - **Handle Coach Feedback**: Process feedback related to coaches and their performance.\n\n### `QRCodeController`\n\n- **QR Code Generation**: \n  - **Generate QR Codes**: Create QR codes for verifying session participation.\n\n- **QR Code Validation**: \n  - **Validate QR Codes**: Ensure the integrity of session participation through QR code validation.\n\n## Running Tests\n\nTo run the tests for the project, use the following command:\n\n```bash\ngo test ./...\n```\n\nThis command will execute all tests in your project. Make sure to create test files following Go’s testing conventions (`*_test.go`) to ensure coverage.\n\n\n### **Summary of Updates**\n\n- **Environment Variables Section**: Added instructions for creating a `.env` file.\n- **Test Commands Section**: Added instructions for running tests with `go test ./...`.\n\nBy including these updates, your `README.md` will provide clear instructions for setting up, running, and testing your Go microservice project.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanassajja%2Ftraining_session_microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanassajja%2Ftraining_session_microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanassajja%2Ftraining_session_microservice/lists"}