# Project Setup & Technology Guide

This document lists the tech stack versions, verification commands, and why they are required for this project.

---

## 1. Technologies, Versions, and Why We Need Them

### PHP
- **Version**: `8.5.3 (NTS x64)`
- **Verification Command**: `php -v`
- **Why We Need It**: PHP is the core server-side scripting language. The entire backend application is built using PHP.

### Laravel
- **Version**: `13.9.0`
- **Verification Command**: `php artisan --version`
- **Why We Need It**: Laravel is the PHP web framework. It provides the routing structure, controllers, Eloquent ORM for database interaction, and API endpoints.

### MySQL
- **Version**: `5.7.31`
- **Verification Command**: Run `SELECT VERSION();` query in MySQL
- **Why We Need It**: MySQL is the database. It stores all dynamic data like product lists, customer accounts, orders, categories, and settings.

### Composer
- **Version**: `2.9.7`
- **Verification Command**: `composer --version`
- **Why We Need It**: Composer is the package manager for PHP. It downloads and manages all the PHP packages/libraries required by Laravel (like Sanctum, Spatie Permission).

### Node.js & NPM
- **Version**: Node `v24.11.1` / NPM `11.7.0`
- **Verification Command**: `node -v` and `npm -v`
- **Why We Need It**: Node/NPM manage frontend packages and run Vite. It is needed to compile the CSS and JavaScript files for the admin and customer web pages.

### Docker & Docker Compose
- **Version**: Docker `29.0.1` / Compose `v2.40.3-desktop.1`
- **Verification Command**: `docker --version` and `docker compose version`
- **Why We Need It**: Docker containerizes the application environment. It allows running the app, database, and phpMyAdmin without installing MySQL or PHP server configurations directly on your host machine.

---

## 2. Docker Setup Overview

If you have Docker installed, you can set up the application with these simple steps:

1. Copy Docker env file:
   ```bash
   cp .env.docker .env
   ```
2. Build and start containers in the background:
   ```bash
   docker compose up -d --build
   ```
3. Generate application key inside container:
   ```bash
   docker compose exec app php artisan key:generate
   ```
4. Run migrations and database seeding inside container:
   ```bash
   docker compose exec app php artisan migrate --seed
   ```
5. Create public storage symlink inside container:
   ```bash
   docker compose exec app php artisan storage:link
   ```

- **API/App URL**: `http://127.0.0.1:8000`
- **phpMyAdmin URL**: `http://localhost:8080` (Host: `mysql`, User: `root`, Password: `root`)
