commit 5d7802991a3c3d30ed8ffd1a9f8988874987ef2a Author: DualFroz Date: Sun Aug 23 09:40:06 2026 +0200 chore: scaffold composer project and env template diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7ddd468 --- /dev/null +++ b/.env.example @@ -0,0 +1,19 @@ +APP_ENV=local +APP_DEBUG=true +APP_URL=http://127.0.0.1:8000 +CURRENCY=usd + +# Database. Default is a file-based SQLite database for dev and test. +# For MySQL/Postgres on deploy set DB_DRIVER=mysql or pgsql and fill the rest. +DB_DRIVER=sqlite +DB_DATABASE=database/bazaar.sqlite +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_USERNAME=root +DB_PASSWORD= + +# Stripe test-mode keys. Grab them from https://dashboard.stripe.com/test/apikeys +# Leave the placeholders in place to run the shop with payments disabled. +STRIPE_SECRET_KEY=sk_test_placeholder +STRIPE_PUBLISHABLE_KEY=pk_test_placeholder +STRIPE_WEBHOOK_SECRET=whsec_placeholder diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1ab395 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/vendor/ +/.env +/database/*.sqlite +/database/*.sqlite-journal +.DS_Store +.phpunit.result.cache +/.phpunit.cache/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..56240d2 --- /dev/null +++ b/composer.json @@ -0,0 +1,36 @@ +{ + "name": "vulpspace/bazaar", + "description": "Bazaar - e-commerce shop on a hand-rolled PHP microframework", + "type": "project", + "license": "MIT", + "require": { + "php": ">=8.3", + "ext-pdo": "*", + "stripe/stripe-php": "^16.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "autoload": { + "psr-4": { + "Bazaar\\": "src/" + }, + "files": [ + "src/Support/helpers.php" + ] + }, + "autoload-dev": { + "psr-4": { + "Bazaar\\Tests\\": "tests/" + } + }, + "config": { + "sort-packages": true, + "optimize-autoloader": true + }, + "scripts": { + "migrate": "php bin/migrate.php", + "seed": "php bin/seed.php", + "test": "phpunit" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..3784b97 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,17 @@ + + + + + tests + + + + + src + + +