Skip to content

πŸ§‘β€πŸ’Ό User Service - eCommerce Microservice User Service is the authentication and identity management microservice in a modular, scalable eCommerce platform. Built with a focus on clean architecture, best practices, and modern .NET tooling, this service manages: User registration Authentication (JWT) Profile management

License

Notifications You must be signed in to change notification settings

sandeeppaldotnet/ShoppingWebsite.UsersService

Repository files navigation

πŸ§‘β€πŸ’Ό User Service - eCommerce Microservice

User Service is the authentication and identity management microservice in a modular, scalable eCommerce platform.
Built with a focus on clean architecture, best practices, and modern .NET tooling, this service manages:

  • User registration
  • Authentication (JWT)
  • Profile management

πŸš€ Tech Stack

Technology Description
ASP.NET Core Backend framework (.NET 8)
PostgreSQL Relational database
Dapper Lightweight micro ORM
Clean Architecture Scalable, layered project structure
AutoMapper Object-to-object mapping
DTOs For clean data transfer between layers
FluentValidation Validation of models and DTOs
JWT Auth Secure token-based authentication
Docker Containerized for easy deployment

πŸ“ Project Structure


βš™οΈ Features

  • βœ… Register new users
  • βœ… Login and receive JWT token
  • βœ… Secure endpoints with [Authorize]
  • βœ… AutoMapper for clean mapping
  • βœ… FluentValidation for input validation
  • βœ… Clean, testable architecture
  • βœ… Docker support for local development

🐳 Getting Started (Docker)

πŸ“¦ Prerequisites

πŸ”§ Run Locally

docker-compose up --build
πŸ“¬ API Endpoints
Method	Endpoint	Description
POST	/api/users/register	Register a new user
POST	/api/users/login	Login and receive JWT

πŸ”§ Configuration
appsettings.json

"ConnectionStrings": {
  "DefaultConnection": "Host=localhost;Port=5432;Database=ShoppingCartUsers;Username=postgres;Password=test123"
},
"Jwt": {
  "Key": "your_secret_key_here",
  "Issuer": "eCommerceApp",
  "Audience": "eCommerceClient",
  "ExpiresInMinutes": 60
}


πŸ§ͺ Testing the API

Use Postman, curl, or the Swagger UI to test endpoints:

curl -X POST http://localhost:5000/api/users/login \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com", "password":"password123"}'

πŸ› οΈ To Do / Roadmap

Password hashing (BCrypt)

Email verification

Role-based access (admin, customer, etc.)

Refresh tokens

Unit & integration tests

CI/CD pipeline (GitHub Actions)

About

πŸ§‘β€πŸ’Ό User Service - eCommerce Microservice User Service is the authentication and identity management microservice in a modular, scalable eCommerce platform. Built with a focus on clean architecture, best practices, and modern .NET tooling, this service manages: User registration Authentication (JWT) Profile management

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published