kaito0046 / el-training

Sample app to learn RoR again
https://el-training-kaitofu.herokuapp.com/
MIT License
0 stars 0 forks source link

El-Training

[Ruby version]() [RoR version]() [License MIT]() [CircleCI]()

このアプリケーションは、RubyおよびRuby On Railsを用いた基本的なWebアプリケーション作成の学習過程において制作されたものです。

This application was created in the learning process of basic Web application creation by Ruby and Ruby On Rails.

Curriculum

株式会社万葉の新入社員教育用カリキュラム https://everyleaf.com/

Reference

現場で使える Ruby on Rails 5速習実践ガイド

Published at:

https://el-training-kaitofu.herokuapp.com/

The following User can be used:

[User as an admininstrator]

email: "test_user_a@example.com", password: "password"

[Common user]

email: "test_user_b@example.com", password: "password"

Requirement

Ruby 2.5.3

Bundler 1.17.3

PostgreSQL 11.1

Installation

  1. Clone this repository

    $ git clone git@github.com:kaitofu/el-training.git
  2. Move into your project

    $ cd el-training
  3. Install Ruby 2.5.3 (If nessesary)

    $ rbenv install 2.5.3
  4. Set Ruby version to 2.53(If nessesary)

    $ rbenv local 2.5.3
  5. Install Bundler 1.17.3(If nessesary)

    $ gem install bundler -v 1.17.3
  6. Install gems

    $ bundle install
  7. Install PostgreSQL(If nessesary)

    $ brew install postgresql
  8. Start PostgreSQL(If nessesary)

    $ brew services start postgresql
  9. Create database

    $ bin/rails db:create
  10. Exec migration

    $ bin/rails db:migrate RAILS_ENV=development
  11. Create sample data(If nessesary)

    $ rake db:seed
  12. Build & run server

    $ bin/rails s

    Then, you can see app in http://localhost:3000

Deployment instructions

Initial deployment

  1. Login Heroku

    $ heroku login
  2. Register remote repository to Heroku

    $ heroku git:remote -a el-training-kaitofu
  3. Deploy application to server

    $ git push heroku master
  4. Exec database migration

    $ heroku run bin/rails db:migrate

Deployment for update

$ heroku login
$ git add -A
$ git commit -m "Update application"
$ git push heroku master

* If db had been changed
$ heroku run bin/rails db:migrate

Table Schema

Tables

no. name
1 Tasks
2 Users
3 Labels
4 LabelTasks

Tasks Table

column_name data_type not_null default index comments
task_id integer true
name string true true [validation] until 30 character s
priority integer
description text
status string true "未着手" true
user_id integer true true
deadline date [validation] should be today or later
created_at datetime true
updated_at datetime true

User Table

column_name data_type not_null default index comments
user_id integer true
name string true
email string true true [validation] should be based on RFC2822
password_digest string true
admin boolean true false
created_at datetime true
updated_at datetime true

Labels Table

column_name data_type not_null default index comments
label_id integer true
name string true
user_id integer true
created_at datetime true
updated_at datetime true

LabelTasks Table

column_name data_type not_null default index comments
label_id integer
user_id integer
created_at datetime true
updated_at datetime true

License

This project is licensed under the MIT License - see the LICENSE.md file for details