A modern, full-featured auction platform built with Ruby on Rails 8.1. This application provides a complete solution for managing products, users, and auctions with role-based access control, public browsing capabilities, and an intuitive admin interface.
ODT Auction Platform is a web-based auction system that allows users to:
- Browse and search products without registration
- Register and manage their account
- Create and list products for auction
- Administer users and products through a dedicated admin panel
The platform features a clean, modern UI inspired by Coinbase's design system, with responsive layouts and efficient pagination.
- User Registration: Secure signup with name, surname, email, and password
- Authentication: Session-based login/logout with bcrypt password hashing
- User Status Management: Three-tier status system:
waiting_for_approve: New users awaiting admin approvalactive: Approved users who can create productsinactive: Deactivated users
- Role-Based Access: Admin and regular user roles with appropriate permissions
- Product Creation: Users can create products with:
- Name and description
- Open price (starting bid)
- Price per bid (minimum increment)
- Product Listing: View all products with pagination (8 items per page)
- Product Search: Search products by name or description
- Product Sorting: Sort by:
- Newest first (default)
- Price: Low to High
- Price: High to Low
- Product Caching: Fragment caching for improved performance
- No Login Required: Browse products without registration
- Product Details: View detailed product information
- Search & Filter: Full search and sorting capabilities
- Responsive Design: Mobile-friendly interface
- Admin Dashboard: Overview of platform statistics
- User Management:
- View all users (excluding current admin)
- Filter by status (waiting, active, inactive)
- Approve, activate, or deactivate users
- User Statistics: Counts by status
- Pagination: Efficient pagination with 8 items per page
- Fragment Caching: Cached product cards for faster loading
- Search Persistence: Search and sort parameters preserved across pagination
- Navigation: Consistent navigation across all public pages
- Ruby: 3.3.5
- Rails: 8.1.1
- Database: SQLite3
- Server: Puma 5.0+
bcrypt(~> 3.1.7) - Password hashingpagy- Fast, lightweight paginationturbo-rails- SPA-like page accelerationstimulus-rails- Modest JavaScript frameworksolid_cache- Database-backed cache storesolid_queue- Database-backed job queuesolid_cable- Database-backed Action Cable adapter
- CSS: Custom design system with CSS variables
- JavaScript: Import maps with ESM
- Assets: Propshaft asset pipeline
- Icons: SVG icons throughout the interface
Before you begin, ensure you have the following installed:
- Ruby 3.3.5 or higher
- RubyGems
- Bundler
- SQLite3
- Node.js (for asset compilation)
-
Clone the repository
git clone <repository-url> cd product-onboarding
-
Install dependencies
bundle install
-
Set up the database
rails db:create rails db:migrate rails db:seed
-
Start the server
rails server
-
Access the application
- Open your browser and navigate to
http://localhost:3000
- Open your browser and navigate to
After running rails db:seed, you'll have:
Admin User:
- Email:
admin@example.com - Password:
admin123
Sample User:
- Email:
seller@example.com - Password:
seller123
product-onboarding/
├── app/
│ ├── controllers/
│ │ ├── application_controller.rb # Base controller with auth helpers
│ │ ├── concerns/
│ │ │ └── pagy_backend.rb # Pagy pagination backend
│ │ ├── admin_controller.rb # Admin dashboard
│ │ ├── admin/
│ │ │ └── users_controller.rb # User management
│ │ ├── public_controller.rb # Public product browsing
│ │ ├── products_controller.rb # Product CRUD
│ │ ├── registrations_controller.rb # User registration
│ │ ├── sessions_controller.rb # Login/logout
│ │ └── home_controller.rb # User dashboard
│ ├── models/
│ │ ├── user.rb # User model with status enum
│ │ └── product.rb # Product model
│ ├── views/
│ │ ├── layouts/
│ │ │ └── application.html.erb # Main layout with navigation
│ │ ├── public/
│ │ │ ├── index.html.erb # Public product list
│ │ │ ├── show.html.erb # Product detail page
│ │ │ └── _product_card.html.erb # Product card partial (cached)
│ │ ├── admin/
│ │ │ ├── dashboard.html.erb # Admin dashboard
│ │ │ └── users/
│ │ │ └── index.html.erb # User management
│ │ └── ... # Other views
│ └── helpers/
│ ├── application_helper.rb # Application helpers
│ └── pagy_frontend.rb # Pagy pagination frontend
├── config/
│ ├── routes.rb # Application routes
│ ├── initializers/
│ │ └── pagy.rb # Pagy configuration
│ └── ... # Other config files
├── db/
│ ├── migrate/ # Database migrations
│ ├── schema.rb # Database schema
│ └── seeds.rb # Seed data
└── public/ # Static assets
├── icon.svg # Favicon (SVG)
└── icon.png # Favicon (PNG)
GET /- Public product listing (root path)GET /public/products/:id- Public product detail page
GET /signup- User registration formPOST /signup- Create new userGET /registration/completed- Registration success pageGET /login- Login formPOST /login- Authenticate userDELETE /logout- Logout user
GET /home- User dashboard
GET /products- List all products (requires login)GET /products/new- Create new product formPOST /products- Create productGET /products/:id- Show product details
GET /adminorGET /admin/dashboard- Admin dashboardGET /admin/users- User managementPATCH /admin/users/:id/approve- Approve userPATCH /admin/users/:id/activate- Activate userPATCH /admin/users/:id/deactivate- Deactivate user
create_table "users" do |t|
t.string "name", null: false
t.string "surname", null: false
t.string "email", null: false, unique: true
t.string "password_digest", null: false
t.boolean "admin", default: false, null: false
t.integer "status", default: 0, null: false # 0=waiting, 1=active, 2=inactive
t.timestamps
endcreate_table "products" do |t|
t.string "name", null: false
t.text "description", null: false
t.decimal "open_price", precision: 10, scale: 2, null: false
t.decimal "price_per_bid", precision: 10, scale: 2, null: false
t.integer "user_id", null: false
t.timestamps
endUserhas_many:productsProductbelongs_to:user
-
Registration
- Visit
/signup - Fill in name, surname, email, and password
- Submit the form
- Wait for admin approval (status:
waiting_for_approve)
- Visit
-
Login
- Visit
/login - Enter email and password
- Upon successful login, you'll be redirected to the home page
- Visit
-
Create Products
- After admin approval, log in and navigate to your dashboard
- Click "Create Product"
- Fill in product details (name, description, open price, price per bid)
- Submit to create the product
-
Browse Products
- Visit the root path
/to see all products - Use the search bar to find specific products
- Sort by price or date
- Navigate through pages using pagination
- Visit the root path
-
Access Admin Panel
- Log in with admin credentials
- Click "Admin Panel" in the navigation
-
Manage Users
- Navigate to "Users" menu
- View users filtered by status
- Approve waiting users
- Activate or deactivate users as needed
-
View Statistics
- Check the admin dashboard for user counts
- Monitor platform activity
- Browse all products without registration
- Search and filter products
- View product details
- No login required for browsing
rails testThe project uses RuboCop with Rails Omakase configuration:
bundle exec rubocopbundle exec brakeman
bundle exec bundler-auditrails dbconsolerails consoleThe project includes a Dockerfile for containerized deployment. See the Dockerfile for details on building and running the application in a container.
- Database: Consider migrating from SQLite3 to PostgreSQL or MySQL for production
- Cache Store: Uses
solid_cache(database-backed) - suitable for production - Asset Pipeline: Uses Propshaft - ensure assets are precompiled
- Environment Variables: Set appropriate environment variables for production
- SSL: Enable SSL/TLS for secure connections
- Secrets: Use Rails credentials for sensitive configuration
The project includes Kamal configuration for easy deployment. See config/deploy.yml for deployment settings.
Users go through three states:
- waiting_for_approve: Initial state after registration
- active: Approved by admin, can create products
- inactive: Deactivated by admin
- Uses Pagy gem for efficient pagination
- 8 items per page
- Preserves search and sort parameters
- Custom pagination controls matching the design system
- Fragment caching for product cards
- Cache keys include product
updated_attimestamp - Automatic cache invalidation when products are updated
- Full-text search across product names and descriptions
- Multiple sorting options
- Parameters preserved in URLs for sharing
- Fork the repository
- Create a 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
[Specify your license here]
[Add author information]
- Design inspiration from Coinbase
- Built with Ruby on Rails 8.1
- Uses Pagy for pagination
- Thanks to all contributors
Note: This is a development project. For production use, ensure proper security measures, database migration, and environment configuration.