Skip to content

Z-Har/Islamic-Store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•Œ Islamic Store E-Commerce Platform

A modern, full-stack e-commerce platform for Islamic products built with React.js frontend and Laravel backend.

πŸ“‹ Table of Contents

✨ Features

πŸ›οΈ Customer Features

  • 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

πŸ›‘οΈ Admin Features

  • 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

πŸ”§ Technical Features

  • 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

πŸ› οΈ Tech Stack

Frontend

  • React.js 18+ - UI framework
  • React Router - Navigation
  • CSS3 - Styling
  • Context API - State management
  • Fetch API - HTTP requests

Backend

  • Laravel 10+ - PHP framework
  • MySQL - Database
  • Laravel Sanctum - Authentication
  • Eloquent ORM - Database operations
  • API Resources - Data transformation

Development Tools

  • Vite - Frontend build tool
  • Composer - PHP dependency manager
  • Artisan - Laravel CLI tool
  • MySQL - Database server

πŸš€ Installation

Prerequisites

  • PHP 8.1+
  • Node.js 16+
  • MySQL 8.0+
  • Composer
  • npm/yarn

Backend Setup

  1. Clone Repository
git clone <repository-url>
cd islamic-project/backend
  1. Install Dependencies
composer install
  1. Environment Configuration
cp .env.example .env
php artisan key:generate
  1. Database Setup
# Edit .env file with your database credentials
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

# Run migrations
php artisan migrate
  1. Start Backend Server
php artisan serve
# Backend runs on http://127.0.0.1:8001

Frontend Setup

  1. Navigate to Frontend
cd ../frontend
  1. Install Dependencies
npm install
  1. Start Development Server
npm run dev
# Frontend runs on http://localhost:5173

βš™οΈ Configuration

Environment Variables (.env)

# 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:8001

Admin Credentials

Default admin account (create via database or registration):

πŸ“– Usage

For Customers

  1. Browse Products: Visit homepage to view featured products
  2. View Categories: Navigate to categories page
  3. Add to Cart: Click "Add to Cart" on any product
  4. Manage Cart: Adjust quantities or remove items
  5. Checkout: Click "Checkout" to place order
  6. Order Confirmation: Receive order ID and confirmation

For Admins

  1. Login: Visit /admin/login
  2. Dashboard: View overview with statistics
  3. Manage Products: Add, edit, or delete products
  4. Manage Categories: Organize product categories
  5. Manage Orders: View and process customer orders
  6. Monitor Activity: Track suspicious orders and patterns

πŸ”Œ API Documentation

Public Endpoints

Products

GET /api/products          # Get all products
GET /api/categories        # Get all categories

Orders

POST /api/orders          # Create new order (guest checkout)

Protected Endpoints (Admin Only)

Authentication

POST /api/login           # Admin login
POST /api/logout          # Admin logout

Products Management

POST /api/products        # Create product
PUT /api/products/{id}   # Update product
DELETE /api/products/{id} # Delete product

Categories Management

POST /api/categories      # Create category
PUT /api/categories/{id}  # Update category
DELETE /api/categories/{id}# Delete category

Orders Management

GET /api/orders          # Get all orders
PUT /api/orders/{id}/status # Update order status

Request/Response Examples

Create Order

POST /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
    }
  ]
}

Response

{
  "message": "Order placed successfully",
  "order_id": 123,
  "risk_score": 10
}

πŸ—„οΈ Database Schema

Users Table

  • id - Primary key
  • name - User name
  • email - User email (unique)
  • password - Hashed password
  • created_at, updated_at - Timestamps

Products Table

  • id - Primary key
  • name - Product name
  • description - Product description
  • price - Product price
  • stock - Available quantity
  • category_id - Foreign key to categories
  • image - Product image URL
  • created_at, updated_at - Timestamps

Categories Table

  • id - Primary key
  • name - Category name
  • created_at, updated_at - Timestamps

Orders Table

  • id - Primary key
  • customer_name - Customer name
  • phone - Customer phone
  • address - Shipping address
  • total_price - Order total
  • status - Order status (pending, accepted, declined, completed)
  • created_at, updated_at - Timestamps

Order Items Table

  • id - Primary key
  • order_id - Foreign key to orders
  • product_id - Foreign key to products
  • quantity - Item quantity
  • price - Item price
  • created_at, updated_at - Timestamps

Personal Access Tokens Table (Sanctum)

  • id - Primary key
  • tokenable_type - Model type
  • tokenable_id - Model ID
  • name - Token name
  • token - Hashed token
  • abilities - Token abilities
  • expires_at - Token expiration
  • created_at, updated_at - Timestamps

πŸ” Security

Authentication

  • Laravel Sanctum: Token-based authentication
  • API Tokens: Secure token generation and validation
  • Role-based Access: Admin vs public user permissions

Data Protection

  • Password Hashing: Bcrypt encryption
  • Token Hashing: Secure token storage
  • Input Validation: Request validation on all endpoints
  • SQL Injection Prevention: Eloquent ORM protection

Anti-Spam Features

  • Order Frequency Monitoring: Detect high-frequency orders
  • Pattern Analysis: Identify suspicious ordering patterns
  • Risk Scoring: Automated risk assessment
  • IP Tracking: Monitor order sources

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PSR-12 coding standards
  • Write comprehensive tests
  • Update documentation
  • Use meaningful commit messages

πŸ“ TODO

Phase 1 Enhancements

  • Customer registration system
  • Order history for customers
  • Email notifications
  • Payment gateway integration
  • Product search functionality

Phase 2 Features

  • Advanced customer tracking
  • Inventory management
  • Discount/coupon system
  • Product reviews and ratings
  • Multi-language support

Phase 3 Advanced

  • Analytics dashboard
  • Export functionality
  • API rate limiting
  • Caching optimization
  • Mobile app development

πŸ“ž Support

For support and questions:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ•Œ Islamic Store - Your trusted source for authentic Islamic products

About

a small project between friends nothing fancy out here

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors