/reddit

Main features of reddit on your command line.

Primary LanguageRuby

Reddit

A mini reddit clone to run on terminal.

screenshot


This project consists of using Ruby On Rails to build a mini blog post system, based on command line. The application allows users to create posts and make comments.

Content

Features

  • The model has Authors, Posts and comments
  • The tables has the correct relationships
  • The inputs are checked for basic validations

Built With

  • Ruby 2.7
  • Ruby on Rails 5.2
  • Rubocop (Linter) with Stickler (CI Tool)
  • Git, Github and VScode

ERM Diagram

screenshot

Getting Start

Install

To use this program, you will need install:

Get a local copy

Now you need a copy of this application, if you are using Git:

git clone git@github.com:SevlaMare/reddit.git

Otherwise just hit (Download Zip) on green button (Clone or Download) at top of this page.

Run

Go to project folder and run on terminal:

rails console

To insert some data:

We can create an author

x = Author.create(username: "userA", email: "abc@email.com", password: "password123")

Make a post

x.posts.create(title: "new post", body: "this is a post")

Make a comment

Post.first.comments.create(body: "some text", user_id: 1)

You can query some values, like:

retrieve a user

user1 = Author.find(1)

check his first comment

c1 = user1.comments.first

see comments that belongs to this author

c1.author

can do the same for posts:

p1 = Post.first
p1.comments.first
c1.post

to leave

exit

Contributing

Contributions, issues and feature requests are welcome!

You can do it on issues page.

Acknowledgments

A special thanks for the code reviewers.

Author

👤 Rafael Nazario

👤 Thiago Miranda

License

Creative Commons