https://github.com/sevlamare/reddit
Main features of reddit on your command line.
https://github.com/sevlamare/reddit
rails sqlite3
Last synced: 6 months ago
JSON representation
Main features of reddit on your command line.
- Host: GitHub
- URL: https://github.com/sevlamare/reddit
- Owner: SevlaMare
- Created: 2020-04-28T15:06:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T18:37:55.000Z (over 2 years ago)
- Last Synced: 2025-02-13T04:48:46.353Z (8 months ago)
- Topics: rails, sqlite3
- Language: Ruby
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> A mini reddit clone to run on terminal.
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](#features)
* [Built With](#built-with)
* [Getting Start](#getting-start)
* [Contributing](#contributing)
* [Acknowledgments](#acknowledgments)
* [Author](#author)
* [License](#license)## 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

## Getting Start
#### Install
To use this program, you will need install:
* Ruby Language - Version 2.5 up to 2.7 - [Install guide](https://www.ruby-lang.org/en/documentation/installation/)
* Ruby on Rails - Version 5.2 - [Install guide](https://guides.rubyonrails.org/v5.0/getting_started.html#installing-rails)
#### Get a local copy
Now you need a copy of this application, if you are using Git:
```js
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:
```js
rails console
```
#### To insert some data:
We can create an author
```js
x = Author.create(username: "userA", email: "abc@email.com", password: "password123")
```
Make a post
```js
x.posts.create(title: "new post", body: "this is a post")
```
Make a comment
```js
Post.first.comments.create(body: "some text", user_id: 1)
```
#### You can query some values, like:
retrieve a user
```js
user1 = Author.find(1)
```
check his first comment
```js
c1 = user1.comments.first
```
see comments that belongs to this author
```js
c1.author
```
can do the same for posts:
```js
p1 = Post.first
p1.comments.first
c1.post
```
to leave
```js
exit
```
### Contributing
Contributions, issues and feature requests are welcome!
You can do it on [issues page](issues/).
## Acknowledgments
A special thanks for the code reviewers.
## Author
👤 **Rafael Nazario**
- Github: [@rsnazario](https://github.com/rsnazario)
- Twitter: [@rsnazario](https://twitter.com/rsnazario)
- Linkedin: [Rafael Nazario](https://www.linkedin.com/in/rafael-nazario-692b8293/)
👤 **Thiago Miranda**
- Github: [@SevlaMare](https://github.com/SevlaMare)
- Twitter: [#SevlaMare)](https://twitter.com/SevlaMare)
- Linkedin: [SevlaMare)](https://www.linkedin.com/in/sevlamare)
### License
Creative Commons