-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.md
135 lines (89 loc) · 5.13 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# FakeBook
A simple Facebook web app.
**Fakebook** is a simple Facebook web app, made using the methodology of [The Oding Project](https://www.theodinproject.com). This project asks us to make a fake Facebook app and you can click [here](https://www.theodinproject.com/courses/ruby-on-rails/lessons/final-project) to see the project requirements.
After each milestone the project will be reviewed and approved by a **TSE** from [Microverse](https://microverse.org).
## Built With
- Ruby
- Ruby on Rails Framework
- HTML
- CSS
- Lucid Chart - For building the ERB which you can see [here](doc/Facebook%20users%20diagram.pdf)
# Author
This project was created by:
* António Fernandes [Github](https://github.com/trox115) | [Twitter](https://twitter.com/rock_67) | [LinkedIn](https://www.linkedin.com/in/antoniomfernandes/) | [Email](mailto:[email protected]) | [Portfolio](https://www.antoniofernandes.com/)
* Carlos Del Real [Github Account https://github.com/carloshdelreal](https://github.com/carloshdelreal)
# The Web App
![Screenshot](doc/fakebook.png)
The live version of this project is on [Fakebook by Carlos and António](https://frozen-everglades-48914.herokuapp.com).
# Required Installations
If you want a copy of this project running on your machine you have to install:
* Ruby 2.6
* gem 3.0
* Bundler 1.17
* Rails 6.0.0
For installation instructions follow [The Installation Guide](https://www.tutorialspoint.com/ruby-on-rails/rails-installation)
# Installation of This App
Once you have installed the required packages shown on the [Required Installations](), proceed with the following steps
Clone the Repository, the folder toy_app will be downloaded
```Shell
your@pc:~$ git clone https://github.com/trox115/Fakebook.git
```
Move to the downloaded folder
```Shell
your@pc:~$ cd Fakebook
```
Install gems
```Shell
your@pc:~$ bundle install --without production
```
Migrate the database
```Shell
your@pc:~$ rails db:create
your@pc:~$ rails db:migrate
```
Finally, run the test suite to verify that everything is working correctly:
```Shell
your@pc:~$ rspec
```
If the test suite passes, you'll be ready to run the app in a local server:
If you desire to create dummy data to see the apps functionality run
```Shell
your@pc:~$ rails db:seed
```
To enable the Facebook login system you have to provide two environment variables with the keys to do that you have to
```Shell
your@pc:~$ export FACEBOOK_ID=heregoesyourfacebookappid
your@pc:~$ export FACEBOOK_KEY=heregoesyourfacebookappkey
```
Lastly, run the server
```Shell
your@pc:~$ rails server
```
Then, go to [http://localhost:3000/](http://localhost:3000/)
Voila!
# License
All the source code in the [The Odin Project](https://www.theodinproject.com/courses/ruby-on-rails/lessons/forms) is available jointly under the MIT License and the Beerware License.
# Final Project Checklist
- [x] Use Postgresql for your database from the beginning (not sqlite3), that way your deployment to Heroku will go much more smoothly. See the Heroku Docs for setup info.
- [x] Users must sign-in to see anything except the sign-in page.
- [x] User sign-in should use the Devise gem. Devise gives you all sorts of helpful methods so you no longer have to write your user password, sessions, and #current_user methods. See the Railscast (which uses Rails 3) for a step-by-step introduction. The docs will be fully current.
- [x] Users can send Friend Requests to other Users.
- [x] A User must accept the Friend Request to become friends.
- [x] The Friend Request shows up in the notifications section of a User’s navbar.
- [x] Users can create Posts (text only to start).
- [x] Users can Like Posts.
- [x] Users can Comment on Posts.
- [x] Posts should always display with the post content, author, comments and likes.
- [x] Treat the Posts Index page like the real Facebook’s “Timeline” feature – show all the recent posts from the current user and users she is friends with.
- [x] Users can create a Profile with a Photo (just start by using the Gravatar image like you did in the Rails Tutorial).
- [x] The User Show page contains their Profile information, photo, and Posts.
- [x] The Users Index page lists all users and buttons for sending Friend Requests to those who are not already friends or who don’t already have a pending request.
- [x] Sign in should use Omniauth to allow a user to sign-in with their real Facebook account. See the RailsCast on FB authentication with Devise for a step-by-step look at how it works.
- [x] Set up a mailer to send a welcome email when a new user signs up. Use the letter_opener gem (see docs here) to test it in development mode.
- [x] Deploy your App to Heroku.
- [x] Set up the SendGrid add-on and start sending real emails. It’s free for low usage tiers.
## Extra Credit
- [ ] Make posts also allow images (either just via a URL or, more complicated, by uploading one).
- [ ] Use the Active Storage to allow users to upload a photo to their profile.
- [ ] Make your post able to be either a text OR a photo by using a polymorphic association (so users can still like or comment on it while being none-the-wiser).
- [x] Style it up nicely! We’ll dive into HTML/CSS in the next course.