Welcome to the BookStore Web API documentation. This API allows you to manage a bookstore's inventory and orders. The application follows the clean architecture pattern, with distinct layers for Application, Domain, Infrastructure, and Security. It also provides unit tests to ensure the robustness and reliability of the codebase.
- Add books to the inventory
- List out-of-stock books
- Edit book details
- Delete books from the inventory
- Get a list of available books
- Create orders for desired books
- Cancel placed orders
- List orders made by the customer
- Create a JWT token using email and password for authentication
- Create new user accounts
The BookStore Web API is structured using the clean architecture pattern. This promotes separation of concerns and modularity in the codebase. The architecture consists of the following layers:
-
Application Layer: This layer contains the application logic and orchestrates the interactions between different components. It defines use cases and interfaces for interacting with the Domain layer.
-
Domain Layer: The heart of the application, this layer contains the core business entities, rules, and logic. It's independent of any external concerns and represents the actual domain model.
-
Infrastructure Layer: This layer provides implementations for interacting with external resources such as databases, external services, and APIs. It bridges the gap between the application and external systems.
-
Security Layer: Responsible for handling authentication and authorization. It ensures that only authorized users can access certain features and resources of the application.
The architecture is designed to be maintainable, scalable, and testable. Each layer is covered by unit tests to ensure code quality and reliability.
To run the BookStore Web API, follow these steps:
-
Install .NET 7 SDK.
-
Set up a PostgreSQL database.
-
Run the database script to create the required tables and schema.
-
Open a terminal and navigate to the root directory of the application.
-
Build the Docker image using the provided Dockerfile:
docker build -t bookstore .
-
Run the application using Docker Compose:
docker-compose up
-
Open application swagger URL at: http://localhost:3000/swagger/index.html
This will start the BookStore Web API along with its required services.
Remember to configure environment variables, connection strings, and other settings as needed before running the application.