Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying on Heroku #387

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5e2b1b1
Add docs & picture of relatioship between models
Mhdez221993 Jun 16, 2021
3e2c618
Readme fix
1v4n4 Jun 16, 2021
1605767
Add friendship table to erd
Mhdez221993 Jun 17, 2021
2eec709
Merge branch 'erb' of github.com:Mhdez221993/social-media-website int…
Mhdez221993 Jun 17, 2021
22bd711
Add linter & rubocop files
Mhdez221993 Jun 17, 2021
1cd9eea
Add readme
1v4n4 Jun 17, 2021
dcac121
Update PK on erd
Mhdez221993 Jun 17, 2021
daeaa0c
Merge branch 'erb' of github.com:Mhdez221993/social-media-website int…
Mhdez221993 Jun 17, 2021
b141b1b
Add friendship model
1v4n4 Jun 17, 2021
79cfe97
Udd PK on User Comment & Freinship tables or erd
Mhdez221993 Jun 17, 2021
c274ff2
Update create acction
Mhdez221993 Jun 17, 2021
4bee18c
Add create method for friendship
1v4n4 Jun 17, 2021
175ef42
Merge pull request #1 from Mhdez221993/erb
Mhdez221993 Jun 17, 2021
68ebeb7
Tests added
1v4n4 Jun 18, 2021
2baf0b1
Invitation management added
1v4n4 Jun 18, 2021
787a653
Merge erb branch
Mhdez221993 Jun 18, 2021
43d7acf
OMerge branch 'development' of github.com:Mhdez221993/social-media-we…
Mhdez221993 Jun 18, 2021
a790d0f
Fix linters
Mhdez221993 Jun 18, 2021
33726ab
Fix stylelint
Mhdez221993 Jun 18, 2021
a1f25a1
Remove unnessessary code
Mhdez221993 Jun 18, 2021
14b70bb
Removed invitation for current user, commented lines from controlers …
1v4n4 Jun 19, 2021
f4b925d
Syntax fix
1v4n4 Jun 19, 2021
19537e3
Merge pull request #2 from Mhdez221993/milestone-2
Mhdez221993 Jun 21, 2021
ec380d9
Show post of friend a self on Timeline
Mhdez221993 Jun 21, 2021
1e8bcae
Add rspec tests
1v4n4 Jun 21, 2021
07e2987
Fix linters
Mhdez221993 Jun 21, 2021
aa4d5d6
Remove unnessessary code
Mhdez221993 Jun 21, 2021
23f3c21
Fixed bug with displaying friends posts
1v4n4 Jun 22, 2021
155cef8
Fix linters errors
Mhdez221993 Jun 22, 2021
3bf181e
Remove unnessessary code
Mhdez221993 Jun 22, 2021
8c6294e
Merge pull request #3 from Mhdez221993/milestone-3
Mhdez221993 Jun 22, 2021
ebeb86d
Merge pull request #4 from Mhdez221993/development
Mhdez221993 Jun 22, 2021
0f001db
Add likn for Heroku in Readme
1v4n4 Jun 22, 2021
096c1bb
Add link for Heroku in another place in Readme
1v4n4 Jun 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,19 @@ name: Linters

on: pull_request

env:
FORCE_COLOR: 1

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: ">=2.6.x"
- name: Setup Rubocop
run: |
gem install --no-document rubocop:'~>0.81.0' # https://docs.rubocop.org/en/stable/installation/
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.rubocop.yml
gem install --no-document rubocop:'~>1.9.0' # https://docs.rubocop.org/en/stable/installation/
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ruby/.rubocop.yml
- name: Rubocop Report
run: rubocop --color
stylelint:
name: Stylelint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Setup Stylelint
run: |
npm install --save-dev [email protected] [email protected] [email protected] stylelint-csstree-validator
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.stylelintrc.json
- name: Stylelint Report
run: npx stylelint "**/*.{css,scss}"
21 changes: 5 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
AllCops:
NewCops: enable
Exclude:
- "db/**/*"
- "bin/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"
- "node_modules/**/*"
Expand All @@ -12,20 +10,15 @@ AllCops:
Layout/LineLength:
Max: 120
Metrics/MethodLength:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 20
Metrics/AbcSize:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
ExcludedMethods: ["describe"]
Max: 30
IgnoredMethods: ['describe']
Max: 70


