Quick Shop is an e-commerce application designed for managing an online store. It provides functionalities for user authentication, product management, and shopping cart operations. This application includes server-side rendered (SSR) views and a REST API for every feature.
- view products.
- add products to cart.
- remove from cart
- finalize order
- view order history
- View, create, update, and delete products.
- Soft delete functionality for products (inactive products are hidden from public view).
- Manage orders and export database content as SQL.
- Endpoints for product cart and order management.
- Basic Authentication for secure access.
- Supports file uploads for product images.
- Products can be marked as inactive without permanent deletion.
- File uploads using
MultipartFile
, stored in the/public/images
directory.
- Spring Boot 3.3.4
- Spring Security (Basic Authentication)
- Spring Data JPA (Hibernate)
- Bootstrap 5 for styling Thymeleaf templates.
- Java: 21 or later
- Maven: 3.8 or later
- MySQL Database
-
Clone the repository:
git clone https://github.com/username/quickshop.git cd quickshop
-
Configure the
application.properties
file insrc/main/resources
:spring.datasource.url=jdbc:mysql://localhost:3306/quickshop spring.datasource.username=root spring.datasource.password=yourpassword spring.jpa.hibernate.ddl-auto=update spring.h2.console.enabled=true spring.security.user.name=admin spring.security.user.password=admin
-
Build and run the application:
mvn spring-boot:run
-
POST /api/auth/register: Register a new user.
-
POST /api/auth/login: Log in a user.
- GET /api/products: Fetch all available products (public access).
- POST /api/cart/add?productId={id}&quantity={qty}: Add a product to the cart (authenticated users).
- POST /api/cart/remove?productId={id}: Remove a product from the cart (authenticated users).
- POST /api/cart/clear: Clear all cart items (authenticated users).
- GET /api/cart: View cart contents (authenticated users).
- POST /api/cart/finalize: Finalize the purchase (authenticated users).
- GET /api/admin/products: View all products (admins only).
- POST /api/admin/products: Create a new product (admins only).
- PUT /api/admin/products/{id}: Edit a product (admins only).
- DELETE /api/admin/products/{id}: Delete a product (admins only).
- GET /api/admin/products/download-db: Export the database (admins only).
- Public Access: Viewing products, login, and register.
- Authenticated Users Only: Accessing and managing the cart, viewing order history.
- Admins Only: Performing CRUD operations on products and exporting the database.
For detailed API usage and examples, refer to the Postman documentation: QuickShop Postman API Documentation.
QuickShop has been successfully deployed using Docker, AWS EC2, NGINX, and secured with Let's Encrypt. Visit the live application at QuickShop.