A smart C2C/B2C e-commerce platform that solves the problem of tedious listing creation using Generative AI. The system automatically generates deep technical specifications, descriptions, and pricing based on product photos. It features a robust monolithic architecture, a secure internal wallet (Escrow model) integrated with Stripe, and an advanced administration panel.
The application is available at: market.kacperkotecki.me
The core of the app is the integration with a multimodal LLM (GPT-4o Vision) via OpenRouter API.
- Image Analysis: Photos are converted to Base64. AI recognizes the product and generates detailed technical specifications (Deep Specs) in JSON format.
- Structured Outputs & Fallbacks: The model's response is strictly enforced as JSON and safely deserialized into strongly-typed C# DTOs, eliminating text parsing errors and handling AI hallucinations.
Transaction safety is built around an Escrow model, ensuring financial consistency.
- Stripe Webhooks: Payment status is updated asynchronously via Webhooks, preventing client-side manipulation.
- Atomic Transactions: The system maintains a funds register (
WalletBalance). Withdrawals and balance updates are executed as atomic database transactions using the Unit of Work pattern to prevent "double spending".
- Custom Action Filters: Instead of cluttering controllers with imperative
ifstatements, custom authorization attributes (e.g.,[SellerFilter]) intercept requests to ensure users have provided mandatory data (like an IBAN) before accessing specific actions. - Soft Delete: Blocking users or banning auctions changes their state (
IsBlocked,IsBanned) rather than physically deleting records, preserving historical financial and order integrity.
- On-the-fly Image Processing: Uploaded photos are intercepted by ImageSharp, scaled to Full HD, and converted to the modern WebP format, reducing bandwidth usage by ~60-70%.
The user uploads photos, and the GPT-4o (Vision) model analyzes the product (recognizing the model, damage, and specs) and fills out the form in a fraction of a second.
A financial dashboard with transaction history and an auction list with filtering.
User management, content blocking, and a seamless checkout flow with real-time Stripe validation.
Backend & Architecture:
- .NET 8.0 (ASP.NET Core MVC)
- Clean Architecture Principles (Repository Pattern, Unit of Work, Dependency Injection)
- Entity Framework Core 8 (Code-First, PostgreSQL)
- Identity (Extended ASP.NET Core Identity for B2B/B2C profiles)
Frontend:
- Razor Views (
.cshtml), Bootstrap 5 (Dark Mode) - Vanilla JavaScript (ES6+), Fetch API, Swiper.js
Testing:
- NUnit (Test Framework)
- Moq (Mocking dependencies like
IUnitOfWork) - FluentAssertions (Readable test assertions)
Integrations & Infrastructure:
- OpenRouter API (GPT-4o Vision)
- Stripe API & Webhooks
- Docker & Docker Compose
- ImageSharp
The project includes a comprehensive suite of Unit Tests located in the Market.Tests project. It focuses on testing core business logic, such as the ProfileService and OrderService, ensuring that financial operations (like withdrawing funds or calculating pending balances) behave correctly under various scenarios.
To run the tests:
dotnet test Market.Tests/Market.Tests.csproj- .NET 8 SDK
- Docker Desktop (for PostgreSQL database)
- Stripe Account (for API Keys)
- OpenRouter Account (for AI API Keys)
-
Clone the repository:
git clone https://github.com/KacperKotecki/Market.git cd Market -
Set up the Database (Docker): Run the provided
docker-compose.ymlto spin up the PostgreSQL instance:docker-compose up -d
-
Configure Environment Variables: Update the
appsettings.jsonor use .NET User Secrets to configure your API keys and Database connection string:"ConnectionStrings": { "DefaultConnection": "Host=localhost;Port=5432;Database=MarketDb;Username=postgres;Password=YourPassword" }, "Stripe": { "SecretKey": "sk_test_...", "PublishableKey": "pk_test_...", "WebhookSecret": "whsec_..." }, "OpenRouter": { "ApiKey": "sk-or-v1-...", "Model": "openai/gpt-4o" }
-
Apply Migrations & Run: The application is configured to automatically apply pending migrations and seed default Admin roles on startup.
cd Market.Web dotnet run
Kacper Kotecki π§ kacperkotecki@protonmail.com
π LinkedIn Profile