Skip to content

This repo is for practicing the bi-directional self-referential relationships in ActiveRecord models.

Notifications You must be signed in to change notification settings

RossielCS/Stay-in-Touch

 
 

Repository files navigation

Stay in Touch

This is a social media app where the user can create posts and send friendship invitations to other users as well.
This repo is for practicing the bi-directional self-referential relationships in ActiveRecord models.
It was built with Ruby on Rails, Rspec, and Capybara for unit and integration tests.

Here is a description of business requirements for the app:

  1. As a guest user:
  • I want to be able to create account/log in.
  • I can see only “Sign in” and “Sign out” page.
  1. As a logged-in user:
  • I want to be able to see all users list.
  • I want to be able to see selected user page with their user name and all posts written by them (the most recent posts on the top).
  • I want to be able to send a friendship invitation.
  • I want to see a button “Invite to friendship” next to the name of user who is not my friend yet - on both users’ list and single user page.
  • I want to be able to see pending friendship invitations sent to me from other users.
  • I want to be able to accept or reject friendships invitation.
  • I want to be able to create new posts (text only).
  • I want to be able to like/dislike posts (but I can like single post only once).
  • I want to be able to add comments to posts.
  • I want to be able to see “Timeline” page with posts (with number of likes and comments) written by me and all my friends (the most recent posts on the top).
  • Timeline page should be the root page of the app.

Screenshot

screenshot

Live Demo

You can try it here.

🔨 Built With

  • Ruby 2.7,
  • Rails 5.2.4,
  • Postgres: 9.5,
  • Rspec 3.9,
  • Capybara 2.15,
  • Shoulda-matchers 4.0,
  • Webdrivers 4.0,
  • Rubocop 0.79.0

💻 Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

You need to install:

Setup

  1. Clone the repository.
  2. In your OS terminal search the repository's address and to install gems run:
    $ bundle install
  3. To setup database.
    $ rails db:create
    $ rails db:migrate
  4. Then start Rail's server.
    $ rails server

Usage

  • Open http://localhost:3000/ in your browser.
  • Follow the instructions.

Run tests

Unit tests for:

  • Models Associations.
  • Models Validations.

Integration tests for:

  • Authentications.
  • Posts.
  • Friendships.
  • Notifications.
  • Comments.
  • Likes.

In your terminal search the repository's address and run:
$ rspec --format documentation
It will provide you well-organized output on your terminal with information about the tests.

Deployment

To deploy on Heroku you can check this tutorial from the Odin Project.

After pushing the last changes to the remote repository, follow this steps:

  1. $ heroku create
  2. Verify that you see heroku in the output.
    $ git remote
  3. This will push the master branch.
    $ git push heroku master
    In case you want to push another branch you can run
    $ git push heroku <branch name>:master
  4. Migrate the database on Heroku
    $ heroku run rails db:migrate
  5. Open the app
    $ heroku open

💎 Features

  • Users can create an account.
  • Validates the email.
  • To login is necessary to submit email.
  • The user can create posts and send friendship requests.
  • The user can only read friends' posts.
  • Has a notification section that shows pending requests.
  • Users have a profile picture.

👩 Author

Rossiel Carranza

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is MIT licensed.

About

This repo is for practicing the bi-directional self-referential relationships in ActiveRecord models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 75.2%
  • HTML 17.2%
  • SCSS 5.6%
  • JavaScript 1.1%
  • Other 0.9%