Skip to content

damouu/library-app-comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library App Comments Service / コメントサービス

Distributed Library System — Comments Service

分散型図書館システム — コメントサービス


Overview / 概要

The Comments Service is responsible for managing user-generated content within the distributed library platform.

It allows users to create, retrieve, update, and delete book reviews, ratings, and comments while maintaining content validation and sanitization rules.

Built with Node.js and Express, the service leverages MongoDB's flexible document model to efficiently store and retrieve social interaction data at scale.


Comments Service は分散型図書館システムにおけるユーザー生成コンテンツ管理サービスです。

書籍に対するコメント、レビュー、評価の作成・取得・更新・削除を担当します。

MongoDB の柔軟なドキュメントモデルを活用し、高速な読み書きとスケーラブルなデータ管理を実現しています。


Service Boundaries / サービス境界

Provides

  • Comment management
  • Review management
  • Rating management
  • User-generated content storage
  • Content sanitization
  • Social interaction APIs
  • Comment retrieval
  • Review lifecycle management

Does Not Handle

  • User authentication
  • User account management
  • Borrow transactions
  • Inventory management
  • Book catalog management
  • Notification delivery
  • Analytics aggregation
  • Search indexing

Badges

Tests Merge PR Prepare YouTrack-Staging YouTrack Closed

Codecov

Docker Build Docker Image Docker Pulls

Git Tag

Prometheus


Responsibilities / 責務

English

  • Create comments
  • Update comments
  • Delete comments
  • Retrieve comments
  • Manage ratings
  • Manage reviews
  • Sanitize user-generated content
  • Maintain comment lifecycle consistency

日本語

  • コメント作成
  • コメント更新
  • コメント削除
  • コメント取得
  • 評価管理
  • レビュー管理
  • ユーザー投稿内容サニタイズ
  • コメントライフサイクル管理

Technology Stack / 技術スタック

Category Technology
Runtime Node.js
Framework Express 5
Database MongoDB
ODM Mongoose
Authentication JWT Validation
Validation sanitize-html
Monitoring Prometheus
Testing Jest / Supertest
Containerization Docker
CI/CD GitHub Actions

API Endpoints / API エンドポイント

Comment Operations / コメント操作

Create Comment

POST /comments

Creates a new book review or comment.

書籍に対する新しいコメントを作成します。


Get Comments

GET /comments

Returns stored comments and ratings.

コメントおよび評価情報を取得します。


Update Comment

PUT /comments/{commentUUID}

Updates an existing comment.

既存コメントを更新します。


Delete Comment

DELETE /comments/{commentUUID}

Deletes an existing comment.

既存コメントを削除します。


Processing Flow / 処理フロー

Comment Request

JWT Validation

Content Sanitization

Business Validation

MongoDB Persistence

Response Generation


Comment Lifecycle / コメントライフサイクル

Client Request

Input Validation

Content Sanitization

Database Persistence

Comment Retrieval

User Interaction


API Documentation / API ドキュメント

/api/comments

Local Development / ローカル開発

Requirements

  • Node.js
  • npm
  • Docker
  • MongoDB

Run

npm install

npm run dev

Testing / テスト

npm test

Includes

  • Unit tests
  • Integration tests
  • API tests
  • Controller tests
  • Repository tests
  • Coverage verification

日本語

含まれるテスト:

  • ユニットテスト
  • 統合テスト
  • API テスト
  • コントローラテスト
  • Repository テスト
  • カバレッジ検証

Build Quality / 品質保証

The CI pipeline enforces:

  • Automated test execution
  • Coverage thresholds
  • Lint validation
  • Pull request validation
  • Docker image publication
  • Branch protection workflows

日本語

CI パイプラインでは以下を保証します:

  • 自動テスト実行
  • カバレッジ閾値管理
  • Lint 検証
  • Pull Request 検証
  • Docker イメージ配布
  • ブランチ保護ワークフロー

Monitoring / モニタリング

/metrics

Prometheus metrics endpoint.

Prometheus メトリクスエンドポイント。


Architectural Role / アーキテクチャ上の役割

The Comments Service represents the social interaction layer of the distributed library system.

It isolates user-generated content from transactional services and allows independent scaling of review and rating workloads.


Comments Service は分散型図書館システムにおけるソーシャルインタラクション層です。

ユーザー生成コンテンツを他サービスから分離することで、レビューや評価機能を独立してスケールさせることができます。


License / ライセンス

MIT

About

図書館システムのコメント欄のAPIで、会員がコメントを登録したり登録されたメント取得したり削除したりこのAPIお通じてすることが出来ます。

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors