{"id":30743225,"url":"https://github.com/peterxcli/linked-page","last_synced_at":"2025-09-04T02:05:26.869Z","repository":{"id":186505721,"uuid":"620154697","full_name":"peterxcli/linked-page","owner":"peterxcli","description":"Dcard backend 2023 assignment 📚, featuring Docker compose 🐳, RESTful API \u0026 gRPC services 🛠️, with PostgreSQL database 🗃️. It includes swagger \u0026 gRPC documentation 📖, tests 🧪, and explores database performance optimizations 🚀.","archived":false,"fork":false,"pushed_at":"2024-01-02T15:02:41.000Z","size":779,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-28T05:14:07.879Z","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/peterxcli.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}},"created_at":"2023-03-28T06:16:04.000Z","updated_at":"2024-03-27T18:05:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"54883d7a-72b0-4ac8-853f-713b3da1964f","html_url":"https://github.com/peterxcli/linked-page","commit_stats":null,"previous_names":["peterxcli/linked-page"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterxcli/linked-page","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterxcli%2Flinked-page","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterxcli%2Flinked-page/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterxcli%2Flinked-page/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterxcli%2Flinked-page/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterxcli","download_url":"https://codeload.github.com/peterxcli/linked-page/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterxcli%2Flinked-page/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539317,"owners_count":25123499,"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-09-04T02:00:08.968Z","response_time":61,"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":"2025-09-04T02:05:25.755Z","updated_at":"2025-09-04T02:05:26.824Z","avatar_url":"https://github.com/peterxcli.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dcard backend - linked page\n\n- [repo link](https://github.com/peterxcli/linked-page)\n- [swagger](https://peterxcli.github.io/linked-page/)\n\n\n## setup\n### use `docker compose`\n```\ndocker compose up -d\n``` \n\u003e or\n\n### install\n```\nmake install\n```\n\n### test\n```\nmake test\n```\n\n### run \n```\nmake\n```\n\u003e link to http://localhost:9000/swagger/index.html to view or interact with the openAPI docs\n\n## service endpoints\n### RESTful api : port 9000\n\u003e https://peterxcli.github.io/linked-page/\n\n### gRPC :\n#### list proto : port 9001\n\n```\nsyntax = \"proto3\";\noption go_package = \"/protos/list\";\nservice List {\n    rpc GetList(GetListRequest) returns (GetListResponse);\n    rpc PatchList(PatchListRequest) returns (SetHeadResponse);\n    rpc InsertList(InsertListRequest) returns (SetHeadResponse);\n}\n\nmessage GetListRequest {\n    uint32 ListId = 1;\n    uint32 UserId = 2;\n}\n\nmessage GetListResponse {\n    uint32 ListId = 1;\n    uint32 UserId = 2;\n    uint32 HeadId = 3;\n}\n\nmessage PatchListRequest {\n\tuint32 ListId = 1;\n\tuint32 UserId = 2;\n\tuint32 HeadId = 3;\n}\n\nmessage InsertListRequest {\n\tuint32 ListId = 1;\n\tuint32 UserId = 2;\n\tuint32 HeadId = 3;\n}\n\nmessage SetHeadResponse {\n    bool IsSuccess = 1;\n}\n```\n\n#### page proto : \n```\nsyntax = \"proto3\";\noption go_package = \"/proto/page\";\n\nservice Page {\n    rpc GetPage(GetPageRequest) returns (GetPageResponse);\n    rpc SetPage(SetPageRequest) returns (SetPageResponse);\n    rpc InsertPage(InsertPageRequest) returns (InsertPageResponse);\n    rpc DeletePageCertainHourBefore(DeletePageRequest) returns (DeletePageResponse);\n    rpc DeletePage(DeletePageRequest) returns (DeletePageResponse);\n}\n\nmessage GetPageRequest {\n    uint32 PageId = 1;\n}\n\nmessage GetPageResponse {\n    uint32 PageId = 1;\n\tuint32 NextPageId = 2;\n\tuint32 PrevPageId = 3;\n    repeated uint32 ArticleIds = 4;\n}\n\nmessage SetPageRequest {\n\tuint32 PageId = 1;\n    uint32 NextPageId = 2;\n    uint32 PrevPageId = 3;\n    repeated uint32 ArticleIds = 4;\n}\n\nmessage SetPageResponse {\n    bool IsSuccess = 1;\n}\n\nmessage InsertPageRequest {\n    uint32 PageId = 1;\n    uint32 NextPageId = 2;\n    uint32 PrevPageId = 3;\n    repeated uint32 ArticleIds = 4;\n}\n\nmessage InsertPageResponse {\n    bool IsSuccess = 1;\n    uint32 NewPageId = 2;\n}\n\nmessage DeletePageRequest {\n    uint32 PageId = 1;\n    int32 Hour = 2;\n}\n\nmessage DeletePageResponse {\n    uint32 RowAffected = 1;\n}\n```\n\n## Why use PostgresSQL?\nPostgreSQL is a powerful and versatile relational database management system that is open source and free to use. Here are some of the reasons why you might choose to use PostgreSQL:\n\n1. Reliability and Stability: PostgreSQL is known for its reliability and stability, even when dealing with large amounts of data and complex queries. It has a reputation for being a robust database that is used by many large organizations and businesses.\n\n2. Scalability: PostgreSQL is designed to handle high traffic and a large number of users. It can easily scale up to handle growing amounts of data and increased demand.\n\n3. Advanced Features: PostgreSQL has many advanced features that make it a popular choice for developers. These include support for JSON, XML, and spatial data types, as well as advanced indexing and query optimization.\n\n4. Extensibility: PostgreSQL is highly extensible, allowing developers to add custom functionality through its extensive library of extensions and plugins.\n\n5. Open Source: PostgreSQL is an open source database, meaning that it is freely available and can be modified and customized to fit your specific needs. This can save you money on licensing fees and provide greater flexibility in your development process.\n\n------\n\n- 嗚嗚嗚寫不完了QQ\n\n### defect\n\n- 整體寫得不錯，特別是採用 swagger \u0026 gRPC 這一點。\n- 資料庫的選用建議多涉列一些不同的類型，比較之間的差別和適用情況，像是 Scalability 會好奇是和什麼 DB 做為對象比較\n- 我們期待看到在刪除上有一些進階的處理，怎麼安排儲存方式可以大批刪除又不影響 DB 的效能\n- 有寫測試這點很不錯，但團隊建議做更完整的測試，包含較多情境或者錯誤的測試等等\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterxcli%2Flinked-page","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterxcli%2Flinked-page","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterxcli%2Flinked-page/lists"}