{"id":37211266,"url":"https://github.com/mayank1989gupta/golangrestjwtpostgres","last_synced_at":"2026-01-15T00:03:33.009Z","repository":{"id":130998866,"uuid":"203670491","full_name":"mayank1989gupta/golangrestjwtpostgres","owner":"mayank1989gupta","description":"Sample project to create rest API using Gorilla - Mux, JWT \u0026, PostGres SQL","archived":false,"fork":false,"pushed_at":"2019-08-25T22:19:07.000Z","size":2812,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T19:56:22.617Z","etag":null,"topics":["bcrypt","go","golang","gotenv","jwt","postgresql","rest-api","spew"],"latest_commit_sha":null,"homepage":null,"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/mayank1989gupta.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-08-21T22:00:34.000Z","updated_at":"2021-04-30T00:19:19.000Z","dependencies_parsed_at":"2023-03-31T03:36:13.499Z","dependency_job_id":null,"html_url":"https://github.com/mayank1989gupta/golangrestjwtpostgres","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mayank1989gupta/golangrestjwtpostgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayank1989gupta%2Fgolangrestjwtpostgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayank1989gupta%2Fgolangrestjwtpostgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayank1989gupta%2Fgolangrestjwtpostgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayank1989gupta%2Fgolangrestjwtpostgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayank1989gupta","download_url":"https://codeload.github.com/mayank1989gupta/golangrestjwtpostgres/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayank1989gupta%2Fgolangrestjwtpostgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":["bcrypt","go","golang","gotenv","jwt","postgresql","rest-api","spew"],"created_at":"2026-01-15T00:03:32.514Z","updated_at":"2026-01-15T00:03:33.003Z","avatar_url":"https://github.com/mayank1989gupta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installation/SetUp\n\n    Install the package: go get -u github.com/gorilla/mux\n    This helps in creating go routers\n\n    Installing go-jwt package:\n    go get github.com/dgrijalva/jwt-go\n\n    PQ package: which helps us connect to PostGre DB\n    go get github.com/lib/pq\n\n    BCRYPT package: This is part of the go installation\n    or else : go get golang.org/x/crypto/bcrypt\n\n    Go Spew: Could be used for printing detailed struct formats\n    go get -u github.com/davecgh/go-spew/spew\n\n    gotenv: To use the environment variables\n    go get github.com/subosito/gotenv\n\n\nJWT\n\n    JSON  Web Token\n    Means of exchanging information between 2 parties\n    Digitally Signed\n\n    Structure: {Base64 encoder Header}.{Base64 encoder Payload}.{Signature}\n    Header: Consists of Alg \u0026, Token Type --\u003e {\"alg\": \"HS256\", \"type\":\"JWT\"}\n    Payload: Payload carry the claims\n        - User \u0026, additional data such as expiry\n        - Types of claims: Registered, Public \u0026, Private\n        - eg: {\"email\":\"abc@abc.com\", \"Issuer\": \"course\"}\n    Signature: Computed from Header, Payload \u0026, a secret \n        - Generated by the algo mentioned in the header\n        - Digitally signed using a secret only known to the developer\n        - Cannot be decrypted unless you have the access to secret\n\nPostGres SQL\n\n    For the tutorial we will PostGresSQL as a service.\n    URL: https://www.elephantsql.com\n    Create an instance [Free one] -\u003e\n    To create a user table:\n        create table users (\n        id serial primary key,\n        email text not null unique,\n        password text not null\n        );\n    To insert records:\n        insert into users (email, password) values ('abc@gmail.com', '123456');\n        insert into users (email, password) values ('xyz@gmail.com', '123456');\n    To select records:\n        SELECT * FROM \"public\".\"users\"\n \n Running the application\n \n    go build\n    ./go-jwt\n    \n    The services would available at port 8000\n    For example: \n    POST: http://localhost:8000/singup\n    Sample Request Json: {\n\t\"email\": \"user6@abc.com\",\n\t\"password\": \"1234\"\n    }   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayank1989gupta%2Fgolangrestjwtpostgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayank1989gupta%2Fgolangrestjwtpostgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayank1989gupta%2Fgolangrestjwtpostgres/lists"}