Style/Documentation:
Enabled: false
Expand All @@ -47,13 +40,9 @@ Layout/ExtraSpacing:
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
Enabled: false
15 changes: 3 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'capybara'
gem 'rails', '~> 5.2.4'
gem 'selenium-webdriver'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
Expand All @@ -15,7 +15,6 @@ gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
Expand All @@ -30,22 +29,15 @@ gem 'jbuilder', '~> 2.5'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

gem 'devise'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
end

group :test do
gem 'rspec'
gem 'rspec-rails', '~> 5.0', '>= 5.0.1'
end

group :development do
Expand All @@ -57,6 +49,5 @@ group :development do
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
55 changes: 41 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (9.0.0)
ast (2.4.0)
bcrypt (3.1.13)
Expand All @@ -50,6 +52,15 @@ GEM
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.1)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand All @@ -65,7 +76,7 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
diff-lcs (1.4.4)
erubi (1.9.0)
execjs (2.7.0)
ffi (1.12.2)
Expand All @@ -89,7 +100,9 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.4)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.0)
Expand All @@ -107,6 +120,7 @@ GEM
ast (~> 2.4.0)
pg (1.2.2)
pg (1.2.2-x64-mingw32)
public_suffix (4.0.6)
puma (3.12.6)
racc (1.5.2)
rack (2.2.3)
Expand Down Expand Up @@ -141,23 +155,28 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.1.1)
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.1)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rspec-support (~> 3.10.0)
rspec-rails (5.0.1)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.2)
rubocop (0.80.1)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
Expand All @@ -168,6 +187,7 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
rubyzip (2.3.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand All @@ -179,6 +199,9 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -213,6 +236,8 @@ GEM
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby
Expand All @@ -221,16 +246,18 @@ PLATFORMS
DEPENDENCIES
bootsnap (>= 1.1.0)
byebug
capybara
coffee-rails (~> 4.2)
devise
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
pg (>= 0.18, < 2.0)
puma (~> 3.12)
rails (~> 5.2.4)
rspec
rspec-rails (~> 5.0, >= 5.0.1)
rubocop
sass-rails (~> 5.0)
selenium-webdriver
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand Down
50 changes: 31 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# Scaffold for social media app with Ruby on Rails
# Social media website

> We build a social media app for users to create and like each other's posts. They can also comment on posts.
- As a guest user:
- You're able to create account/log in.
- You can see “Sign in” and “Sign out” page.
<br>
- As a logged-in user:
- You're able to see all users list.
- You're able to see selected user page with their user name and all posts written by them
- You're able to send a friendship invitation.
- You're able to see pending friendship invitations sent to me from other users.
- You're able to accept or reject friendships invitation.
- You're able to create new posts (text only).
- You're able to like/dislike posts (but I can like single post only once).
- You're able to add comments to posts.

> This repo includes intial code for social media app with basic styling. Its purpose is to be a starting point for Microverse students.

## Built With

- Ruby v2.7.0
- Ruby on Rails v5.2.4

## Live Demo

TBA

[Heroku](https://evening-earth-80698.herokuapp.com/users/sign_in)

## Getting Started

Expand All @@ -37,16 +49,6 @@ Setup database with:
rails db:migrate
```

### Github Actions

To make sure the linters' checks using Github Actions work properly, you should follow the next steps:

1. On your recently forked repo, enable the GitHub Actions in the Actions tab.
2. Create the `feature/branch` and push.
3. Start working on your milestone as usual.
4. Open a PR from the `feature/branch` when your work is done.


### Usage

Start server with:
Expand All @@ -67,17 +69,27 @@ Open `http://localhost:3000/` in your browser.

### Deployment

TBA
Project is deployed at [Heroku](https://evening-earth-80698.herokuapp.com/users/sign_in)

## Authors
👤 **Moises Hernandez Coronado**

- GitHub: [@Mhdez221993](https://github.com/Mhdez221993)
- Twitter: [@MoisesH42060050](https://twitter.com/MoisesH42060050)
- LinkedIn: [Moises Hernandez Coronado](https://www.linkedin.com/in/moises-hernandez-coronado/)

👤 **Ivana Novaković-Leković**

- GitHub: [@githubhandle](https://github.com/1v4n4)
- Twitter: [@twitterhandle](https://twitter.com/codeIv1)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/1v4n4/)

TBA

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](issues/).
Feel free to check the [issues page](https://github.com/Mhdez221993/private-events/issues).

## Show your support

Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/friendships.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/friendships.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the friendships controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
Loading