{"id":18909718,"url":"https://github.com/oothan/library-book-borrowing-and-returning-go-api","last_synced_at":"2025-08-01T03:04:46.885Z","repository":{"id":133839717,"uuid":"276601109","full_name":"oothan/library-book-borrowing-and-returning-go-api","owner":"oothan","description":" REST-ful Library System API server in written Go (Golang)","archived":false,"fork":false,"pushed_at":"2020-07-08T15:44:19.000Z","size":5920,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T02:13:39.698Z","etag":null,"topics":[],"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/oothan.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":"2020-07-02T09:12:23.000Z","updated_at":"2020-07-08T15:45:01.000Z","dependencies_parsed_at":"2023-05-03T19:47:25.894Z","dependency_job_id":null,"html_url":"https://github.com/oothan/library-book-borrowing-and-returning-go-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oothan/library-book-borrowing-and-returning-go-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oothan%2Flibrary-book-borrowing-and-returning-go-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oothan%2Flibrary-book-borrowing-and-returning-go-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oothan%2Flibrary-book-borrowing-and-returning-go-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oothan%2Flibrary-book-borrowing-and-returning-go-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oothan","download_url":"https://codeload.github.com/oothan/library-book-borrowing-and-returning-go-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oothan%2Flibrary-book-borrowing-and-returning-go-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268162340,"owners_count":24205700,"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-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2024-11-08T09:34:54.513Z","updated_at":"2025-08-01T03:04:46.778Z","avatar_url":"https://github.com/oothan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# library-book-borrowing-and-returning-go-api\n\n\u003e A complete example of a REST-ful Library System API server in written Go (Golang)\n\n## Quick Start\n``` bash\n# install mux router\ngo get -u github.com/gorilla/mux\n\n# install gorm for MySQL Database\ngo get -u github.com/jinzhu/gorm\n\n# install jwt-go for user token authentication\ngo get -u github.com/dgrijalva/jwt-go\n\n# install checkmail to validate email\ngo get -u github.com/badoux/checkmail\n\n# install crypto to encrypt and decrypt user password\ngo get -u golang.org/x/crypto\n\n# install godotenv to get .env file from os\ngo get -u github.com/joho/godotenv\n```\n\n```bash\ngo run main.go\n    (or)\ngo build\n./library-book-borrowing-and-returning-go-api\n```\n\n## Project Directory\n```.\n├── main.go                                 // entry file\n├── .env                                    // for mysql and jwt-go\n├── books.json                              // dataset for books\n├── go.mod                                  // go module\n├── go.sum                                  // go module status\n└── api\n      ├── auth\n      |       └── token.go                    // generate user token and validate user id\n      ├── controllers\n      |       ├── base.go                     // initialize server\n      |       ├── book_controller.go          // control book model\n      |       ├── borrow_controller.go        // control borrow model\n      |       ├── home_controller.go          // for home page\n      |       ├── routes.go                   // routes initialize\n      |       └── user_controller.go          // control user model\n      ├── data\n      |       └── books.json      \n      ├── middlewares                        \n      |       └── middleware.go               // for request and respond \n      ├── models\n      |       ├── book.go                     // boook model\n      |       ├── borrow.go                   // borrow model\n      |       └── user.go                     // user model\n      ├── responses\n      |       └── utils.go                    // for JSON responses\n      ├── seed     \n      |       └── sesder.go                   // to seed dataset into mysql\n      ├── utils                       \n      |       └── format         \n      |               └── format_error.go     // format error     \n      └── server.go                           // server start \n\n```\n\n## End Points\n\n#### Home\n```\nGET /\n```\n#### User\n```\nPOST /register\n# Request simple\n{\n\t\"user_name\": \"Than Hla\",\n\t\"email\": \"thanhla@gmail.com\",\n\t\"password\": \"thanhla\"\n}\n\nPOST /login\n# Request simple\n{\n\t\"email\": \"thanhla@gmail.com\",\n\t\"password\": \"thanhla\"\n}\n\nGET /users\nGET /user_count\n```\n#### Book\n```\nGET /books\n\nPOST /books\n# Create Book Request Simple\n{\n    \"_id\": 1,\n    \"title\": \"Unlocking Android\",\n    \"isbn\": \"1933988673\",\n    \"pageCount\": 416,\n    \"publishedDate\": {\n      \"$date\": \"2009-04-01T00:00:00.000-0700\"\n    },\n    \"thumbnailUrl\": \"https://s3.amazonaws.com/AKIAJC5RLADLUMVRPFDQ.book-thumb-images/ableson.jpg\",\n    \"shortDescription\": \"Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout.\",\n    \"longDescription\": \"Android is an open source mobile phone platform based on the Linux operating system and developed by the Open Handset Alliance, a consortium of over 30 hardware, software and telecom companies that focus on open standards for mobile devices. Led by search giant, Google, Android is designed to deliver a better and more open and cost effective mobile experience.    Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout. Based on his mobile development experience and his deep knowledge of the arcane Android technical documentation, the author conveys the know-how you need to develop practical applications that build upon or replace any of Androids features, however small.    Unlocking Android: A Developer's Guide prepares the reader to embrace the platform in easy-to-understand language and builds on this foundation with re-usable Java code examples. It is ideal for corporate and hobbyists alike who have an interest, or a mandate, to deliver software functionality for cell phones.    WHAT'S INSIDE:        * Android's place in the market      * Using the Eclipse environment for Android development      * The Intents - how and why they are used      * Application classes:            o Activity            o Service            o IntentReceiver       * User interface design      * Using the ContentProvider to manage data      * Persisting data with the SQLite database      * Networking examples      * Telephony applications      * Notification methods      * OpenGL, animation \u0026 multimedia      * Sample Applications  \",\n    \"status\": \"PUBLISH\",\n    \"authors\": [\n      \"W. Frank Ableson\",\n      \"Charlie Collins\",\n      \"Robi Sen\"\n    ],\n    \"categories\": [\n      \"Open Source\",\n      \"Mobile\"\n    ]\n  }\n\nGET /book/{id}\n\nPUT /book/{id}\n# Update Book Request Simple\n{\n    \"_id\": 1,\n    \"title\": \"Unlocking Android\",\n    \"isbn\": \"1933988673\",\n    \"pageCount\": 416,\n    \"publishedDate\": {\n      \"$date\": \"2009-04-01T00:00:00.000-0700\"\n    },\n    \"thumbnailUrl\": \"https://s3.amazonaws.com/AKIAJC5RLADLUMVRPFDQ.book-thumb-images/ableson.jpg\",\n    \"shortDescription\": \"Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout.\",\n    \"longDescription\": \"Android is an open source mobile phone platform based on the Linux operating system and developed by the Open Handset Alliance, a consortium of over 30 hardware, software and telecom companies that focus on open standards for mobile devices. Led by search giant, Google, Android is designed to deliver a better and more open and cost effective mobile experience.    Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout. Based on his mobile development experience and his deep knowledge of the arcane Android technical documentation, the author conveys the know-how you need to develop practical applications that build upon or replace any of Androids features, however small.    Unlocking Android: A Developer's Guide prepares the reader to embrace the platform in easy-to-understand language and builds on this foundation with re-usable Java code examples. It is ideal for corporate and hobbyists alike who have an interest, or a mandate, to deliver software functionality for cell phones.    WHAT'S INSIDE:        * Android's place in the market      * Using the Eclipse environment for Android development      * The Intents - how and why they are used      * Application classes:            o Activity            o Service            o IntentReceiver       * User interface design      * Using the ContentProvider to manage data      * Persisting data with the SQLite database      * Networking examples      * Telephony applications      * Notification methods      * OpenGL, animation \u0026 multimedia      * Sample Applications  \",\n    \"status\": \"PUBLISH\",\n    \"authors\": [\n      \"W. Frank Ableson\",\n      \"Charlie Collins\",\n      \"Robi Sen\"\n    ],\n    \"categories\": [\n      \"Open Source\",\n      \"Mobile\"\n    ]\n  }\n\nDELETE /book/{id}\n\nGET /book_count\n```\n#### Borrow\n```\nGET /borrow_count\n\nPOST /book_take/{id}\n\nDELETE /book_give/{id}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foothan%2Flibrary-book-borrowing-and-returning-go-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foothan%2Flibrary-book-borrowing-and-returning-go-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foothan%2Flibrary-book-borrowing-and-returning-go-api/lists"}