Skip to content

samuellachisa/ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECommerce API

A .NET 10 RESTful API for an e-commerce platform built with a clean architecture using Wolverine for messaging and Marten for persistence (PostgreSQL).

Tech Stack

  • .NET 10 / ASP.NET Core
  • Wolverine — message bus / CQRS handler dispatch
  • Marten — document/event store on PostgreSQL
  • Scalar — OpenAPI UI
  • JWT Bearer authentication

Project Structure

src/
├── API/            # Controllers, Program.cs, config
├── Application/    # Commands, queries, DTOs, requests
├── Domain/         # Entities and domain logic
└── Infrastructure/ # Handlers, Marten setup, DI wiring

Prerequisites

  • .NET 10 SDK
  • PostgreSQL running locally (default port 5432)

Getting Started

  1. Create the database:

    CREATE DATABASE ecommerce_db;
  2. Update connection string in src/API/appsettings.json if needed:

    "ConnectionStrings": {
      "DefaultConnection": "Host=localhost;Port=5432;Database=ecommerce_db;Username=postgres;Password=yourpassword"
    }
  3. Update the JWT key in appsettings.json:

    "Jwt": {
      "Key": "your-super-secret-key-min-32-chars!!"
    }
  4. Run the API:

    dotnet run --project src/API
  5. Open the API docs at: https://localhost:7283/scalar

API Endpoints

Resource Methods
Catalog GET, POST, PUT, DELETE products
Customers GET, POST, PUT customers
Orders GET, POST orders; confirm/ship/deliver/cancel
Inventory GET, POST inventory adjustments
Payments POST, GET payments

Configuration

Setting Description
DefaultConnection PostgreSQL connection string
Jwt:Key Secret key for JWT signing (≥32 chars)
Jwt:ExpiryMinutes Token lifetime (default: 60)

About

A .NET 10 RESTful API for an e-commerce platform built with a clean architecture using Wolverine for messaging and Marten for persistence (PostgreSQL).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages