A community-driven Ruby advocacy website built with Ruby 4.0.0 and Rails 8.2 using the Solid Stack (SQLite, SolidQueue, SolidCache, SolidCable).
- Universal Content Model: Support for both articles (with markdown) and external links
- GitHub OAuth Authentication: Sign in with GitHub account only
- Category System: Dynamic categories managed through admin panel
- Tagging System: HABTM relationship for content tagging
- Pinned Content: Homepage featuring system with numbered positions
- AI-Generated Summaries: Automatic content summarization via OpenAI
- Soft Deletion: All records use archived flag instead of hard deletion
- Role-Based Access: Member and admin roles
- Trusted User System: Based on contribution count (3+ contents, 10+ comments)
- Self-Regulation: Trusted users can report inappropriate content
- Auto-Moderation: Content auto-hidden after 3+ reports
- Markdown Support: Full markdown rendering with syntax highlighting
- Ruby 4.0.0
- SQLite 3
- Node.js (for JavaScript runtime)
- Clone the repository:
git clone <repository-url>
cd why_ruby- Install dependencies:
bundle install- Create and setup the database:
rails db:create
rails db:migrate
rails db:seed- Set up Rails credentials for development:
rails credentials:edit --environment developmentAdd your credentials:
github:
client_id: your_github_client_id
client_secret: your_github_client_secret
openai:
api_key: your_openai_api_key # OptionalGet credentials from:
- GitHub OAuth: GitHub OAuth Apps
- OpenAI API: OpenAI
- Go to GitHub Settings > Developer settings > OAuth Apps
- Click "New OAuth App"
- Fill in the application details:
- Application name: WhyRuby.info (or your preferred name)
- Homepage URL: http://localhost:3000
- Authorization callback URL: http://localhost:3000/users/auth/github/callback
- Click "Register application"
- Copy the Client ID and Client Secret to your Rails credentials
Start the Rails server:
rails serverVisit http://localhost:3000
The seed data creates a test admin user. In production, you'll need to:
- Sign in with GitHub
- Use rails console to promote your user to admin:
rails runner "User.find_by(username: 'your-github-username').update!(role: :admin)"Access the admin panel at /admin
- User: GitHub OAuth authenticated users with roles
- Category: Content categories with position ordering
- Content: Universal model for articles and links
- Tag: Content tags with HABTM relationship
- Comment: User comments on content
- Report: Content reports from trusted users
- Rails 8.1: Latest Rails with Solid Stack
- SQLite with ULID: Primary keys using ULID for better distribution
- Tailwind CSS 4: Modern utility-first CSS framework
- Redcarpet + Rouge: Markdown rendering with syntax highlighting
- Avo: Admin interface for content management
- Kaminari: Pagination
- SolidQueue: Background job processing
GenerateSummaryJob: Creates AI summaries for new contentNotifyAdminJob: Alerts admins when content is auto-hidden
rails testbundle exec rubocoprails dbThis application is configured for deployment with Kamal. See config/deploy.yml for configuration.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.