This project is a Ruby on Rails web application created for a Jr Software Engineer programming assignment. It lets registered users create posts and displays those posts for everyone. Users can also view and delete their own posts. The webpage is designed to be responsive to both mobile and desktop platforms.
Users have fields for a first name, last name, unique email, and password. Posts have fields for a title and body. Additionally, a post belongs to a user, who can have many posts. This relationship is represented in the diagram below. Lastly, the post's created_at timestamp is used to display when the post was written.
The Devise gem was used to implement user registration and authentication.
This application uses Ruby version 3.3.4.
To install and run the application from GitHub:
-
Clone the repository:
git clone https://github.com/PotatOS03/UserPosts.git cd UserPosts
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create rails db:migrate
-
(Optional) Seed the database:
rails db:seed
-
Start the Rails server:
rails server
-
Visit
http://localhost:3000
in your browser to use the application.
This application uses the default Minitest library from Rails. To run test cases, use the following command in the terminal:
rails test
Additionally, sample users and posts can be created by seeding the database, using the following command in the terminal:
rails db:seed