Git Product home page Git Product logo

Comments (3)

shohu avatar shohu commented on August 29, 2024

要チェックな10個の Node.js フレームワーク

を見ると、もっとも人気があるフレームワークとして
AdonisJs
が紹介されている。ORマッパーもあるためDBの連携も楽そうなためこれを試してみる。

Adonisは、Nodejs上で動く LaravelインスパイアなフルスタックWebアプリケーションフレームワーク。

AdonisJs というフレームワークを解説してみる(基本的な使い方編:1 インストール)v4.1

from estate-sample.

shohu avatar shohu commented on August 29, 2024

AdonisJs を導入

dockerコンテナ作成してそこでsampleアプリ作成してみる。

Dockerfile

FROM node:8.16

COPY . /web
WORKDIR /web

RUN npm i -g @adonisjs/cli

sampleプロジェクト

# adonis new sample
    _       _             _         _
   / \   __| | ___  _ __ (_)___    | |___
  / _ \ / _` |/ _ \| '_ \| / __|_  | / __|
 / ___ \ (_| | (_) | | | | \__ \ |_| \__ \
/_/   \_\__,_|\___/|_| |_|_|___/\___/|___/

  [1/6] 🔬  Requirements matched [node & npm]
  [2/6] 🔦  Ensuring project directory is clean [sample]
  [3/6] 📥  Cloned [adonisjs/adonis-fullstack-app]
  [4/6] 📦  Dependencies installed
  [5/6] 📖  Environment variables copied [.env]
  [6/6] 🔑  Key generated [adonis key:generate]

🚀   Successfully created project
👉   Get started with the following commands

$ cd sample
$ adonis serve --dev

dockerコンテナ上で動かしているのでaccessできるように .envのHOSTを
HOST=127.0.0.1 -> HOST=0.0.0.0
に切り替えて起動すると以下のように無事動いた 👍

スクリーンショット 2019-06-10 10 25 25

AdonisJSでLaravel(5.1)のチュートリアルしてみた

これをみてsampleプロジェクトをbrashupしていく。

sqlite3

yarn add sqlite3 --save

テーブル作成してみる

userテーブルはすでにあるのでログテーブルだけ作成

# adonis make:migration owner_balance_history
> Choose an action Create table
✔ create  database/migrations/1560130906332_owner_balance_history_schema.js

そして、migrationを実行してテーブルを作成する

# adonis migration:run
migrate: 1503248427885_user.js
migrate: 1503248427886_token.js
migrate: 1560130906332_owner_balance_history_schema.js
Database migrated successfully in 979 ms

fabricを導入

package.json に以下導入し、npm install

    "fabric-client": "~1.4.0",
    "fabric-network": "~1.4.0"

from estate-sample.

shohu avatar shohu commented on August 29, 2024

sampleサイト起動方法

localhost で以下実施

start_monitor_fabric.sh

localhostの他のterminalで以下実施

install_fabric_code.sh 0.1

from estate-sample.

Related Issues (15)

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.