{"id":18469550,"url":"https://github.com/miteshsharma/gowebserver","last_synced_at":"2025-06-13T14:05:31.923Z","repository":{"id":109598728,"uuid":"184378560","full_name":"MiteshSharma/GoWebServer","owner":"MiteshSharma","description":"A basic go web server code which can be used to write a full blown web application","archived":false,"fork":false,"pushed_at":"2019-05-01T06:39:41.000Z","size":1204,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T07:51:17.974Z","etag":null,"topics":["go","golang","server","webserver"],"latest_commit_sha":null,"homepage":null,"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/MiteshSharma.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":"2019-05-01T06:38:05.000Z","updated_at":"2019-05-01T06:42:44.000Z","dependencies_parsed_at":"2023-04-25T05:48:10.628Z","dependency_job_id":null,"html_url":"https://github.com/MiteshSharma/GoWebServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2FGoWebServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2FGoWebServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2FGoWebServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiteshSharma%2FGoWebServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiteshSharma","download_url":"https://codeload.github.com/MiteshSharma/GoWebServer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839282,"owners_count":21812084,"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","server","webserver"],"created_at":"2024-11-06T10:10:50.223Z","updated_at":"2025-05-07T07:51:21.336Z","avatar_url":"https://github.com/MiteshSharma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go HTTP Server\n\nWe are running an HTTP server at a specified port to accept requests written in go using its net/http package. We have a build.go file which helps with building our binary for deployment purpose. We can directly build project by going to cmd package and running main.go.\n\nWe divided the responsibility of serving a request to different modules for clarity. All our requests go through middlewares which helps in logging, measuring metrics etc. A request is handled by the api package whose main responsibility is to validate request parameters and forming right response. Once a request is validated by api package, it is passed to app package to handle all business logic. App package requests repository package for fetching any data from database or cache. We have defined other packages like logger for centralized logging, metrics for managing metrics of requests, settings to keep static or dynamic config data.\n\n    HTTP Request --\u003e Hits Server --\u003e Go through middleware --\u003e API --\u003e App --\u003e Repository\n\n### API\n\nApi package is used to receive an incoming request, validate the request for any bad input parameters. Generate a proper response after running our business logic.\n\n### App\n\nApp package's main responsibility is to execute business logic. This is the heart of our server, as it takes to request and process it to return the desired output. App package can call repository package to fetch or store data in database or cache.\n\n### Repository\n\nRepository package is a wrapper on database and cache, so no other package can directly access the database. This package handle all create, update, fetch and delete operation on database tables or cache.\n\nWe have divided our logic in different modules like user, auth, common, bi event handling with all core logic moved to core folder. Core logic includes:\n\n### BI\n\nBusiness intelligence package is to take events and passing them to other modules for handling. This uses an event dispatcher package which helps make handling events async.\n\n### Metrics\n\nMetrics package helps abstract out handling of metrics. Other packages send data to metrics package and it makes sure this data is sent to Prometheus for visualization.\n\n### Logger\n\nLogger package helps abstract out handling of the logger. This package helps store logs in console or file.\n\n\n### Bus\n\nBus package helps send messages and receive responses from different modules and provide separation of responsibility by not letting them interfere with each other.\n\n### MQ\n\nMQ package provide support to send message to messaging queue. We have implemented SQS for this case but others can be added.\n\n\n### Event Dispatcher\n\nEvent dispatcher provides support to dispatch event using a bufferent queue and go routine. This makes handling messages async.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiteshsharma%2Fgowebserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiteshsharma%2Fgowebserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiteshsharma%2Fgowebserver/lists"}