Skip to content

Andreaa-Dev/java-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Backend (Java)

Overview

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.

Features

  • 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.

Technologies Used

  • 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.

Setup and Installation

Prerequisites

  • Java 17 or higher
  • Maven 3.6+
  • PostgreSQL
  • An IDE (IntelliJ IDEA)

Steps to Run

  1. Clone the repository:
    git clone https://github.com/your-repository-url
  2. Navigate to the project directory:
    cd e-commerce-backend
  3. 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
  4. Build and run the project:
    mvn clean install
    mvn spring-boot:run
  5. The application will be available at:
    http://localhost:8080
    

API Endpoints

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.

Future Enhancements

  • 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.

Contributing

If you'd like to contribute, please fork the repository and submit a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages