This project provides an API for managing stock, pricing, and inventory for a retail store using .NET Core 8, SQL Server, and Ocelot for API Gateway.
- Overview
- Features
- Prerequisites
- Installation
- Configuration
- Running the Code
- Postman Collection
- Database Script
- Contributing
This API offers functionalities to manage product restocking, pricing adjustments based on market trends, and inventory optimization using fake data. The project follows best practices, including the use of stored procedures, SOLID principles, and a microservices architecture.
- Smart Restocking Plan
- Clever Pricing Trick
- Inventory Optimization
-
Clone the repository:
git clone https://github.com/Vijay-Kumavat/RetailStore.git
-
Install dependencies:
dotnet restore
-
Setup SQL Server:
- Ensure SQL Server is running.
- Run the database script provided here to set up the database schema and initial data.
-
Update
appsettings.json
: Configure your SQL Server connection string and any other necessary settings inappsettings.json
.{ "ConnectionStrings": { "DefaultConnection": "Server=your_server;Database=your_database;User Id=your_user;Password=your_password;" }, "Ocelot": { "ReRoutes": [ // Your Ocelot configuration here ], "GlobalConfiguration": { "BaseUrl": "https://localhost:5000" } } }
-
Ocelot Configuration:
- Configure Ocelot in
ocelot.json
for API Gateway setup.
- Configure Ocelot in
-
Build the project:
dotnet build
-
Run the project:
dotnet run
A Postman collection is provided here to test the API endpoints. Import the collection into Postman and use it to interact with the API.
The database script for setting up the required tables and initial data is available here. Run this script on your SQL Server to prepare the database.
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes or improvements.
- Ensure to follow security best practices, including input validation and protection against SQL injection and XSS.
- Design the solution with scalability and maintainability in mind.