This is the backend of an e-commerce website built using Java. The backend manages the core functionality of the platform, including user authentication, product management, order handling, and category organization. The system is designed following RESTful principles and connects to a relational database to store and retrieve data efficiently.
- User Management: Registration, login, role-based access (e.g., customer, admin).
- Product Management: CRUD operations for products, including categorization.
- Category Management: Organize products into categories for easy navigation.
- Order Processing: Add items to the cart, checkout, and manage orders.
- Role-Based Access Control: Different functionalities for admin and customer roles.
- Java: Backend logic and APIs.
- Spring Boot: Framework for rapid development.
- Hibernate: ORM for database interactions.
- MySQL/PostgreSQL: Relational database for storing entities.
- Maven: Dependency management and build tool.
- REST API: For communication between frontend and backend.
- Java 17 or higher
- Maven 3.6+
- PostgreSQL
- An IDE (IntelliJ IDEA)
- Clone the repository:
git clone https://github.com/your-repository-url
- Navigate to the project directory:
cd e-commerce-backend - Configure your database settings in
application.properties:spring.datasource.url=jdbc:mysql://localhost:3306/ecommerce_db spring.datasource.username=your_username spring.datasource.password=your_password
- Build and run the project:
mvn clean install mvn spring-boot:run
- The application will be available at:
http://localhost:8080
Here are a few key API endpoints:
-
User Endpoints
POST /api/users/register- Register a new user.POST /api/users/login- Authenticate a user.
-
Product Endpoints
GET /api/products- Retrieve all products.POST /api/products- Add a new product (Admin only).
-
Category Endpoints
GET /api/categories- Retrieve all categories.
-
Order Endpoints
POST /api/orders- Create a new order.GET /api/orders/{id}- Get details of a specific order.
- Wishlist: Allow users to add items to a wishlist.
- Reviews: Implement product review and rating features.
- Payment Integration: Integrate with payment gateways for secure checkout.
If you'd like to contribute, please fork the repository and submit a pull request.
This project is licensed under the MIT License.