https://github.com/chrisvel/wreeto_official
wreeto
项目地址
https://github.com/chrisvel/wreeto_official
下载项目源码
git clone git@github.com:chrisvel/wreeto_official.git
Ruby 版本选择
3.0.3
安装项目依赖的 gem
bundle install
修改 Gemfile 中 devise 的版本
gem 'devise', git: 'git@github.com:heartcombo/devise', branch: 'main'
rails about
About your application's environment
Rails version 6.1.4.1
Ruby version ruby 3.0.3
RubyGems version 3.1.6
Rack version 2.2.3
Middleware Webpacker::DevServerProxy, Rack::MiniProfiler, ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper, Warden::Manager, Remotipart::Middleware, Rack::Attack, Bullet::Rack, Rack::Pjax, OmniAuth::Strategies::GoogleOauth2
Application root /home/peng/RailsTrainCamp/code/1102/wreeto_official
Environment development
启动数据库
sudo service postgresql start
修改数据库配置
default: &default
adapter: postgresql
pool: <%= ENV["DATABASE_POOL"] || 64 %>
timeout: 5000
encoding: utf-8
development:
<<: *default
database: wreeto_dev
test:
<<: *default
database: wreeto_test
production:
<<: *default
database: <%= ENV['POSTGRES_DB'] %>
执行数据库迁移
执行数据库创建、迁移、填充数据等操作
rails db:create
rails db:migrate
rails db:seed
启动 webpack-derver
npm install -g yarn
yarn
./bin/webpack-dev-server
开发环境下启动 rails 项目
rails s
项目首页 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-3uMnx4Od-1639145291469)(img/wreeto01.jpg)]
数据库概览
ActiveRecord::Schema.define(version: 2021_07_19_092652) do
enable_extension "hstore"
enable_extension "plpgsql"
create_table "accounts", force: :cascade do |t|
t.string "name"
t.string "subdomain"
t.string "website_url"
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.string "service_name", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "anonymous_inquiries", force: :cascade do |t|
t.integer "reason"
t.text "body"
t.string "fullname"
t.string "email"
t.hstore "meta"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "backups", force: :cascade do |t|
t.string "fullpath"
t.integer "state"
t.bigint "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_backups_on_user_id"
end
create_table "categories", force: :cascade do |t|
t.string "title"
t.text "description"
t.bigint "user_id"
t.bigint "parent_id"
t.boolean "active", default: true, null: false
t.boolean "deletable", default: true, null: false
t.string "slug"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "type"
t.index ["parent_id"], name: "index_categories_on_parent_id"
t.index ["slug", "user_id"], name: "index_categories_on_slug_and_user_id", unique: true
t.index ["user_id"], name: "index_categories_on_user_id"
end
create_table "digital_gardens", force: :cascade do |t|
t.string "slug"
t.string "title"
t.boolean "enabled", null: false
t.bigint "user_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["slug"], name: "index_digital_gardens_on_slug"
t.index ["user_id"], name: "index_digital_gardens_on_user_id"
end
create_table "digital_gardens_notes", id: false, force: :cascade do |t|
t.bigint "digital_garden_id", null: false
t.bigint "note_id", null: false
t.index ["digital_garden_id", "note_id"], name: "index_dgs_notes"
t.index ["note_id", "digital_garden_id"], name: "index_notes_dgs"
end
create_table "inquiries", force: :cascade do |t|
t.integer "reason"
t.text "body"
t.bigint "user_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.hstore "meta"
t.index ["user_id"], name: "index_inquiries_on_user_id"
end
create_table "notes", force: :cascade do |t|
t.bigint "user_id"
t.bigint "category_id"
t.string "title"
t.text "content"
t.boolean "favorite"
t.string "serial_no"
t.string "images"
t.integer "sharestate"
t.string "guid"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "dg_enabled", default: false
t.string "ancestry"
t.index ["ancestry"], name: "index_notes_on_ancestry"
t.index ["category_id"], name: "index_notes_on_category_id"
t.index ["guid"], name: "index_notes_on_guid", unique: true
t.index ["user_id"], name: "index_notes_on_user_id"
end
create_table "taggings", force: :cascade do |t|
t.bigint "tag_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "taggable_type"
t.integer "taggable_id"
t.index ["tag_id"], name: "index_taggings_on_tag_id"
end
create_table "tags", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.index ["user_id"], name: "index_tags_on_user_id"
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.string "firstname"
t.string "lastname"
t.string "provider"
t.string "uid"
t.string "token"
t.integer "expires_at"
t.boolean "expires"
t.string "refresh_token"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "username"
t.bigint "account_id"
t.text "add_ons", default: [], array: true
t.index ["account_id"], name: "index_users_on_account_id"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["username"], name: "index_users_on_username", unique: true
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "backups", "users"
add_foreign_key "categories", "categories", column: "parent_id"
add_foreign_key "categories", "users"
add_foreign_key "digital_gardens", "users"
add_foreign_key "inquiries", "users"
add_foreign_key "notes", "categories"
add_foreign_key "notes", "users"
add_foreign_key "taggings", "tags"
add_foreign_key "tags", "users"
add_foreign_key "users", "accounts"
end
|