This project contains a .NET 8 Web API developed for a coffee shop. The API supports various functionalities such as inventory management, product operations, user authentication, JWT-based validation, order creation, and user roles.
To run the project on your local machine, follow these steps:
-
Clone the repository:
git clone https://github.com/tw4/Coffee-Shop-Backend.git
-
Navigate to the project directory:
cd coffee-shop-backend
-
Install the required dependencies:
dotnet restore
-
Create database table for Logs:
CREATE TABLE [Logs] ( [Id] int IDENTITY(1,1) NOT NULL, [Message] nvarchar(max) NULL, [MessageTemplate] nvarchar(max) NULL, [Level] nvarchar(128) NULL, [TimeStamp] datetime NOT NULL, [Exception] nvarchar(max) NULL, [Properties] nvarchar(max) NULL CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED ([Id] ASC));
-
Create database migrations:
dotnet ef migrations add initialcreate
-
Apply database migrations:
dotnet ef database update
-
Run the project:
dotnet run
-
The API will run by default at
https://localhost:5001
.
You can perform the following functionalities using the API:
- Inventory Management: Listing, adding, updating, and deleting products.
- User Management: Creating, updating, and deleting users.
- JWT User Authentication: User login and token retrieval.
- User Roles: Managing user roles and checking assigned roles.
- Order Creation: Creating and managing orders based on products.
This project utilizes the following technologies:
- .NET 8
- Entity Framework Core
- JWT Authentication
- Swagger/OpenAPI documentation
- Redis
- Elasticsearch
- Docker
- Azure SQL Edge
- Stripe
- Serilog
- Testing
- xUnit.net
If you'd like to contribute to this project, please check the CONTRIBUTING.md
file and feel free to submit a pull request.
This project is licensed under the MIT License.