Giter Club home page Giter Club logo

dena-2024-team9's Introduction

Training app 2024

docker-compose structure

How to develop

$ docker-compose up
  • backend: http://localhost:9000
  • frontend: http://localhost:3000

でWebサーバが起動します。

Initial setup

初期状態で、DBから値を読み出してHello worldを表示する構成となっていますが、初回起動時にはテーブルが存在しないためWebサーバへのアクセスがエラーになります。 起動後に以下のスクリプトを実行してテーブルの作成と初期データの投入を行ってください。

host$ docker-compose exec db sh -c "mysql < /sqlscripts/create.sql"
host$ docker-compose exec db sh -c "mysql training < /sqlscripts/insert.sql"

Reactを開発する人はブラウザの拡張機能をインストールしてください。(任意)

  • React Developer Tools
  • Redux DevTools

How to connect database

host$ docker-compose exec db mysql training

How to connect backend/frontend shell

host$ docker-compose exec backend bash
host$ docker-compose exec frontend bash

ライブラリをインストールする場合はdockerコンテナ側でコマンドを実行してください。

e.g.

host$ docker-compose exec backend bash
backend$ go get -u gorm.io/gorm
host$ docker-compose exec frontend bash
frontend$ npm install something

VS Codeなどで開発する場合、コンテナ側にインストールされたモジュールが参照できないために、エディター上でエラーが表示される場合があります。

その場合はお手数ですが、ホストOS側でもモジュールのインストールをお願いします。

host$ cd frontend
host$ npm install

frontend(nodejs)をDocker外で動かすための設定変更

ディレクトリ構成

Backend

backend/
  internal/ : ソースコード
    config/ : 設定類
    entities/ : モデル/エンティティ
    external/ : 外部環境との接続定義
    interfaces/ : インターフェース
    middleware/ : ginのmiddleware
    repositories/ : リポジトリ - systemに近い部分の実装
    usecases/ : ユースケース - ビジネスに近い部分の実装

Frontend

frontend/
  index.html
  public/
    画像などの静的ファイル
  src/
    main.tsx: Reactアプリケーションが起動するエントリーポイント
    app/
      機能横断的に使う機能をまとめる
    features/
      post/
        ドメインごとの機能をまとめる
    shared/
      components/
        再利用可能な小さなUIコンポーネント
      services/
        共有関数
      hooks/
        共有React Hook
      models/
        共有Model
      store/
        Redux Store関連

dena-2024-team9's People

Contributors

marie673 avatar chocono2230 avatar bird0401 avatar chihirokubo avatar y2-2 avatar shunjikonishi avatar fusho-takahashi avatar

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.