This is a Website based on the Lifestyle web, where you can create and vote articles, and the most voted article will be displayed on the main page of the web.
This is an app where you can create an account and then login to create articles and vote for the better ones. The main purpose of this project was to build the correct associations between the categories and the articles to show the correct content on the main page.
What you can do on the app:
- Sign up and Log in
- Create articles and see other articles from all the users
- Users can vote for all the articles
In this project I:
- Used PostgreSQL as the database
- Created advanced associations between users, articles, and categories
- Used scopes to make more efficient database queries
- Created models, views, and controllers for users, articles, and categories
- Used Rspec to test model validations and associations
- Implemented integration tests with Capybara
- Added a unique vote or unvote button for each article with a user
You can watch this video where I am explaining all the functionality of the app.
- Ruby v2.7.2
- Ruby on Rails v6.0.3.6
- Heroku
- PostgreSQL
You can visit here our app.
To get a local copy up and running follow these simple example steps:
- Clone this repository with:
git clone --depth 1 https://github.com/alexisbec/lifestyle-articles.git
- Open the project folder where the repository was downloaded in your favourite editor.
- First you have to install all the yarn dependencies with:
yarn install --check-files
- After that, you have to install all the project dependencies:
bundle install
- Start the postgres database server and setup the database:
rails db:create
rails db:migrate
- Then you have to populate the app with:
rails db:seed
- Start the local server:
rails s
- Now you can open your favorite web-browser and visit:
http://localhost:3000
- Ruby v2.7.2
- Ruby on Rails v6.0.3.6
- Postgres: >=9.5
- Open this link in your browser
- Start the server with:
rails server
- Open
http://localhost:3000/
in your browser
- Create a user in 'Sign Up'
- Create an article
- Check the categories available in "All Categories"
- Check all the articles from each category
- Vote for all your favorite articles
rspec --format documentation
In this project there are two different types of tests:
- Integration Tests made with Capybara (You will need a Chrome browser for these tests to work.)
- Unit Tests made with Rspec
👤 Alexis Varela
- Github: @alexisbec
- Linkedin: Alexis Varela
- Twitter: @AlexisV31667779
Contributions, issues, and feature requests are welcome in the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.