Skip to content

shieldx-bot/eco

Repository files navigation

# 🚀 AI Commerce - E-commerce Platform for AI Accounts & API Packages Hệ thống thương mại điện tử hoàn chỉnh để bán tài khoản AI (ChatGPT Plus, Claude Pro) và các gói API (OpenAI, Anthropic). ## ✨ Tính Năng ### 🛒 Customer Features - ✅ Duyệt và tìm kiếm sản phẩm với filters - ✅ Giỏ hàng với quản lý số lượng - ✅ Thanh toán an toàn qua Stripe - ✅ Nhận credentials ngay sau thanh toán - ✅ Dashboard quản lý đơn hàng - ✅ Download hóa đơn ### 🔧 Admin Features - ✅ Dashboard với thống kê - ✅ Quản lý products, orders, users - ✅ Báo cáo doanh thu - ✅ Quản lý coupons ## 🏗️ Tech Stack - **Backend**: Node.js, Express, TypeScript, PostgreSQL - **Frontend**: Next.js 15, React, TypeScript, Tailwind CSS - **Payment**: Stripe, PayPal - **Security**: Helmet, Rate Limiting, CSRF Protection, XSS Protection, Winston Logging - **DevOps**: Docker, Docker Compose ## 🚀 Quick Start with Docker ### Option 1: Automatic Security Setup (Recommended) ```bash # Clone repository git clone cd eco # Run security setup script (generates secure secrets) # Windows PowerShell: .\setup-security.ps1 # Linux/Mac: chmod +x setup-security.sh ./setup-security.sh # Start all services docker-compose up -d --build ``` ### Option 2: Manual Setup ```bash # Clone repository git clone cd eco # Copy environment file cp .env.example .env # Edit .env với thông tin của bạn (đặc biệt là secrets!) # Start all services docker-compose up -d --build # View logs docker-compose logs -f ``` Services: - Frontend: http://localhost:3000 - Backend: http://localhost:5000 - PostgreSQL: localhost:5432 ## 📦 Deploy Riêng Backend & Frontend ### Deploy Backend Only ```bash cd Backend # Edit .env với DATABASE_URL từ external PostgreSQL docker-compose -f docker-compose.prod.yml up -d --build ``` ### Deploy Frontend Only ```bash cd frontend # Edit .env với NEXT_PUBLIC_API_URL từ backend docker-compose -f docker-compose.prod.yml up -d --build ``` ## 📚 Documentation - [DEPLOYMENT.md](./DEPLOYMENT.md) - Hướng dẫn deploy chi tiết - [SECURITY.md](./SECURITY.md) - ⭐ **Backend Security Documentation** - [frontend/SECURITY.md](./frontend/SECURITY.md) - Frontend Security Guide - [QUICKSTART.md](./QUICKSTART.md) - Quick start 5 phút - [Backend README](./Backend/README.md) - Backend API docs - [Frontend README](./frontend/README.md) - Frontend docs ## 🔒 Security Features Hệ thống được xây dựng với **nhiều lớp bảo mật** để bảo vệ khỏi các tấn công phổ biến: ### ✅ Implemented Security Measures - **DDoS/DoS Protection**: Rate limiting với express-rate-limit (100 req/15min general, 5 req/15min auth, 3 req/10min payment) - **XSS Protection**: Custom middleware sanitize tất cả user input - **CSRF Protection**: Double Submit Cookie pattern với origin verification - **SQL/NoSQL Injection**: Input sanitization với express-mongo-sanitize - **Security Headers**: Comprehensive headers với Helmet (CSP, HSTS, X-Frame-Options, etc.) - **Request Logging**: Winston logger với daily rotation cho security monitoring - **Input Validation**: express-validator cho tất cả endpoints - **HTTP Parameter Pollution**: Protection với hpp middleware - **Compression**: Giảm bandwidth và improve performance - **Secure Cookies**: HttpOnly, Secure, SameSite flags - **IP Filtering**: Whitelist/Blacklist support - **Suspicious Activity Detection**: Phát hiện SQL injection, XSS, path traversal attempts ### 🛡️ Security Scripts ```bash # Run security audit (check for vulnerabilities) # Windows: .\security-audit.sh # Linux/Mac: chmod +x security-audit.sh ./security-audit.sh # Check npm vulnerabilities cd Backend npm audit npm audit fix ``` ### 📖 Security Documentation Chi tiết về security implementation, best practices, và configuration: - **Backend**: [SECURITY.md](./SECURITY.md) - **Frontend**: [frontend/SECURITY.md](./frontend/SECURITY.md) ## 🔐 Environment Variables Xem `.env.example` để biết tất cả variables cần thiết. **Quan trọng cần thay đổi:** - `POSTGRES_PASSWORD` - Mật khẩu database - `JWT_SECRET` - Secret key (min 32 chars) - `STRIPE_SECRET_KEY` - Stripe API key - `STRIPE_WEBHOOK_SECRET` - Stripe webhook secret ## 📞 Support Xem [DEPLOYMENT.md](./DEPLOYMENT.md) để troubleshooting. ## 📄 License MIT License # eco

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published