Giter VIP home page Giter VIP logo

adb's Introduction

adb

adb is ARISA Idol Database

アイドルデータベースを更新し続けるのです!

これは非公式にアイマスの情報をまとめたWebサイトです。 Gatsby を使って、YAMLファイルなどに定義されたデータを GraphQL でまとめて React で表示しています。

Running in development

node npm が入っているか確認

$ node --version
v8.0.0
$ npm --version
5.0.2

Gatsby をインストール

$ npm install --global gatsby-cli

Clone してサイト立ち上げ

$ git clone [email protected]:whoiron/adb.git
...
$ gatsby develop

http://localhost:8000 にアクセス

Data, GraphQL and React

データを定義して

# discord.yaml
- id: "ありさーばー☆"
  link: http://google.com
  character: "松田亜利沙"

GraphQL でまとめると

{
  allDiscordYaml {
    edges {
      node {
        id
        link
        character
      }
    }
  }
}

JSON が取得できます。

{
  "data": {
    "allDiscordYaml": {
      "edges": [
        {
          "node": {
            "id": "ありさーばー☆",
            "link": "http://google.com",
            "character": "松田亜利沙"
          }
        },
      ]
    }
  }
}

この JSON を React で表示します。

export default ({data}) => (
  <div>
    <table>
      <thead>
      <tr>
        <th>キャラクター</th>
        <th>discord名</th>
      </tr>
      </thead>
      <tbody>
      {data.allDiscordYaml.edges.map(({node}, i) => (
        <tr key={`${i}`}>
          <td>{node.character}</td>
          <td><a href={node.link}>リンク</a></td>
        </tr>
      ))}
      </tbody>
    </table>
  </div>
);

GraphQL は http://localhost:8000/___graphql で実際に試すことができます。

さらに詳しい情報は Gatsbyのチュートリアル

Contributing

Issue

Issue に変更・追加してほしい情報をください。

Pull Request

  1. これを Fork ( https://github.com/whoiron/adb/fork )
  2. feature ブランチを作成 ( git checkout -b feature/my-new-feature )
  3. 変更を Commit ( git commit -am 'Add some feature' )
  4. Push ( git push origin feature/my-new-feature )
  5. Pull Request を作成

adb's People

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.