An open API service indexing awesome lists of open source software.

https://github.com/01prathamesh/shopshakti

ShopShakti: Modern, scalable full-stack e-commerce web app with Angular frontend, ASP.NET Core backend, JWT auth, and admin analytics.
https://github.com/01prathamesh/shopshakti

angular asp-net-core-web-api ms-sql-server

Last synced: 7 months ago
JSON representation

ShopShakti: Modern, scalable full-stack e-commerce web app with Angular frontend, ASP.NET Core backend, JWT auth, and admin analytics.

Awesome Lists containing this project

README

          

# πŸ›οΈ ShopShakti (Full-Stack E-Commerce Platform)

![GitHub issues](https://img.shields.io/github/issues/01Prathamesh/ShopShakti) Β Β Β 
![GitHub license](https://img.shields.io/github/license/01Prathamesh/ShopShakti) Β Β Β 
![GitHub stars](https://img.shields.io/github/stars/01Prathamesh/ShopShakti) Β Β Β 
![GitHub forks](https://img.shields.io/github/forks/01Prathamesh/ShopShakti) Β Β Β 
![GitHub last commit](https://img.shields.io/github/last-commit/01Prathamesh/ShopShakti)

## πŸ“Œ Status: Active Development β€” Stable Core Features

Welcome to the **ShopShakti** project β€” a modern, full-stack, responsive e-commerce web application built using **Angular (frontend)** and **ASP.NET Core Web API (backend)**. It features a clean, scalable architecture and is designed for performance, maintainability, and an excellent user experience.

## πŸ“½οΈ **Project Demo**

Check out the live walkthrough of **ShopShakti** on YouTube:
[![ShopShakti Demo](https://img.youtube.com/vi/rlYTUn8ONFk/0.jpg)](https://youtu.be/rlYTUn8ONFk?si=KnZtb-_hHt2Op6vs)

πŸ”— Watch here: [https://youtu.be/rlYTUn8ONFk?si=KnZtb-_hHt2Op6vs](https://youtu.be/rlYTUn8ONFk?si=KnZtb-_hHt2Op6vs)

> 🚧 *Note: This project is a work in progress, but it’s stable enough to demonstrate core features and user flows.*

## πŸš€ Frontend Features (Angular)

- 🏠 **Homepage** with hero banners, trending, deals, and featured categories
- πŸ›’ **Product Listing & Detail Pages** with filtering, dynamic routing
- πŸ‘€ **Authentication**: Register, Login, Profile management
- 🧺 **Cart System** with quantity control and persistence
- πŸ’³ **Checkout** flow with order summary and confirmation
- πŸ“¦ **Order Management** for both users and admin
- πŸ§‘β€πŸ’Ό **Admin Dashboard** with analytics and protected routes
- 🍞 **Toast Notifications** for seamless feedback
- πŸ“± **Fully Responsive**: Optimized for desktop, tablet, and mobile

## 🧱 Frontend Structure
```
ShopShakti_frontend/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ app/
β”‚ β”‚ β”œβ”€β”€ components/
β”‚ β”‚ β”‚ β”œβ”€β”€ admin/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ admin-dashboard/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ order-management/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ product-management/
β”‚ β”‚ β”‚ β”‚ └── user-management/
β”‚ β”‚ β”‚ β”œβ”€β”€ auth_user_pages/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ login/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ register/
β”‚ β”‚ β”‚ β”‚ └── profile/
β”‚ β”‚ β”‚ β”œβ”€β”€ core_pages/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ homepage/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ product-list/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ product-detail/
β”‚ β”‚ β”‚ β”‚ └── cart/
β”‚ β”‚ β”‚ β”œβ”€β”€ orders/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ order-list/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ order-summary/
β”‚ β”‚ β”‚ β”‚ └── order-success/
β”‚ β”‚ β”‚ β”œβ”€β”€ staff/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ staff-dashboard/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manage-trending-products/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manage-benefits/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manage-top-deals/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manage-customer-reviews/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ manage-featured-categories/
β”‚ β”‚ β”‚ β”‚ └── manage-newsletter-subscription/
β”‚ β”‚ β”‚ β”œβ”€β”€ home/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ trending-products/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ featured-categories/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ top-deals/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ benefits/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ customer-reviews/
β”‚ β”‚ β”‚ β”‚ └── newsletter-subscription/
β”‚ β”‚ β”‚ └── ui_ux/
β”‚ β”‚ β”‚ β”œβ”€β”€ navbar/
β”‚ β”‚ β”‚ β”œβ”€β”€ admin-button/
β”‚ β”‚ β”‚ β”œβ”€β”€ cart-button/
β”‚ β”‚ β”‚ β”œβ”€β”€ footer/
β”‚ β”‚ β”‚ β”œβ”€β”€ searchbar/
β”‚ β”‚ β”‚ β”œβ”€β”€ category-sidebar/
β”‚ β”‚ β”‚ β”œβ”€β”€ banner-carousel/
β”‚ β”‚ β”‚ └── toast/
| | β”œβ”€β”€ models/
| | └── services/
β”‚ β”œβ”€β”€ assets/
β”‚ β”‚ └── images/
β”‚ β”‚ β”œβ”€β”€ banners/
| | β”œβ”€β”€ company/
β”‚ β”‚ β”œβ”€β”€ categories/
β”‚ β”‚ β”œβ”€β”€ deals/
β”‚ β”‚ └── products/
β”‚ └── index.html
```

## πŸ› οΈ Tech Stack (Frontend)

- **Angular 19** with standalone component architecture
- **TypeScript**
- **Angular Router** for route management and guards
- **Material Icons**, **FontAwesome** for UI elements

## πŸ”’ Admin Access

Admin routes are protected using an `AuthService` and `canActivateAdmin` guard. Only users with role `admin` can access the dashboard.

```ts
if (auth.isLoggedIn() && auth.isAdmin()) {
return true;
}
```

## πŸ“¦ Run Frontend Locally
```
# Install dependencies
npm install

# Run dev server
ng serve
```
Access the app at: http://localhost:4200

## πŸ”§ Backend Overview (ASP.NET Core)

The backend is a RESTful API built with **ASP.NET Core Web API**, using **Entity Framework Core** for data persistence and **SQL Server** as the database.

## 🧱 Backend Structure
```
ShopShakti_backend/
β”œβ”€β”€ Properties/
| └── launchSettings.cs/
β”œβ”€β”€ Controllers/
β”‚ β”œβ”€β”€ AdminController.cs
β”‚ β”œβ”€β”€ CartItemsController.cs
β”‚ β”œβ”€β”€ OrdersController.cs
β”‚ β”œβ”€β”€ ProductsController.cs
β”‚ └── UsersController.cs
β”œβ”€β”€ Data/
β”‚ β”œβ”€β”€ AppContextDb.cs
β”‚ └── AppDbContextFactory.cs
β”œβ”€β”€ Models/
β”‚ β”œβ”€β”€ CartItem.cs
β”‚ β”œβ”€β”€ Order.cs
β”‚ β”œβ”€β”€ Product.cs
β”‚ β”œβ”€β”€ User.cs
β”‚ β”œβ”€β”€ AdminMetricsDto.cs
β”‚ └── LoginDto.cs
β”œβ”€β”€ Migrations/
β”œβ”€β”€ Program.cs
β”œβ”€β”€ appsettings.json
└── ShopShakti_backend.csproj

```

## 🧰 Tech Stack (Backend)

- **ASP.NET Core 7 Web API**

- **Entity Framework Core**

- **SQL Server / SQLite**

- **CORS Configuration for frontend integration**

- **Swagger (OpenAPI 3.0) for documentation**

## πŸ“˜ API Endpoints

**πŸ›’ CartItems**

`GET /api/CartItems`

`GET /api/CartItems/{id}`

`POST /api/CartItems`

`PUT /api/CartItems/{id}`

`DELETE /api/CartItems/{id}`

**πŸ“¦ Orders**

`GET /api/Orders`

`GET /api/Orders/{id}`

`POST /api/Orders`

`PUT /api/Orders/{id}`

`DELETE /api/Orders/{id}`

**πŸ›οΈ Products**

`GET /api/Products`

`GET /api/Products/{id}`

`POST /api/Products`

`PUT /api/Products/{id}`

`DELETE /api/Products/{id}`

**πŸ‘€ Users**

`GET /api/Users`

`GET /api/Users/{id}`

`POST /api/Users`

`PUT /api/Users/{id}`

`DELETE /api/Users/{id}`

`POST /api/Users/login`

**πŸ“Š Admin Metrics**

`GET /api/Admin/metrics`

## πŸ“„ Schemas Used
- `Product`

- `CartItem`

- `Order`

- `User`

- `LoginRequest`

- `AdminMetricsDto`

## πŸ§ͺ Run Backend Locally
```
# Navigate to backend folder
cd ShopShakti_backend

# Restore NuGet packages
dotnet restore

# Update database (if using migrations)
dotnet ef database update

# Start the server
dotnet run
```
API Base URL: https://localhost:7171/api

Swagger: https://localhost:7171/swagger

## πŸ” Security Architecture

ShopShakti is designed with a strong focus on secure authentication, data protection, and access control. Below are the key security features implemented:

### βœ… Authentication & Authorization
- **JWT-based Authentication**
Secure login with JSON Web Tokens (JWT), including issuer, audience, and HMAC SHA256 signing.
- **Token Expiration & Validation**
Tokens expire based on a configurable time (`ExpiresInMinutes`), enforced using `ValidateLifetime` and `ClockSkew = 0`.
- **Role-Based Access Control**
Admin and user routes are guarded using Angular route guards (`canActivateAdmin`, `canActivateUser`).
- **Password Hashing**
User passwords are securely hashed using ASP.NET Core’s `PasswordHasher` before being saved to the database.

### βœ… API & Backend Security
- **[Authorize] Decorators**
Sensitive API endpoints (e.g. profile, orders, cart) are protected using `[Authorize]`, while public routes like registration and login use `[AllowAnonymous]`.
- **CORS Policy Enforcement**
Backend is configured to allow only trusted frontend origins (e.g., `http://localhost:4200`).
- **Blocked User Handling**
Blocked users are denied access during login and receive a `403 Forbidden` response.

### βœ… Frontend Safeguards
- **JWT Interceptor**
Angular HTTP interceptor automatically attaches `Authorization: Bearer ` to every protected API request.
- **Secure Token Storage**
JWT and user info (excluding password) are stored safely in `localStorage`. Passwords are never exposed to the client.
- **Route Guards**
Angular guards restrict access to protected routes like `/profile`, `/cart`, `/checkout`, and `/admin`.

> βœ… All critical flows (login, logout, registration, token validation, admin access, and blocked user control) have been implemented securely and verified.
This setup follows modern best practices for Angular + ASP.NET Core Web API + SQL Server applications.

## βœ… Future Enhancements

- Wishlist & Payment gateway

- Advanced search, filters, and pagination

- Product ratings and reviews

- Order tracking & invoice downloads

## 🀝 Contribution

Pull requests and suggestions are welcome! Please fork the repository and submit a PR with clear and descriptive commit messages.

## πŸ“„ License

This project is licensed under the **MIT License**.
You are free to use, modify, and distribute this software with attribution.
See the [LICENSE](./LICENSE) file for full details.

## πŸ‘¨β€πŸ’» Developer Note
This project has been thoughtfully crafted as a full-stack e-commerce solution with a strong emphasis on clean architecture, intuitive UI/UX, and scalable design. Every componentβ€”from frontend interactions to backend logicβ€”has been built with attention to performance, maintainability, and modern best practices.

## πŸ§‘β€πŸŽ“ Developed & Maintained by:

***Prathamesh Kasar***


`Β© 2025 Prathamesh Kasar. All rights reserved.`


Please do not reproduce without proper attribution.