A modern, responsive car listing application built with Next.js, React, Material UI, and a production-ready architecture.
- Car Browsing: Browse through a wide selection of cars
- Advanced Filtering: Filter cars by category (new/used), make, model, price range, year, fuel type, etc.
- Responsive Design: Works seamlessly on mobile, tablet, and desktop
- Server-Side Rendering: Optimized performance with Next.js SSR
- Quick Filters: Easy access to common filtering categories
- Search Functionality: Search for specific makes, models, or features
- Detailed Car Information: View comprehensive details for each car
- Framework: Next.js 15.3+
- UI Library: React 19+
- Styling: Material UI 7.1+
- State Management: React Hooks
- Routing: Next.js App Router
- API: Next.js API Routes
- Data Source: JSON file (can be easily replaced with a database)
- Node.js 18.17.0 or higher
- npm or yarn
-
Clone the repository:
https://github.com/rvs9/car-listing.git cd car-listing -
Install dependencies:
npm install # or yarn -
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser.
The FilterSidebar allows users to filter cars based on various criteria:
- Category (New/Used)
- Price Range
- Year of Manufacture
- Brand
- Kilometers Driven
- Fuel Type
- Vehicle Type
- Transmission Type
Each filter is applied immediately when selected, providing instant feedback to the user.
Displays a grid of car cards with pagination and sorting options:
- Relevance
- Price (Low to High / High to Low)
- Newest First
- Mileage (Low to High)
Provides easy access to common filter combinations:
- New Cars
- Used Cars
- Price-based filters
- Body type filters
- Fuel type filters
GET /api/cars: Get a list of cars with filtering and paginationGET /api/cars/[id]: Get detailed information about a specific car
- Folder Structure: Organized by feature and component responsibility
- Component Reusability: Components are designed to be reusable
- Responsive Design: Mobile-first approach with MUI breakpoints
- Performance Optimization:
- Lazy loading of images
- Server-side rendering
- Pagination for data fetching
- State Management: Efficient state management with React Hooks
- Clean Code
- SEO Optimization: Proper metadata and semantic HTML structure
- Accessibility: ARIA attributes and keyboard navigation
- Error Handling: Graceful error states and fallbacks
The application is fully responsive with optimized layouts for:
- Mobile devices
- Tablets
- Desktops
The application uses Jest for unit and integration testing.
Running Tests
To execute all tests:
npm run test
yarn test
You can generate a coverage report using:
npm run test -- --coverage
This project is licensed under the MIT License.