{"id":24607149,"url":"https://github.com/riii111/go-rust-comparison","last_synced_at":"2025-05-05T21:30:04.257Z","repository":{"id":273619932,"uuid":"881638513","full_name":"riii111/go-rust-comparison","owner":"riii111","description":"チームでの技術検証用リポジトリ","archived":false,"fork":false,"pushed_at":"2025-03-26T09:56:43.000Z","size":14259,"stargazers_count":4,"open_issues_count":33,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-30T23:51:09.597Z","etag":null,"topics":["gin-gonic","golang","nextjs15","nginx","postgresql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/riii111.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":"2024-11-01T00:27:47.000Z","updated_at":"2025-03-26T09:56:51.000Z","dependencies_parsed_at":"2025-02-27T07:39:29.083Z","dependency_job_id":"b834f246-830c-430e-a6e3-ad9f330a6292","html_url":"https://github.com/riii111/go-rust-comparison","commit_stats":null,"previous_names":["riii111/go-rust-comparison"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fgo-rust-comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fgo-rust-comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fgo-rust-comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fgo-rust-comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riii111","download_url":"https://codeload.github.com/riii111/go-rust-comparison/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252579962,"owners_count":21771243,"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":["gin-gonic","golang","nextjs15","nginx","postgresql"],"created_at":"2025-01-24T17:21:28.380Z","updated_at":"2025-05-05T21:30:04.230Z","avatar_url":"https://github.com/riii111.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-rust-comparison\n\nGolangバックエンド技術検証用リポジトリ\n\n## アプリケーション構成\n\n[![Next.js (App Router)](https://img.shields.io/badge/Next.js%20(App%20Router)-000000?style=for-the-badge\u0026logo=next.js\u0026logoColor=white)](https://nextjs.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![shadcn/ui](https://img.shields.io/badge/shadcn%2Fui-000000?style=for-the-badge\u0026logo=shadcnui\u0026logoColor=white)](https://ui.shadcn.com/)\n[![Go](https://img.shields.io/badge/Go-00ADD8?style=for-the-badge\u0026logo=go\u0026logoColor=white)](https://go.dev/)\n[![Gin](https://img.shields.io/badge/Gin-008ECF?style=for-the-badge\u0026logo=gin\u0026logoColor=white)](https://gin-gonic.com/)\n[![Nginx](https://img.shields.io/badge/Nginx-009639?style=for-the-badge\u0026logo=nginx\u0026logoColor=white)](https://nginx.org/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n\n- フロントエンド: Next.js(app router) + shadcn/ui\n- バックエンド: Gin（Golang）\n- データベース: PostgreSQL\n- プロキシ: Nginx\n\n## 要件\n\nesaから一部抜粋↓\n\n---\n\n## 概要（ざっくり）\n\nECサイトの管理側、在庫管理システムを構築する。\u003cbr/\u003e\n店舗別に管理者が存在し、自身の商品や購入履歴を管理できる。\u003cbr/\u003e\n（ECサイトは余力があれば作成するかも）\n\n## 利用ユーザ\n\n- **店舗管理者**（例: 東京店、大阪店、名古屋店...）\n  - 自身の店舗に関わる商品・購入履歴などを管理できる。\n  - 他店の情報は閲覧不可。\n- **システム管理者**\n  - 全店の情報を管理できる。\n  - オペレータの情報も閲覧・編集可。\n\n## テーブル設計（イメージ）\n\n```mermaid\nerDiagram\n    operators ||--o| stores : \"belongs_to\"\n    operators {\n        uuid id PK\n        string email UK\n        string username\n        string password_hash\n        string role\n        uuid store_id FK\n        string avatar_url\n        uuid created_by FK\n        uuid updated_by FK\n        uuid deleted_by FK\n        timestamp created_at\n        timestamp updated_at\n        timestamp deleted_at\n    }\n\n    stores ||--o{ stocks : \"has\"\n    stores ||--o{ purchase_histories : \"fulfills\"\n    stores {\n        uuid id PK\n        string name\n        text address\n        string phone_number\n        string business_hours\n        string zip_code\n        text description\n        boolean is_active\n        uuid created_by FK\n        uuid updated_by FK\n        timestamp created_at\n        timestamp updated_at\n    }\n\n    products ||--|{ stocks : \"has\"\n    products {\n        uuid id PK\n        string name\n        text description\n        text material_info\n        decimal base_price\n        string category\n        string[] image_urls\n        uuid created_by FK\n        uuid updated_by FK\n        timestamp created_at\n        timestamp updated_at\n    }\n\n    stocks {\n        uuid id PK\n        uuid product_id FK\n        uuid store_id FK\n        string size\n        string color\n        integer quantity\n        decimal price\n        boolean is_available\n        uuid created_by FK\n        uuid updated_by FK\n        timestamp created_at\n        timestamp updated_at\n    }\n\n    purchase_histories ||--|{ purchase_items : \"contains\"\n    purchase_histories {\n        uuid id PK\n        string customer_email\n        uuid store_id FK\n        decimal total_amount\n        timestamp purchased_at\n    }\n\n    purchase_items {\n        uuid id PK\n        uuid history_id FK\n        uuid product_id FK\n        string size\n        string color\n        integer quantity\n        decimal price_at_time\n        timestamp created_at\n    }\n```\n\n## 機能分担\n\n### 1. **認証・権限管理機能**\n\n- 関連テーブル：`operators`テーブルを構築（`stores`を参照）\n- 主な操作：\n  - オペレーターのCRUD\n  - ログイン、ログアウト認証\n- 認証・権限要件：\n  - システム管理者は全てのオペレーター情報にアクセス可能とする\n  - 店舗管理者は自身の情報のみ参照・更新可能とする\n  - パスワードポリシーは以下を満たすこと：\n    - 最低8文字以上\n    - 英大文字・小文字・数字・記号を含む\n  - ~~アカウントロックは5回連続の認証失敗で発生するものとする~~　（**※余力あればでOK**）\n\n### 2. **商品管理機能**\n\n- 関連テーブル：`products`テーブルを構築（`stocks`を参照）\n- 主な操作：\n  - 商品情報のCRUD\n  - 画像が必要なので注意\n  - 商品一覧・詳細表示\n- 認証・権限要件：\n  - システム管理者：全商品のCRUD操作が可能\n  - 店舗管理者：\n    - 自店舗に紐づく商品情報のCRUD操作が可能\n  - 画像アップロードは5MB以下のJPEG/PNG形式のみ許可する\n\n### 3. **在庫管理機能**\n\n- 関連テーブル：`stocks`テーブルを構築（`products`, `stores`を参照）\n- 主な操作：\n  - 在庫数の更新\n  - 店舗別在庫管理\n  - 在庫一覧表示\n- 認証・権限要件：\n  - システム管理者：全店舗の在庫情報の参照・更新が可能\n  - 店舗管理者：\n    - 自店舗の在庫情報のみ参照・更新可能\n    - 他店舗の在庫情報は参照不可\n  - 在庫数更新操作はログを記録し、更新者の追跡を可能とする\n\n### 4. **店舗管理機能**\n\n- 関連テーブル：`stores`テーブルを構築（`operators`を参照）\n- 主な操作：\n  - 店舗情報のCRUD\n  - 店舗一覧表示\n  - 店舗管理者の割り当て\n- 認証・権限要件：\n  - **システム管理者のみがアクセス可能な機能とする**\n  - 以下の操作を許可する：\n    - 店舗情報のCRUD操作\n    - 店舗管理者の割り当て・変更\n  - 店舗の削除は、関連する在庫データが存在しない場合のみ可能とする\n\n### 5. **購入履歴管理機能**\n\n- 関連テーブル：`purchase_histories`, `purchase_items`を構築\n- 主な操作：\n  - 購入履歴の参照\n  - ~~店舗別売上確認~~ **（※余力あればでOK）**\n- 認証・権限要件：\n  - システム管理者：全店舗の購入履歴を参照可能\n  - 店舗管理者：\n    - 自店舗の購入履歴のみ参照可能\n    - 過去3年分のデータまでアクセス可能\n  - 個人情報（メールアドレス等）は一部マスキング処理を行う\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friii111%2Fgo-rust-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friii111%2Fgo-rust-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friii111%2Fgo-rust-comparison/lists"}