フリマアプリ
ユーザーを登録すると商品を出品できるようになります。自身が出品した商品は、編集と削除をすることができます。他のユーザーが出品した商品は、クレジットカードを用いて購入することができます。
https://furima-29074.herokuapp.com/
- ID: admin
- Pass: 2222
- メールアドレス: aozora@gmail.com
- パスワード: aozora1
- 番号:4242424242424242
- 期限:3月/(20)22年(未来の年月であれば可能)
- セキュリティコード:123
- メールアドレス名: konoha@gmail.com
- パスワード: konoha1
ユーザー登録することで出品・購入できるようになります。(ユーザー登録していない人でも出品している商品を見ることは可能です。)
商品画像を選択し、商品情報や販売したい金額を入力すると、出品することができます。(JavaScriptで販売手数料が表示されるようになっています。)
出品した商品について、編集することができます。その際に、ユーザーの手間を省くため出品時の情報が表示されるようになっています。
出品中であった商品について、削除ボタンを押すことで商品を削除することができます。
出品者以外であれば、商品を購入することができます。カード情報と配送先を入力すると購入できます。(JavaScriptとフォームオブジェクトを使用し、トークン化したカード情報をPAY.JPに送付しつつ、カード情報がアプリケーションのデータベースに保存されないように設計しています。)
Column | Type | Options |
---|---|---|
nickname | string | null: false, unique: true |
string | null: false, unique: true | |
encrypted_password | string | null: false, unique: true |
last_name | string | null: false |
first_name | string | null: false |
last_name_kana | string | null: false |
first_name_kana | string | null: false |
birthday | date | null: false |
- has_many :items
- has_many :orders
- has_many :comments
Column | Type | Options |
---|---|---|
user | references | null: false, foreign_key: true |
name | string | null: false |
description | text | null: false |
category_id | integer | null: false |
item_status_id | integer | null: false |
shipping_cost_id | integer | null: false |
prefecture_id | integer | null: false |
shipping_date_id | integer | null: false |
price | integer | null: false |
- belongs_to :user
- has_one :order
- has_many :comments
Column | Type | Options |
---|---|---|
user | references | null: false, foreign_key: true |
item | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :item
- has_one :payment
Column | Type | Options |
---|---|---|
orders | references | null: false, foreign_key: true |
postcode | string | null: false |
prefecture_id | integer | null: false |
city | string | null: false |
block | string | null: false |
building | string | |
phone_number | string | null: false |
- belongs_to :order
Column | Type | Options |
---|---|---|
user | references | null: false, foreign_key: true |
item | references | null: false, foreign_key: true |
text | text | null: false |
- belongs_to :user
- belongs_to :item
- ruby 2.6.5
- Rails 6.0.3.4
- MySQL 5.6.47
% git clone https://github.com/erika618/furima-29074.git
% cd furima-29074
% bundle install
% rails db:create
% rails db:migrate
% yarn install
<!-- rubocop(インデントを整えるため) -->
% bundle exec rubocop -a