Giter Club home page Giter Club logo

mountix's Introduction

mountix api

日本の山岳一覧・百名山 API

Getting Started

DB initialization

データベースは MongoDB Atlas Database を使用します。

事前にプロジェクト、クラスター、データベースを作成し Connection string を取得する必要があります。

Examples:

  • Project Name: mountix
  • Cluster Name: Mountix-Cluster0
  • Database Name: mountix_db
cd ./migrations/
./migrate.sh
cd ../

Note:

Run the web application

cargo run

Architecture

  • mountix-driver (driver or controller)
    • ルーターとサーバーの起動を実装する
    • Axum の機能を利用してエンドポイントとサーバーの起動までを実装する
    • 内部的に行われた処理の結果、どのようなステータスコードを返すかをハンドリングしたり、JSON のシリアライズ・デシリアライズも担当する
  • mountix-app (app or usecase)
    • ユースケースのレイヤーで、アプリケーションを動作させるために必要なロジックを記述する
    • 複数リポジトリをまたいでアプリケーションに必要なデータ構造を返すなどをおこなう
  • mountix-kernel (kernel or domain)
    • ドメインのレイヤーで、アプリケーションのコアとなる実装を記述する
    • ドメインモデルの生成の記述などをおこなう
  • mountix-adapter (adapter or infrastructure)
    • 外部サービスとの連携のレイヤー
    • RDS との接続やクエリの発行、MongoDB との接続や操作の実装を記述する

このリストの上側は上位レイヤー、下側は下位レイヤーになることです。 上位のレイヤーは下位のレイヤーを呼び出したり利用したりできますが、逆の呼び出しは許されません。 例えば、driver は app のモジュールを呼び出せますが、app は driver のモジュールを呼び出せません。

kernel と adapter の間にはDIP (Dependency Inversion Principle) が適用されます。例えば、kernel のリポジトリにはtraitの定義があるだけで、その実装は adapter にあります。

driver には Axum の定義程度しかありません。 Axum のRouter、ハンドラ、サーバの起動、Web アプリケーションの定義や設定に関することは、このレイヤーの中で定義する必要があります。

app はいわゆるユースケースのレイヤーです。このレイヤーはアプリケーションのプロセス全体を制御し、ロジックはこの範囲内で定義する必要があります。

kernel はいわゆるドメインのレイヤーです。このレイヤーはアプリケーションの中核となるコンテキストです。

adapter はインフラストラクチャに関係します。このレイヤーは外部のミドルウェアやサービス、APIに接続し、アクセスすることができます。 アクセスや接続の処理は、このレイヤーに定義されなければなりません。

License

This project is licensed under the MIT license.

mountix's People

Contributors

codemountains avatar kazuno-fukuda avatar

Stargazers

sugawarayss avatar takahiro koide avatar Ocat avatar Rintaro Itokawa avatar yuta avatar Gonda avatar yuchou avatar rust avatar

Watchers

 avatar

Forkers

saissei

mountix's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.