{"id":18023637,"url":"https://github.com/jeffotoni/goapiwebserver","last_synced_at":"2025-10-07T13:48:34.916Z","repository":{"id":134047231,"uuid":"164110980","full_name":"jeffotoni/goapiwebserver","owner":"jeffotoni","description":"An API Web server client and backend","archived":false,"fork":false,"pushed_at":"2019-04-03T17:14:06.000Z","size":91034,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T07:33:51.102Z","etag":null,"topics":["go","golang","mysql","rest-api","rest-client"],"latest_commit_sha":null,"homepage":"https://frontend.s3apis.com/","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/jeffotoni.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":"2019-01-04T13:29:48.000Z","updated_at":"2022-05-22T15:10:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"35e8f5a6-d722-430f-bedf-ad0d9934a5a5","html_url":"https://github.com/jeffotoni/goapiwebserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeffotoni/goapiwebserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgoapiwebserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgoapiwebserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgoapiwebserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgoapiwebserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffotoni","download_url":"https://codeload.github.com/jeffotoni/goapiwebserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffotoni%2Fgoapiwebserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786691,"owners_count":26045588,"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-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","mysql","rest-api","rest-client"],"created_at":"2024-10-30T07:10:08.701Z","updated_at":"2025-10-07T13:48:34.874Z","avatar_url":"https://github.com/jeffotoni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang / Api Webserver\n\nThis project is an organization model and with a practical example of how to create a client server API in golang to render html and communicate with a backend API.\nWe have two APIs, one for front-end and one for the back-end, the front-end API consumes back-end APIs all native to Go, without using golang and Js frameworks.\n\nIt was created APIs in the same structure to facilitate at the beginning all the work, are two strands or split into two repository or continue in a single as google a times ago presented that they use with a single repositories their projects and pass the Gigabytes. The client and back-end apis are independent and can make their own lives. \n\nWe use the standard rEST, we use in Go standard Library and some libs to help us compose our APIS. \n\nThe important thing is that I have been able to create a template, a standard for backend and client, of course there are still a lot of improvements and optimizations, tests, mocks, etc. But from the outset the assembled structure is very easy to scale and better using very little server resource. \n\nI did some stress testing and is holding 5k to 10k of req / s connections to the bakcend API and can still improve it, running on a machine with 2cores and 4G memory only on AWS. \n\nThe best test would be with lambda, but as the time is short, as soon as I pass this correria I will mount a poc and create stress tests with lambda to see the result...\n\nWe create Dockerfile and put the services in container, then we can put in docker-compose and as it grows, with some microservices like sending emails that can turn into a microservice, such as the auth of the login that could turn another.\n\nThe Docker images were created in hub.docker, they are all public.\n\nThe two APIS have been made, and can be found at:\n\nNote: Access to the database is just below, the sensitive data did not go up to\nthe repositories, it is just below, in case I need something else I am at disposal.\n\ngithub (I'm always updating)\nhttps://github.com/jeffotoni/goapiwebserver\n\nbitbucket public\n\nhttps://bitbucket.org/jeffotoni/je_ot\n\nThe two apis are in the same repository to facilitate, but are completely independent.\n\nThe service has been hosted on AWS and can be viewed working at this link: https://frontend.s3apis.com/login\n\n## Completed features\n\nCreating a mini framework in Go for the backend and APIS frontend.\nThis scenario has much to improve.\n\n| Functionalities  \t\t\t\t\t        |     Developed   |\n| --------------------------------- | --------------- |\n| New User Registration \t\t\t      |       (100%)    |\n| Login \t\t\t\t\t\t\t              |       (100%)    |\n| Logout \t\t\t\t\t\t\t              |       (100%)    |\n| Update Profile \t\t\t\t\t          |       (100%)    |\n| Page admin/perfil (blocked)       |       (100%)    |\n| Tests                             |       (100%)    |\n| Forgot password \t\t\t\t\t        | (performed 60%) |\n| Update password \t\t\t\t\t        | (performed 70%) |\n| Update password \t\t\t\t\t        | (performed 70%) |\n| integration with google api       |       (30%)     |\n| google-map \t\t\t\t\t\t            |       (0%)      |\n| address fields \t\t\t\t\t          |       (0%)      |\n| swagger documentation \t\t\t      |       (0%)      |\n\n\n## INSTALLATION\nNote: In the **README** of each API is documenting all the steps and details.\n\n## Install and build (requires go1.11.2 linux / amd64)\nWill download, enter the api and do make, the command will compile and run\n\n## Installing APISERVER (BACKEND)\n\n```bash\n$ git clone https://github.com/jeffotoni/goapiwebserver.git\n$ cd goapiserver\n$ make build\n```\n## Installing APIFRONTEND (FRONTEND)\n$ cd gofrontend\n$ make build\n\n## DOCKER\nIf you prefer you can run in docker but remember that to leave on the same machine would \nhave to configure the network or the domain of the backend.\nYou can use nginx to serve as a proxy if you have more services running on the same machine.\n\n## API - BACKEND\n\n```bash\n$ docker run -p 5002:5002  \\\n-e REQUEST_SEC=10000 \\\n-e DB_HOST=\"xxxx\" \\\n-e DB_NAME=xxxxx  \\\n-e DB_USER=xxxxx \\\n-e DB_PASSWORD=xxxxx \\\n-e and DB_PORT=xxxx \\\n-e DB_SORCE=mysql \\\n-e HOST_SERVER=0.0.0.0 \\\n--rm --name goapiserver jeffotoni / goapiserver\n```\n\n## API - FRONTEND\n\n```bash\n$ docker run -p 5001:5001 \\\n-e API_SCHEME=\"https\" \\\n-e API_URL=xxxxx \\\n-e HOST_SERVER=0.0.0.0 \\\n-e API_PORTA=\"\" \\\n--restart=always --name gofronted jeffotoni/gofrontend\n```\n\n## Simulations were created using cURL, everything is in the README of each API.\n\nIn the BACK-END API, there was no use of the lib to manage\nthe routes and creating the endpoints was all done native standard lib.\nSome middlewares have been created.\nI used go mod to manage the packages so in go.mod you will be able to see\nthe packages that I used.\n\n## Libs used:\n\n```bash\njwt-go v3.2.0\ntollbooth\ngo-sql-driver\ngorilla/mux\n```\n\nIn the FRONT-END API, gorillamux was used to manage the routes and sessions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffotoni%2Fgoapiwebserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffotoni%2Fgoapiwebserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffotoni%2Fgoapiwebserver/lists"}