Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinibortoletto/springboot-mysql-shop
A simple e-commerce API where its possible to manage users, addresses, products, carts and orders.
https://github.com/vinibortoletto/springboot-mysql-shop
h2 java java-faker jpa junit mockito mysql open-api spring-boot spring-security swagger
Last synced: 25 days ago
JSON representation
A simple e-commerce API where its possible to manage users, addresses, products, carts and orders.
- Host: GitHub
- URL: https://github.com/vinibortoletto/springboot-mysql-shop
- Owner: vinibortoletto
- Created: 2023-11-22T20:40:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-05T23:43:52.000Z (7 months ago)
- Last Synced: 2024-10-21T05:19:35.917Z (2 months ago)
- Topics: h2, java, java-faker, jpa, junit, mockito, mysql, open-api, spring-boot, spring-security, swagger
- Language: Java
- Homepage:
- Size: 767 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Shop API
A simple e-commerce API where its possible to manage users, addresses, products, carts and orders.## Tools
This project was created with the following tools:- Java
- SpringBoot
- Spring Security
- JPA
- MySQL
- JUnit
- Mockito
- H2
- Java Faker
- Swagger## Usage
To use this application, you will need Docker, Docker Compose and IntalliJ installed.1. Clone this repository:
```bash
git clone [email protected]:vinibortoletto/springboot-mysql-shop.git
```2. Navigate to the project's directory:
```bash
cd springboot-mysql-shop.git
```3. Run Docker Compose
```bash
docker-compose up -d
```4. Open the project in IntelliJ and run it.
5. If you wish, you can also import the endpoints collection in Postman:
https://github.com/vinibortoletto/springboot-mysql-shop/blob/main/simple_shop.postman_collection.json## Endpoints
All requests with exception of `POST /users/login` and `POST /users` require an authentication token, which is generated after login.#### Users
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `GET` | `/users/{userId}`| Get user by id |
| `PUT` | `/users/{userId}`| Update user by id |
| `DELETE` | `/users/{userId}`| Delete user by id |
| `GET` | `/users`| Get all users |
| `POST` | `/users`| Create new user |
| `POST` | `/users/login`| Validate user login |#### Products
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `PUT` | `/products/{productId}`| Update product by id |
| `GET` | `/products`| Get all products |
| `POST` | `/products`| Create new product |
| `GET` | `/products/{productId}`| Get product by id |
| `DELETE` | `/products/{productId}`| Delete product by id |
| `GET` | `/products/categories/{categoryId}`| Get all products by cateogry id |#### Orders
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `PUT` | `/orders/status`| Update an order status |
| `GET` | `/orders`| Get all orders |
| `POST` | `/orders`| Create new order |
| `GET` | `/orders/{orderId}`| Get order by id |
| `GET` | `/orders/customer{customerId}`| Get all orders by user id |#### Categories
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `GET` | `/categories/{categoryId}`| Get category by id |
| `PUT` | `/categories/{categoryId}`| Update category by id |
| `DELETE` | `/categories/{categoryId}`| Delete category by id |
| `GET` | `/categories`| Get all categories |
| `POST` | `/categories`| Create new category |#### Carts
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `PUT` | `/carts/{cartId}`| Get cart by id |
| `GET` | `/carts`| Get all carts |
| `GET` | `/carts/customer/{customerId}`| Get cart by customer id |#### Addresses
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `GET` | `/addresses/{addressId}`| Get address by id |
| `PUT` | `/addresses/{addressId}`| Update address by id |
| `GET` | `/addresses`| Get all addresses |
| `POST` | `/addresses`| Create new address |
| `GET` | `/addresses/customer/{customerId}`| Get all addresses by customer id |#### Customers
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `GET` | `/customers`| Get all customers |
| `GET` | `/customers/{customerId}`| Get customer by id |#### Admins
| Method | Path | Description |
| :---- | :-------- | :------------------------- |
| `GET` | `/admins`| Get all admins |## Database