Skip to content

kashtiyash/ecom-assign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Application

Overview

This is a e-commerce application built with Spring Boot for self study and exploring the technology. It provides a roust backend for managing products, categories, orders, user accounts, and more in an online shopping platform.

Technologies Used

  • Java 17
  • Spring Boot 3.3.3
  • Spring Data JPA
  • PostgresSQL
  • Maven
  • Lombok
  • JWT token Authentication and authorization

Features

  • User authentication and authorization
  • Product management (CRUD operations)
  • Category management
  • Order processing and status updates
  • Shopping cart functionality
  • Wishlist management
  • User profile management
  • Address management
  • Product reviews
  • Admin dashboard
  • Permission based access control

Project Structure

ecom-assign/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/
│   │   │       └── ecom_assign/
|   |   |           ├── annotation/
|   |   |           ├── config/
│   │   │           ├── constants/
│   │   │           ├── controller/
│   │   │           ├── dto/
│   │   │           ├── entity/
│   │   │           ├── exception/
|   |   |           ├── filter/
│   │   │           ├── repository/
│   │   │           └── service/
│   │   │
│   │   └── resources/
│   │       └── application.properties
│   └── test/
│       └── java/
│           └── com/
|               └── ecom_assign/   
|                   ├── annotation/
|                   ├── constants/
|                   ├── controller/
|                   ├── entity/
|                   ├── filter/
|                   └── service/
└── pom.xml

Setup and Installation

  1. Clone the Repository

  2. Database Setup

    Open PostgreSQL shell or pgAdmin and create a database named ecom_assign:

    CREATE DATABASE your_db_name;
    
  3. Configure Application Properties

    Open the src/main/resources/application.properties file and set the following configurations or you can add your configurations:

    # Application Configuration
    spring.application.name=ecom-assign
    server.port=8080
    
    # Database Configuration
    spring.datasource.url=jdbc:postgresql://localhost:5432/your_db_name
    spring.datasource.username=username
    spring.datasource.password=password
    spring.jpa.hibernate.ddl-auto=none
    spring.jpa.show-sql=false
    
    # JWT Configuration
    jwt.secret_key=lkjwsa2VjcmV0SakhfkhaenvlnbmluZ1B1cnBvc2VzMTIzNDU2Nzgkjsdfhsdferuh
    jwt.expiration_time=30000
    jwt.refresh_expiration_time=900000
    
    # Swagger Configuration
    springdoc.api-docs.path=/v3/api-docs
    springdoc.swagger-ui.path=/swagger-ui.html
    springdoc.swagger-ui.enabled=true
    
  4. Build and Run the Application

    ./mvnw clean install
    ./mvnw spring-boot:run
    
  5. Access the Application

    The application will be running at: http://localhost:8080

    Access Swagger UI for API documentation: http://localhost:8080/swagger-ui/index.html#/

Initial Setup Script

To quickly set up the database and initialize the application:

  1. Create a new database.
  2. Run the script provided in the repository (script.sql).
    This script will:
    • Create all the necessary tables.
    • Populate the database with initial data, such as roles, permissions, categories, and products.
  3. After running the script, create the ADMIN and USER accounts to access the APIs, as they require a JWT token for authorization.

Note: Ensure that the database connection details are correctly configured in the application before running the script.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published