This is a demo project for an e-commerce application built using Spring Boot. The application provides functionalities for managing users, products, orders, and stores.
- Features
- Technologies Used
- Getting Started
- API Endpoints
- Configuration
- License
- User management (Admin, Customer, Store Owner)
- Product management
- Order management
- Store management
- JWT-based authentication
- Java 21
- Spring Boot 3.4.2
- Spring Data JPA
- PostgreSQL
- Lombok
- Auth0
- Maven
- Swagger
- Java 21
- Maven
- PostgreSQL
-
Clone the repository:
git clone https://github.com/yourusername/e-commerce.git cd e-commerce -
Configure the database in application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/your_database_name spring.datasource.username=your_user_name spring.datasource.password=your_password
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
Open your favorite web browser and paste it
http://localhost:8080/swagger-ui/index.html
- Create Customer:
POST /users/create-customer - Create Admin:
POST /users/create-admin - Create Store Owner:
POST /users/create-store-owner - Update Customer:
PUT /users/update-customer - Update Admin:
PUT /users/update-admin - Login:
POST /users/login - Delete Admin:
DELETE /users/delete-admin
- Create Store:
POST /stores/create-store - Add Product:
POST /stores/add-product - Update Product Name:
PUT /stores/update-product-name - Update Product Price:
PUT /stores/update-product-price - Update Product Stock:
PUT /stores/update-product-stock - Create Store For Admin:
POST /stores/create-store-for-admin - Delete Store For Admin:
DELETE /stores/delete-store-for-admin
- Create Order:
POST /orders/create-order - Approve Order:
PUT /orders/approve-order - Get Total Sales for Today:
GET /orders/get-total-sales-for-today-for-admin - Get Total Sales for All Stores for Today:
GET /orders/get-total-sales-for-all-stores-for-today-for-admin - Get Monthly Sales Info for Admin:
GET /orders/get-store-monthly-sales-info
- Get All Products:
GET /products/get-all-products
The application configuration is managed in the application.properties file located in resources. Key configurations include:
spring.application.name=e-commerce
spring.datasource.url=jdbc:postgresql://localhost:5432/your_database_name
spring.datasource.username=your_user_name
spring.datasource.password=your_password
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql=true
jwt.secret=your_jwt_secret_key
jwt.duration=86400000This project is licensed under the MIT License. See the LICENSE file for details.