Skip to content

SmartShopList is a personal project that I developed to showcase my skills in C#, .NET, and ASP.NET. It is a shopping list application that allows users to efficiently manage their shopping lists, products, and shopping carts. With features like adding, removing, and updating products, calculating total prices, and organizing list items.

License

Notifications You must be signed in to change notification settings

louresb/SmartShopListAPI

Repository files navigation

SmartShopList

licence mit Development Status Badge

This is a shopping list application developed using C#, .NET, and ASP.NET. It allows users to manage their shopping lists, products, and shopping carts.

Features

  • Create, read, update, and delete shopping lists.
  • Create, read, update, and delete products.
  • Create, read, update, and delete shopping carts.
  • Add and remove products from shopping carts.
  • Add and remove shopping carts from shopping lists.
  • Update the quantity of a product in a shopping cart.
  • Calculate the total price of shopping lists and shopping carts.

Technologies Used

  • C#
  • .NET
  • ASP.NET
  • Microsoft.AspNetCore.Mvc
  • Entity Framework Core
  • SQLite

Installation

  1. Clone the repository:
git clone https://github.com/louresb/SmartShopListApp
  1. Navigate to the project directory:
cd SmartShopListApp
  1. Build the project:
dotnet build
  1. Run the project:
dotnet run
  1. Access the application through the URL: https://localhost: <port>

API Endpoints

ProductController

  • GET /api/product - Get all products.
  • GET /api/product/{id} - Get a product by ID.
  • POST /api/product - Create a new product.
  • PUT /api/product/{id} - Update a product by ID.
  • DELETE /api/product/{id} - Delete a product by ID.

ShoppingCartController

  • GET /api/shoppingcart - Get all shopping carts.
  • GET /api/shoppingcart/{id} - Get a shopping cart by ID.
  • POST /api/shoppingcart - Create a new shopping cart.
  • POST /api/shoppingcart/{cartId}/addproduct/{productId} - Add a product to a shopping cart.
  • PUT /api/shoppingcart/{id} - Update a shopping cart by ID.
  • PUT /api/shoppingcart/{cartId}/updateproduct/{productId} - Update the quantity of a product in a shopping cart.
  • DELETE /api/shoppingcart/{id} - Delete a shopping cart by ID.
  • DELETE /api/shoppingcart/{cartId}/removeproduct/{productId} - Remove a product from a shopping cart.

ShoppingListController

  • GET /api/shoppinglist - Get all shopping lists.
  • GET /api/shoppinglist/{id} - Get a shopping list by ID.
  • POST /api/shoppinglist - Create a new shopping list.
  • POST /api/shoppinglist/{listId}/addcart - Add a shopping cart to a shopping list.
  • PUT /api/shoppinglist/{id} - Update a shopping list by ID.
  • DELETE /api/shoppinglist/{id} - Delete a shopping list by ID.
  • DELETE /api/shoppinglist/{listId}/removecart/{cartId} - Remove a shopping cart from a shopping list.

Examples

Creating a new shopping cart

To create a new shopping cart, send a POST request to /api/shoppingcart with the following JSON payload:

{
"name": "My Shopping Cart",
"shoppingListId": 1
}

Getting all lists

To get all products, send a GET request to /api/list.

Adding a product to the shopping cart

To add a product to the shopping cart send a Post request to /api/shoppingcart/{shoppingcartId}/addproduct/{productId} with the following JSON payload:

{
"quantity": 3
}

Screenshots

Post / addproduct / addcart

Get / GetbyId / Put / updateproduct / updateshoppinglist

Delete / removeproduct / removecart

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

MIT License © Bruno Loures

About

SmartShopList is a personal project that I developed to showcase my skills in C#, .NET, and ASP.NET. It is a shopping list application that allows users to efficiently manage their shopping lists, products, and shopping carts. With features like adding, removing, and updating products, calculating total prices, and organizing list items.

Topics

Resources

License

Stars

Watchers

Forks

Languages