Skip to content

RedTeaWithMilk/DotnetHW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECommerceApp API

.NET 9 REST API project demonstrating Layered Architecture, Minimal API, Entity Framework Core, and Token-based Authentication.

Features

  • .NET 9
  • Layered Architecture (Api, Service, Data)
  • Entity Framework Core with SQLite
  • S.O.L.I.D Principles applied
  • Minimal API alongside Controllers
  • JWT Authentication
  • Soft Delete (IsDeleted)
  • Global Exception Handling
  • Serilog Logging

Architecture Diagram

graph TD
    Client --> API
    API --> Service
    Service --> Data
    Data --> Database(SQLite)
Loading

Getting Started

  1. Prerequisites

    • .NET 9 SDK
    • SQLite
  2. Setup

    git clone <repo>
    cd DotnetHW
    dotnet restore
  3. Database Migrations are already created. To apply them:

    cd ECommerceApp
    dotnet ef database update --project ECommerceApp.Data --startup-project ECommerceApp.Api
  4. Run

    dotnet run --project ECommerceApp.Api

    API will run at http://localhost:5030 (or similar). Swagger UI: http://localhost:5030/swagger

Endpoints

Auth

  • POST /api/Auth/login
  • POST /api/Auth/register

Users (Minimal API)

  • GET /api/v1/minimal/users
  • GET /api/v1/minimal/users/{id}
  • POST /api/v1/minimal/users
  • PUT /api/v1/minimal/users/{id}
  • DELETE /api/v1/minimal/users/{id}

Products (Layered Controller)

  • GET /api/Products
  • GET /api/Products/{id}
  • POST /api/Products (Auth required)
  • PUT /api/Products/{id} (Auth required)
  • DELETE /api/Products/{id} (Auth required)

Orders

  • POST /api/Orders (Auth required)
  • GET /api/Orders/user/{userId}

API Response Format

All responses follow:

{
  "success": true,
  "message": "Success",
  "data": { ... }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages