链接聚合Web应用程序类似于Ruby on Rails的Reddit

网友投稿 811 2022-10-24

链接聚合Web应用程序类似于Ruby on Rails的Reddit

链接聚合Web应用程序类似于Ruby on Rails的Reddit

RoRdit is a link aggregation web application like Reddit and Hacker News.

It uses number of technologies: Ruby on Rails for the back-end, VueJS for the front-end, PostgreSQL for database management, Elasticsearch for search engine.

With Rordit app, you can share link, make comment or give a point to link or comment after register the application.

You can test it here: https://rordit.herokuapp.com

Installation

First of all we need to database management system. Install PostgreSQL with this command: $ brew install postgresql After the installation we need to run PostgreSQL with this command: $ pg_ctl -D /usr/local/var/postgres startPS: If you want, you can use Postgres app for starting and stopping PosgreSQL easily. Now we need to RoRdit application. You can clone this repo with: $ git clone git@github.com:mertbulan/RoRdit.git After the cloning process we need to install gems which are required for this application: $ cd RoRdit && bundle Now, we need to create database and create some settings. You have two options: If you want create database and seed this database (with creating 1 admin user, 50 users, 50 links from Hacker News, 100 points, 100 comments): $ rake db:setup Or you can create database and add only necessary site settings in Rails console: $ rake db:create $ rails cAdminUser.create(email: 'admin@example.com', password: 'password', password_confirmation: 'password')SiteSetting.create(title: "RoRdit", slogan: "Slogan is here.")PS: If you don't want to do this job in rails console, you can just run settings task: $ rake settings:create After creating database and seeding with settings, we need to install elasticsearch. For that you have two options: If you want to use Heroku, there is a good add-on for that called Bonsai. You only need to create an account for Bonsai and install Bonsai to your Heroku app. There is a guide for that at here. If you want to run elasticsearch on your local server; First, we need to install elasticsearch: $ brew install elasticsearch Then, delete bonsai-elasticsearch-rails gem and add elasticsearch-model and elasticsearch-rails gems to Gemfile. gem 'elasticsearch-model' gem 'elasticsearch-rails' Finally, we need to run elasticsearch with this command: $ elasticsearch After the installation of elastichsarch we have one step for configuration the elasticsearch. In Rails console, we need to create index and import our Link model. $ rails c Link.create_index! Link.import After the all steps, now, we can run the server with this command: $ rails s

If you want you can change your site title, slogan and logo at admin panel page: localhost:3000/admin

❗ Don't forget to add SMTP settings at admin panel. Otherwise password recovery feature does not work.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:no matching mac found
下一篇:一个用php和swoole编写的开源云剪贴板程序
相关文章

 发表评论

暂时没有评论,来抢沙发吧~