Coder Social home page Coder Social logo

go_request3's Introduction

リクエスト集中講義Go

今回は、クイズ投稿サイトを作りました。 topページで質問と解答を入力することでクイズの問題を作成し、Quizリンクをクリックすると今まで作成されたクイズが一覧で表示されます。

全て解いてAnswerボタンを押すと、正解不正解が円グラフで表示されます。

また、Send resultボタンを押すとクイズの結果をデータベースに登録できる機能もつけました。この登録された結果データベースを用いて他人の点数と比較できるような棒グラフを作ろうとしましたが、上手く表示できませんでした。

一番下のButtonリンクはAjaxを試験したものなので関係ないです。

動作方法

$ cd $GOPATH $ go get github.com/revel/revel $ go get github.com/revel/cmd/revel $ revel new GoRequest $ git clone [email protected]:AndooBomber/Go_Request3.git $ npm install $ npm start

実装方針

今回は、GoのフレームワークとしてRevelを使いました。理由としては、普段MEANスタックでの開発をしていたのでMVCフレームワークがとっつきやすかったという点と参考サイトが多くあった点が大きかったです。ただ、Revelについて調べていたらメルカリさんの技術ブログにベンチマークが標準パッケージよりも2倍近くかかっていたのを発見し、やはり、フルスタックは速度が落ちるようなので用途に応じて使用するかどうか考えていくようにしたいです。

また、データベースはMongoDBを選択しました。これもMEANでの経験があったという点と、データが蓄積し続ける点よりビックデータ用に選定しました。また、予てよりgoroutineを使ってみたかったので、データベースの処理部分で使ってみました。

フロントはReactで書いています。今まで書いたことは無かったのですが、今回Goと一緒に挑戦してみたかったため取り入れました。その挑戦により、今回全て完成させるまでに至らなかったのでとても反省しております。

ライブラリとしてグラフの描画にRecharts、ボタンやフォームの部分にbootstrapを使っています。ここの選定は見た目のみです。

今回、時間が足りずにテストが作れなかったのでXSS対策やバグが解決できていないので今後は品質を高めるべく、テストコードを書いていこうと思います。

Welcome to Revel

A high-productivity web framework for the Go language.

Start the web server:

revel run myapp

Go to http://localhost:9000/ and you'll see:

"It works"

Code Layout

The directory structure of a generated Revel application:

conf/             Configuration directory
    app.conf      Main app configuration file
    routes        Routes definition file

app/              App sources
    init.go       Interceptor registration
    controllers/  App controllers go here
    views/        Templates directory

messages/         Message files

public/           Public static assets
    css/          CSS files
    js/           Javascript files
    images/       Image files

tests/            Test suites

Help

go_request3's People

Contributors

andoobomber avatar

Watchers

 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.