Skip to content

HecticHiccups/SpringBoot-Woot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

SpringBoot-Woot

SpringBoot Backend API for an eCommerce application

Getting Started

Installation:

git clone https://github.com/HecticHiccups/SpringBoot-Woot.git
  1. Import the project to your desired IDE my preference is IntelliJ
  2. Once imported you must modify your application.properties file.
## Port
server.port = 3001

## Spring DATASOURCE
spring.datasource.url = jdbc:mysql://localhost/db_name
spring.datasource.username = root
spring.datasource.password = password

## Hibernate Properties
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.database-platform = org.hibernate.dialect.MySQL57Dialect
spring.jpa.show-sql = true

# Hibernate ddl auto=update will automatically create the tables
spring.jpa.hibernate.ddl-auto = update
  1. Once modified you can run your server application.

Alternative: go to the project location in the terminal & run

mvn spring-boot:run

Endpoints:

/api/users

returns json of all users within user entity model

[
    {
        "userID": 2,
        "userEmail": "[email protected]",
        "userName": "Witwicky",
        "firstName": "John",
        "lastName": "Wick",
        "password": "1234",
        "admin": true
    }
    ... 
]

POST /api/user

insert new user into user entity, userID auto increments.

    {
        "userEmail": "Anything",
        "userName": "Your",
        "firstName": "Heart",
        "lastName": "Desires",
        "password": "....",
        "admin": true
    }
    

/api/user/:id

returns json of desired product determined by id params.

[
    {
        "userID": 2,
        "userEmail": "[email protected]",
        "userName": "Witwicky",
        "firstName": "John",
        "lastName": "Wick",
        "password": "1234",
        "admin": true
    }
]

/api/product/:id

returns json of desired user determined by id params.

[
   {
    "productID": 2,
    "productName": "One Piece Shirt",
    "productDescription": "A Sugoi Anime Shirt for Weebs",
    "productPrice": 12,
    "productQuantity": 12,
    "productImage": "onepiece.com"
  }
]

/api/products

returns json of all products within product entity model

[
    {
        "productID": 1,
        "productName": "Updated Naruto Shirt xx",
        "productDescription": "A Sugoi Anime Shirt for Weebs",
        "productPrice": 12,
        "productQuantity": 12,
        "productImage": "weirdurl.com"
    }
    ... 
]

Built With:

Authors:

  • Jesus Arteaga

Acknowledgments:

About

SpringBoot Backend for an eCommerce application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages