E-commerce Platform API (.NET 8 + Angular 18)
A scalable .NET 8 + Angular 18 e-commerce platform with modular API and production-ready architecture.
Overview
A scalable .NET 8 + Angular 18 e-commerce platform with modular API design, JWT auth, and production-ready architecture deployed on VPS with Docker and Traefik.
The Challenge
A production-grade backend and frontend architecture for a modern e-commerce platform. The system includes authentication, product catalog, cart, checkout, order processing, and a modular API designed for real traffic and scalability.
The Solution
Built a modular REST API in .NET 8 with Entity Framework Core, JWT authentication, and Docker deployment. Architecture separates concerns into distinct layers — API controllers, business logic, and data access — enabling independent scaling and testing.
Architecture
The platform follows Clean Architecture principles, separating the domain, application, infrastructure, and presentation layers. The frontend is a decoupled Angular 18 SPA communicating with the .NET 8 REST API via JWT-secured endpoints, all containerized and routed through Traefik.
.NET 8 Web API
Clean Architecture, EF Core, modular controllers
Angular 18 SPA
Standalone components, reactive forms, RxJS
PostgreSQL + EF Core
Relational data, migrations, optimized queries
JWT Authentication
Role-based authorization, secure endpoints
[ApiController]
[Route("api/[controller]")]
[Authorize]
public class OrdersController : ControllerBase
{
private readonly IOrderService _orderService;
public OrdersController(IOrderService orderService)
=> _orderService = orderService;
[HttpPost]
public async Task<IActionResult> CreateOrder([FromBody] CreateOrderDto dto)
{
var order = await _orderService.ProcessOrderAsync(dto, User.GetUserId());
return CreatedAtAction(nameof(GetOrder), new { id = order.Id }, order);
}
}
import { Component, inject } from '@angular/core';
import { OrderService } from '../../services/order.service';
@Component({
selector: 'app-checkout',
standalone: true,
templateUrl: './checkout.component.html'
})
export class CheckoutComponent {
private orderService = inject(OrderService);
async submitOrder(dto: CreateOrderDto) {
try {
const order = await this.orderService.create(dto).toPromise();
this.router.navigate(['/success', order.id]);
} catch (err) {
this.errorSignal.set('Order failed');
}
}
}
-- Generated by EF Core Migrations
CREATE TABLE "Orders" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"Status" integer NOT NULL,
"CreatedAt" timestamp with time zone NOT NULL,
CONSTRAINT "PK_Orders" PRIMARY KEY ("Id")
);
CREATE INDEX "IX_Orders_UserId" ON "Orders" ("UserId");
services:
api:
image: robertkulig/ecom-api:latest
build:
context: .
dockerfile: Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection=Host=db;Database=ecom
labels:
- "traefik.http.routers.api.rule=Host(`api.demo.robertkulig-dev.eu`)"