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
-
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 start
PS: 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 c
AdminUser.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 addelasticsearch-model
andelasticsearch-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.