This project is part of The Odin Project Ruby on Rails curriculum. It demonstrates how to build a basic authentication system and a private content-sharing platform. Users can log in and post messages, but only authenticated users can view the authors of those messages. The project emphasizes working with associations, validations, and authentication in Rails.
-
User Authentication:
- Users can sign up, log in, and log out.
- Passwords are securely hashed using Devise.
-
Post Management:
- Logged-in users can create, edit, and delete posts.
- Public users can view posts but cannot see the post authors.
-
Authorization:
- Post authorship is hidden from users who are not logged in.
- Secure routes ensure only authenticated users can access protected resources.
- Ruby on Rails: Backend framework for creating the application.
- PostgreSQL: Database for storing user and post data.
- Devise: For handling user authentication.
- Action Text: To enable rich-text editing for posts.
- Bootstrap: For responsive styling and design.
Follow these steps to set up the project locally:
- Ruby 3.3.x
- Rails 8.0.x
- PostgreSQL
- Node.js and Yarn (for Rails asset pipeline)
-
Clone the repository:
git clone https://github.com/nanafox/members-only.git cd members-only
-
Install dependencies:
bundle install yarn install
-
Set up the database:
rails db:create rails db:migrate rails db:seed
-
Start the Rails server:
rails server
-
Visit the application at
http://localhost:3000
.
The application uses Minitest for testing. To run the tests, use:
rails test test:system
- Implementing role-based access control (e.g., admin privileges).
- Adding pagination to handle large datasets of posts.
- Enhancing the UI/UX with more advanced CSS or frontend frameworks.
This project was inspired by The Odin Project. The curriculum provides an excellent foundation for web development and Rails expertise. Learn more at theodinproject.com.
This project is open source and available under the MIT License.
See the LICENSE
file for more details.