Skip to content

Created as part of the App Academy Bootcamp ruby-on-rails Exercise

Notifications You must be signed in to change notification settings

YatootaY/reddit-mini

Repository files navigation

Mini Reddit

A mini version of the website we all love and enjoy

  • Signup & login to your account
  • Create subs of your interest
  • Create posts in the sub

How to access the website

Through the heroku webstie

Go to the website Here

In your local machine

  1. First, clone this repo to your local mechine with git command.
  • git clone https://github.com/YatoAki/reddit-mini
  1. Go to the cloned source code dictionary.
  • cd ./reddit-mini
  1. Install the required gems
  • bundle install
  1. Migrate the database
  • rails db:migrate
  1. Run the rails server
  • rails server
  1. Go to http://localhost:3000/ in your broswer

Authentication

Bcrypt

  • By using the password-hashing function called Bcrypt, we were able to minimize dataleak by only keep hashed version of passwords

Session Token

  • We allow users to login by giving session token as cookie

Website architecture

Model

User - user.rb

  • username, password_digest (hashed password), session_token
  • has many posts, subs

Sub - sub.rb

  • name, detail
  • belongs to moderator
  • has many posts

Post - post.rb

  • title, content
  • belongs to author, sub

Controller

UsersController - users_controller.rb

  • new, create

SessionsController - sessions_controller.rb

  • create, new, destroy

SubsController - subs_controller.rb

  • create, new, destroy, index, show, edit, update

PostsController - posts_controller.rb

  • create, destroy, show

Comming soon ...

  • Upvote & downvote
  • Comments

About

Created as part of the App Academy Bootcamp ruby-on-rails Exercise

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published