This repository contains the code based on the Ruby on Rails Tutorial by Michael Hartl.
A Twitter-inspired Ruby on Rails web application built as part of the Hartl's Ruby on Rails Tutorial. The Sample App includes essential social media features such as user authentication, profile management, microblogging with posts, following/unfollowing users, and a dynamic feed. This application demonstrates best practices in Rails development, including RESTful design, MVC architecture and test-driven development (TDD).
- User Authentication: Secure sign-up, login, and logout functionalities with password encryption.
- Profile Management: Users can create and edit profiles, upload profile pictures, and view other users' profiles.
- Microblogging: Users can create, edit, and delete short posts (microposts) with character limits.
- Following System: Users can follow and unfollow other users, with follower/following counts displayed on profiles.
- Dynamic Feed: A personalized feed that displays the most recent posts from followed users.
- Account Activation: Email-based account activation to verify user emails.
- Password Reset: Users can reset their passwords via email if they forget them.
- Pagination: Posts and users are paginated to improve load times and user experience.
- Backend: Ruby on Rails
- Frontend: HTML5, CSS3, JavaScript, Bootstrap
- Database: SQLite, PostgreSQL
- Testing: Minitest, RSpec
- Deployment: Heroku
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/yourusername/x-sample.git
-
Navigate into the directory:
cd x-sample
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create rails db:migrate rails db:seed
-
Start the server:
rails server
-
Open your browser and go to:
http://localhost:3000
-
Sign Up and Explore:
- Sign up with a new user account.
- Create microposts, follow other users, and explore the feed.
-
Ensure dependencies are installed:
If you haven't already installed the gems, do so by running:
bundle install
-
Run all tests:
You can run the entire test suite with:
rails test
-
Run specific tests:
To run tests for a specific file:
rails test test/models/example_model_test.rb
-
Running tests with detailed output:
If you want more detailed test output, you can run:
rails test -v
Ivan Sharov
Email: sharoviva@cvut.cz
LinkedIn: Ivan Sharov