Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickCart

A comprehensive RESTful e-commerce API built using Spring Boot with automated endpoint generation.

Technologies Used: Java, Spring Boot 3, Spring Data REST, Hibernate, MySQL, Maven, Apache Tomcat

Key Features:

  • RESTful API Design: Automated endpoint generation for seamless CRUD operations.
  • Product Management: Complete product catalog with detailed information and inventory tracking.
  • User Management: User profile management and data persistence.
  • Order Processing: Comprehensive order management system with purchase tracking.
  • Complex Database Relationships: Many-to-many mappings between orders and products with proper cascade operations.
  • Spring Data REST Integration: Automatic REST endpoint exposure with HATEOAS support.
  • Database Integration: Robust MySQL integration with Hibernate ORM for efficient data persistence.

Entity Structure:

  • Product: Product catalog management with inventory details
  • User: User data management and profile information
  • Purchase: Order processing and purchase history tracking
  • Repository Layer: Dedicated repositories for each entity with Spring Data JPA

Installation:

  1. Clone the repository:

    git clone https://github.com/rohan282/quickcart.git
  2. Navigate to the project directory:

    cd quickcart
  3. Open the project in IntelliJ IDEA:

    • Launch IntelliJ IDEA.
    • Click on File > Open.
    • Navigate to the folder where you cloned the repository (quickcart) and select it.
    • IntelliJ will automatically detect the Maven project and import it.
  4. Configure MySQL Database:

    • Create a new MySQL database named quickcart
    • Update the database configuration in src/main/resources/application.properties:
      spring.datasource.url=jdbc:mysql://localhost:3306/quickcart
      spring.datasource.username=your_username
      spring.datasource.password=your_password
  5. Build the project:

    • Once imported, IntelliJ will resolve all Maven dependencies automatically.
    • If dependencies are not resolved, click on View > Tool Windows > Maven, and then click on Reload Maven Projects.
  6. Run the application:

    • Locate the QuickCartApplication class (the main class with the @SpringBootApplication annotation).
    • Right-click on the class and select Run 'QuickCartApplication'.
    • The application will start, and you can access it at: http://localhost:8080

API Endpoints:

The application automatically generates RESTful endpoints for all entities:

Products

  • GET /api/products - Retrieve all products
  • GET /api/products/{id} - Retrieve a specific product
  • POST /api/products - Create a new product
  • PUT /api/products/{id} - Update an existing product
  • DELETE /api/products/{id} - Delete a product

Users

  • GET /api/users - Retrieve all users
  • GET /api/users/{id} - Retrieve a specific user
  • POST /api/users - Create a new user
  • PUT /api/users/{id} - Update user information
  • DELETE /api/users/{id} - Delete a user

Purchases

  • GET /api/purchases - Retrieve all purchases
  • GET /api/purchases/{id} - Retrieve a specific purchase
  • POST /api/purchases - Create a new purchase
  • PUT /api/purchases/{id} - Update purchase information
  • DELETE /api/purchases/{id} - Delete a purchase

Usage:

  1. Start the Application: Run the Spring Boot application to start the embedded Tomcat server.

  2. API Testing: Use tools like Postman, curl, or any REST client to interact with the API endpoints.

  3. Database Operations: The application automatically handles database schema creation and updates through Hibernate.

  4. HATEOAS Navigation: Utilize the hypermedia links provided in API responses for easy navigation between related resources.

Project Structure:

src/
├── main/
│   ├── java/
│   │   └── com/api/quickcart/
│   │       ├── entity/
│   │       │   ├── Product.java
│   │       │   ├── User.java
│   │       │   └── Purchase.java
│   │       ├── repository/
│   │       │   ├── ProductRepository.java
│   │       │   ├── UserRepository.java
│   │       │   └── PurchaseRepository.java
│   │       └── QuickCartApplication.java
│   └── resources/
│       └── application.properties
└── test/
    └── java/
        └── com/api/quickcart/
            └── QuickCartApplicationTests.java

Contributing:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License:

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages