GithubHelp home page GithubHelp logo

louresb / smartshoplistapi Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 13.21 MB

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: MIT License

C# 100.00%
aspnet aspnet-mvc csharp dotnet entity-framework-core personal-project sqlite

smartshoplistapi's Introduction

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

smartshoplistapi's People

Contributors

louresb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.