Finished and closed project (at least for now)
A simple phorum in rails, including basic user and permission management, categories and topics. I started this project to learn Rails. For this reason I didn’t follow any particular code style, usually making similar things in different ways. Also, I kept the CSS at a minimum and I don’t plan to make this forum any “prettier”. However, feel free to contribute in this or any other way :-)
A category contains many topics, a topic contains many posts. The topics and posts are shown in pages when needed. A topic itself contains a message, and it’s seen on top of all pages of this topic. Under the topic’s message there are the posts, ordered so that the bottom ones were published later.
In Phorum, the guests can only read posts and user info, and there are three permission levels for registered users:
-
Level 2: User. Can make new posts and topics. Also, has power over his content (can edit or remove) and his profile. If he removes his account, all his messages will be edited so they say “DELETED”.
-
Level 1: Moderator. Has power over all posts and topics.
-
Level 0: Admin. Has power over all users, can edit their profiles with some extra fields: An admin can change the permission level of another user and he can remove them in a way that all his posts and topics are totally deleted. Also, an admin has power over the categories and can create new ones. If there is no admin account in the Phorum, the next registered user becomes automatically an admin.
A topic is considered to be updated when someone posts something new OR a post is edited, so the last updated post doesn’t have to be the same as in the “Last post” link.
When someone posts a link, it’s transformed into an actual clickable link. If the link happens to be an image, the image is placed into the post. I’ve been extra careful with these features and made many security tests.
Requirements to make this work:
-
ruby 2.0.0
-
Rails 4.1.4
-
mysql2 (this gem works well with MariaDB: mariadb.org )
-
tzinfo-data (only for Windows)
-
devise
-
will_paginate 3.0
-
rails_autolink
-
rails-perftest
-
ruby-prof
-
Some default gems:
-
sass-rails 4.0.3
-
uglifier 1.3.0
-
coffe-rails 4.0.0
-
jquery-rails
-
turbolinks
-
jbuilder 2.0
-
scod 0.4.0
-
This project was developed on Windows, because any idiot could do it in Linux. There is no honor in going by the easy path. However, these instructions are for GNU/Linux systems, and were tested in Ubuntu:
-
First, ensure that you have your ruby on rails environment correctly installed, with the same or above versions as specified above. You should also have the bundler gem installed with rails, check it with
bundle -v
. -
Then comes the database configuration. The phorum should work well with MySQL or MariaDB.
apt-get install mariadb-server mariadb-client libmariadbd-dev libmariadbclient-dev
should do the trick. Then you mess withconfig/database.yml
file (the default configuration should work also) and create the database and user accordingly in the usual mysql syntax. -
Run
bundle install
-
Run
rake db:migrate
-
Run
rails s
, go to localhost:3000. If everything went well, you should be seeing the Phorum main page, with no categories yet. Sign up and create some!
The project is also Windows-ready, but it’s still a real pain just to get it working. Contact me if you need support on this.