A full-stack web application for comparing Ruby on Rails routes.rb files between any two Rails projects. Analyze routing differences, identify common routes, and export detailed comparison reports.
- β Dynamic Project Names: Compare any two Rails applications with custom project names
- π Route Parsing: Comprehensive Ruby routes parser supporting resources, namespaces, custom routes
- π Visual Comparison: Interactive results with filtering, search, and tabbed views
- π CSV Export: Export comparison results to CSV format
- π― Smart Analysis: Identifies common routes, project-specific routes, and differences
- π Advanced Filtering: Filter by HTTP method, route type, and search functionality
Upload your routes.rb files and see instant analysis:
- Common Routes: Routes present in both projects
- Project-Specific Routes: Routes unique to each project
- Side-by-Side Comparison: Code view comparing both route structures
- Export Options: Download detailed CSV reports
- React 18 with TypeScript
- Tailwind CSS for styling
- Radix UI components with shadcn/ui design system
- TanStack Query for server state management
- React Hook Form with Zod validation
- Wouter for client-side routing
- Node.js with Express.js
- TypeScript with ES modules
- Multer for file upload processing
- Custom Ruby Route Parser for analyzing Rails routes files
- In-memory storage with database-ready schema
- PostgreSQL with Neon Database
- Drizzle ORM for type-safe database operations
- Drizzle Kit for migrations
- Node.js 20+
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/rails-routes-comparator.git
cd rails-routes-comparator- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser to
http://localhost:5000
-
Enter Project Names: Add custom names for your Rails projects (e.g., "MyApp v1.0", "MyApp v2.0")
-
Upload Routes Files: Drop or select your
routes.rbfiles for each project -
Analyze: Click "Analyze & Compare Routes" to process the files
-
Review Results: Explore the comparison in multiple views:
- Common: Routes present in both projects
- Project A Only: Routes unique to the first project
- Project B Only: Routes unique to the second project
- Side-by-Side: Code comparison view
-
Export: Download CSV reports for further analysis
- Search: Find specific routes using the search bar
- Filter by Method: Show only GET, POST, PATCH, or DELETE routes
- Filter by Type: Focus on resources, custom routes, or namespaces
- CSV Export: Generate detailed spreadsheet reports
The application supports comprehensive Rails routing patterns:
resources :users do
member do
patch 'activate'
end
collection do
get 'search'
end
endget 'login', to: 'sessions#new'
post 'api/webhooks/stripe', to: 'webhooks#stripe'namespace :admin do
resources :users
endresources :articles do
resources :comments, only: [:index, :create]
end| Method | Endpoint | Description |
|---|---|---|
| POST | /api/upload |
Upload a routes.rb file |
| POST | /api/compare |
Compare two uploaded files |
| GET | /api/comparison/:id |
Get comparison results |
| GET | /api/comparison |
Get latest comparison |
| GET | /api/export/csv/:id |
Export comparison as CSV |
βββ client/ # React frontend
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Application pages
β β βββ lib/ # Utilities
β β βββ hooks/ # Custom hooks
βββ server/ # Express backend
β βββ services/ # Business logic
β βββ routes.ts # API routes
β βββ storage.ts # Data layer
βββ shared/ # Shared types
β βββ schema.ts # Database schema
βββ sample_*.rb # Example route files
npm run dev- Start development servernpm run build- Build for productionnpm run type-check- Run TypeScript checks
For production use with PostgreSQL:
- Set up a PostgreSQL database
- Configure environment variables:
DATABASE_URL=postgresql://user:password@host:port/database- Run migrations:
npm run db:migrate- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests if applicable
- Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
MIT License - see LICENSE file for details.
- Originally built for comparing Desidime and Pepper platform routes
- Inspired by the need for better Rails application migration analysis
- Built with modern web technologies for optimal developer experience
For questions or issues, please open a GitHub issue or contact the maintainers.
Made with β€οΈ for Rails developers