A modern, full-stack e-commerce platform for Islamic products built with React.js frontend and Laravel backend.
- Features
- Tech Stack
- Installation
- Configuration
- Usage
- API Documentation
- Database Schema
- Security
- Contributing
- License
- Product Catalog: Browse Islamic products with categories
- Shopping Cart: Add/remove items with quantity management
- Guest Checkout: Place orders without registration
- Order Tracking: View order status and history
- Responsive Design: Mobile-friendly interface
- Dashboard: Comprehensive admin dashboard
- Product Management: CRUD operations for products
- Category Management: Organize products by categories
- Order Management: View, accept, decline, and complete orders
- Customer Tracking: Monitor order patterns and suspicious activity
- Real-time Updates: Instant UI refresh on all operations
- Authentication: Laravel Sanctum token-based auth
- Client Tracking: IP address and order pattern monitoring
- Anti-Spam: Automated suspicious order detection
- Database Integration: Full MySQL/Laravel integration
- API Security: Protected admin endpoints
- Error Handling: Comprehensive error management
- React.js 18+ - UI framework
- React Router - Navigation
- CSS3 - Styling
- Context API - State management
- Fetch API - HTTP requests
- Laravel 10+ - PHP framework
- MySQL - Database
- Laravel Sanctum - Authentication
- Eloquent ORM - Database operations
- API Resources - Data transformation
- Vite - Frontend build tool
- Composer - PHP dependency manager
- Artisan - Laravel CLI tool
- MySQL - Database server
- PHP 8.1+
- Node.js 16+
- MySQL 8.0+
- Composer
- npm/yarn
- Clone Repository
git clone <repository-url>
cd islamic-project/backend- Install Dependencies
composer install- Environment Configuration
cp .env.example .env
php artisan key:generate- Database Setup
# Edit .env file with your database credentials
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
# Run migrations
php artisan migrate- Start Backend Server
php artisan serve
# Backend runs on http://127.0.0.1:8001- Navigate to Frontend
cd ../frontend- Install Dependencies
npm install- Start Development Server
npm run dev
# Frontend runs on http://localhost:5173# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
# Application
APP_NAME="Islamic Store"
APP_ENV=local
APP_KEY=base64:...
APP_DEBUG=true
APP_URL=http://127.0.0.1:8001Default admin account (create via database or registration):
- Email: admin@example.com
- Password: password
- Browse Products: Visit homepage to view featured products
- View Categories: Navigate to categories page
- Add to Cart: Click "Add to Cart" on any product
- Manage Cart: Adjust quantities or remove items
- Checkout: Click "Checkout" to place order
- Order Confirmation: Receive order ID and confirmation
- Login: Visit
/admin/login - Dashboard: View overview with statistics
- Manage Products: Add, edit, or delete products
- Manage Categories: Organize product categories
- Manage Orders: View and process customer orders
- Monitor Activity: Track suspicious orders and patterns
GET /api/products # Get all products
GET /api/categories # Get all categoriesPOST /api/orders # Create new order (guest checkout)POST /api/login # Admin login
POST /api/logout # Admin logoutPOST /api/products # Create product
PUT /api/products/{id} # Update product
DELETE /api/products/{id} # Delete productPOST /api/categories # Create category
PUT /api/categories/{id} # Update category
DELETE /api/categories/{id}# Delete categoryGET /api/orders # Get all orders
PUT /api/orders/{id}/status # Update order statusPOST /api/orders
{
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_phone": "123-456-7890",
"shipping_address": "123 Main St, City, State 12345",
"total_price": 99.99,
"order_items": [
{
"product_id": 1,
"quantity": 2,
"price": 49.99
}
]
}{
"message": "Order placed successfully",
"order_id": 123,
"risk_score": 10
}id- Primary keyname- User nameemail- User email (unique)password- Hashed passwordcreated_at,updated_at- Timestamps
id- Primary keyname- Product namedescription- Product descriptionprice- Product pricestock- Available quantitycategory_id- Foreign key to categoriesimage- Product image URLcreated_at,updated_at- Timestamps
id- Primary keyname- Category namecreated_at,updated_at- Timestamps
id- Primary keycustomer_name- Customer namephone- Customer phoneaddress- Shipping addresstotal_price- Order totalstatus- Order status (pending, accepted, declined, completed)created_at,updated_at- Timestamps
id- Primary keyorder_id- Foreign key to ordersproduct_id- Foreign key to productsquantity- Item quantityprice- Item pricecreated_at,updated_at- Timestamps
id- Primary keytokenable_type- Model typetokenable_id- Model IDname- Token nametoken- Hashed tokenabilities- Token abilitiesexpires_at- Token expirationcreated_at,updated_at- Timestamps
- Laravel Sanctum: Token-based authentication
- API Tokens: Secure token generation and validation
- Role-based Access: Admin vs public user permissions
- Password Hashing: Bcrypt encryption
- Token Hashing: Secure token storage
- Input Validation: Request validation on all endpoints
- SQL Injection Prevention: Eloquent ORM protection
- Order Frequency Monitoring: Detect high-frequency orders
- Pattern Analysis: Identify suspicious ordering patterns
- Risk Scoring: Automated risk assessment
- IP Tracking: Monitor order sources
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PSR-12 coding standards
- Write comprehensive tests
- Update documentation
- Use meaningful commit messages
- Customer registration system
- Order history for customers
- Email notifications
- Payment gateway integration
- Product search functionality
- Advanced customer tracking
- Inventory management
- Discount/coupon system
- Product reviews and ratings
- Multi-language support
- Analytics dashboard
- Export functionality
- API rate limiting
- Caching optimization
- Mobile app development
For support and questions:
- Email: support@islamicstore.com
- Documentation: Check this README and API docs
- Issues: Create GitHub issue for bugs
This project is licensed under the MIT License - see the LICENSE file for details.
π Islamic Store - Your trusted source for authentic Islamic products