littleshop/CLAUDE.md

108 lines
3.0 KiB
Markdown

# LittleShop - E-Commerce Platform
## Overview
LittleShop is an ASP.NET Core 9.0 e-commerce platform with integrated Telegram bot support and cryptocurrency payment processing.
## Architecture
- **Framework**: ASP.NET Core 9.0 Web API + MVC
- **Database**: SQLite with Entity Framework Core
- **Authentication**: Dual-mode (Cookie for Admin Panel + JWT for API)
- **Structure**: Clean separation between Admin Panel (MVC) and Client API (Web API)
## Database Schema
**Core Tables:**
- Users (Staff authentication)
- Categories
- Products
- ProductPhotos
- ProductVariations (quantity-based pricing)
- Orders
- OrderItems
- CryptoPayments
**Key Features:**
- Proper foreign key relationships
- Product variations (e.g., 1 for £10, 2 for £19, 3 for £25)
- Order workflow tracking with user accountability
- Soft delete support (IsActive flag)
## Features
### Admin Panel (MVC)
- Dashboard with statistics
- Category management (CRUD)
- Product management with photo uploads
- Product variations management
- Order workflow management
- User management (staff only)
- Mobile-responsive design
### Client API (Web API)
- Public product catalog
- Order creation and management
- Customer order lookup
- Payment processing integration
- Swagger documentation
### Payment System
- Multi-cryptocurrency support (BTC, XMR, USDT, LTC, ETH, ZEC, DASH, DOGE)
- BTCPay Server integration
- Privacy-focused (no customer personal data stored)
- Webhook processing for payment status updates
### TeleBot Integration
- Product browsing with individual product bubbles
- Customer order history and tracking
- Quick buy functionality
- Professional message formatting
## Default Credentials
**Admin Account:**
- Username: `admin`
- Password: `admin`
## File Structure
```
LittleShop/
├── Controllers/ (Client API)
├── Areas/Admin/ (Admin Panel MVC)
│ ├── Controllers/
│ └── Views/
├── Services/ (Business Logic)
├── Models/ (Database Entities)
├── DTOs/ (Data Transfer Objects)
├── Data/ (EF Core Context)
├── Enums/ (Type Safety)
└── wwwroot/uploads/ (File Storage)
```
## Technical Notes
### ASP.NET Core 9.0
- Views need explicit model instances for proper binding
- Area routing requires proper route configuration
- Both Cookie (Admin) and JWT (API) authentication schemes
### Entity Framework Core
- SQLite handles complex relationships efficiently
- Database initialization via `EnsureCreated()` for development
- Proper decimal precision for currency values
### Security
- PBKDF2 password hashing (100,000 iterations)
- Claims-based authorization
- No customer PII storage (privacy-focused)
- CORS configuration ready
## Development Environment
- **Platform**: Windows/WSL
- **Command Shell**: cmd.exe recommended for .NET commands
- **Database**: SQLite (file-based, no server required)
- **Hot Reload**: Views require app restart in Production mode