A modern e-commerce web application inspired by BigBasket, built with React frontend and designed to work with Spring Boot backend and MySQL database.
- Modern UI/UX: Clean, responsive design matching BigBasket's aesthetic
- Product Catalog: Browse products by categories with search functionality
- Shopping Cart: Add/remove items with quantity management
- User Authentication: Login/signup with social media integration
- Product Details: Detailed product information with ratings and reviews
- Responsive Design: Works seamlessly on mobile, tablet, and desktop
- RESTful APIs: Complete API endpoints for all frontend operations
- User Management: Authentication and user profile management
- Product Management: CRUD operations for products and categories
- Shopping Cart: Persistent cart functionality
- Order Management: Order creation and tracking
- MySQL Integration: Database operations with JPA/Hibernate
- React 18: Modern React with functional components and hooks
- React Router: Client-side routing
- Context API: State management for cart and authentication
- CSS3: Modern styling with flexbox and grid
- Local Storage: Persistent cart and user session
- Spring Boot 3: Java backend framework
- Spring Security: Authentication and authorization
- Spring Data JPA: Database operations
- MySQL: Relational database
- Maven: Dependency management
- Node.js (v16 or higher)
- npm or yarn
- Java 17+ (for backend)
- MySQL 8.0+ (for backend)
The React frontend is already set up and running. You can:
- Browse products by category
- Search for specific items
- Add items to cart
- View cart and manage quantities
- Mock user authentication
To complete the full-stack application, you'll need to create a Spring Boot backend:
backend/
βββ src/main/java/com/bigbasket/
β βββ BigBasketApplication.java
β βββ config/
β β βββ SecurityConfig.java
β β βββ WebConfig.java
β βββ controller/
β β βββ AuthController.java
β β βββ ProductController.java
β β βββ CartController.java
β β βββ CategoryController.java
β β βββ OrderController.java
β βββ dto/
β β βββ LoginRequest.java
β β βββ UserResponse.java
β β βββ ProductResponse.java
β βββ entity/
β β βββ User.java
β β βββ Product.java
β β βββ Category.java
β β βββ CartItem.java
β β βββ Order.java
β βββ repository/
β β βββ UserRepository.java
β β βββ ProductRepository.java
β β βββ CategoryRepository.java
β β βββ CartItemRepository.java
β βββ service/
β βββ UserService.java
β βββ ProductService.java
β βββ CartService.java
β βββ AuthService.java
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.5</version>
</dependency>
</dependencies>spring:
datasource:
url: jdbc:mysql://localhost:3306/bigbasket_db
username: your_username
password: your_password
jpa:
hibernate:
ddl-auto: update
show-sql: true
security:
jwt:
secret: your_jwt_secret_keyAuthentication
- POST
/api/auth/login- User login - POST
/api/auth/register- User registration - POST
/api/auth/logout- User logout
Products
- GET
/api/products- Get all products - GET
/api/products/{id}- Get product by ID - GET
/api/products/search?query=keyword- Search products - GET
/api/categories/{id}/products- Get products by category
Cart
- GET
/api/cart- Get user's cart - POST
/api/cart/items- Add item to cart - PUT
/api/cart/items/{id}- Update cart item - DELETE
/api/cart/items/{id}- Remove item from cart
Orders
- POST
/api/orders- Create new order - GET
/api/orders- Get user's orders - GET
/api/orders/{id}- Get order details
- Header: Search bar, location selector, cart icon with count
- Categories: Sidebar navigation with grocery categories
- Products: Grid layout with images, pricing, and ratings
- Cart: Modal with quantity controls and price calculation
- Authentication: Login/signup modal with social options
- Responsive: Mobile-first design with breakpoints
The frontend currently uses mock data for demonstration. Key features:
- 8 sample products across different categories
- Realistic pricing with discounts
- Stock status and ratings
- Category filtering and search
- Color Scheme: BigBasket's signature green (#84c225) theme
- Typography: Clean, readable fonts with proper hierarchy
- Layout: Grid-based responsive design
- Interactions: Hover effects, smooth transitions, and micro-animations
- UX: Intuitive navigation and clear call-to-action buttons
- Update
src/services/api.jswith your Spring Boot API endpoints - Modify the API base URL in environment variables
- Replace mock data with actual API calls
- Implement proper error handling and loading states
Create a .env file in the root directory:
REACT_APP_API_URL=http://localhost:8080/api
REACT_APP_ENVIRONMENT=development
- Payment integration (Stripe/Razorpay)
- Order tracking and history
- Product reviews and ratings
- Wishlist functionality
- Advanced filtering and sorting
- Email notifications
- Inventory management
- Admin dashboard
- Analytics and reporting
- Multi-vendor support
To connect this frontend with your Spring Boot backend:
- Replace Mock Data: Remove mock data from components and implement API calls
- Error Handling: Add proper error boundaries and loading states
- Authentication: Implement JWT token management
- State Management: Consider Redux for complex state management
- Testing: Add unit and integration tests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support, please open an issue in the GitHub repository.
Note: This is a demonstration project inspired by BigBasket. The frontend is fully functional with mock data, and the backend structure is provided as a guide for implementation.