# =============================================================
#  Civitas ERP — .gitignore
#  Covers: local dev, build artifacts, deployment secrets
# =============================================================

# ---- Environment / secrets ----
#   Track ONLY the template.  The real .env and .env.production are NEVER
#   committed — they live on the server and contain rotated credentials.
.env
.env.*
.env.production
.env.production.bak.*
!.env.example
!.env.production.template

# ---- Composer ----
/vendor/
composer.phar
composer.phar.bak

# ---- Node / build tools (not used today, but keep for future) ----
/node_modules/
/package-lock.json
/yarn.lock

# ---- CodeIgniter writable/runtime ----
/writable/cache/*
!/writable/cache/index.html
/writable/logs/*
!/writable/logs/index.html
/writable/session/*
!/writable/session/index.html
/writable/debugbar/*
!/writable/debugbar/index.html
/writable/uploads/*
!/writable/uploads/index.html
/writable/backups/*
!/writable/backups/index.html

# ---- Local-only tooling / debug helpers ----
# (All these _*  /  check_*  /  fix_*  /  scan_*  /  seed_*  /  smoke_*
#  /  tmp_*  /  test_*  /  u_cols  /  v*schema  /  phase*_*  scripts
#  are development-only and must NOT be deployed.)
/_check_*.php
/_fix_*.php
/_fix_*.py
/_p[0-9]*.php
/_p[0-9]*schema*.php
/_p[0-9]check*.php
/_phase*.php
/_phase*.sql
/_register_migrations.php
/_run_*.php
/_scan_*.php
/_seed_*.php
/_seed_*.sql
/_smoke*.php
/_smoke*.ps1
/_test_*.php
/_tmp_*.php
/_tmp_*.txt
/_token_test.php
/_u_cols.php
/_users_cols.txt
/_v[0-9]*schema*.php
/_v[0-9]*cols*.php
/_v[0-9]_migration_*.php
/_inspection_engine_analysis.md
/_drop_all_tables.sql
/_create_*.sql

/check_*.php
/fix_*.php
/fix_*.py
/scan_*.php
/seed_*.php
/seed_*.sql
/seed_*.txt
/smoke_*.php
/smoke_*.ps1
/test_*.php
/tmp_*.php
/tmp_*.txt
/token_test.php
/u_cols.php
/users_cols.txt
/v[0-9]*schema*.php
/v[0-9]*cols*.php
/v[0-9]_migration_*.php
/phase[0-9]*_*.php
/0
/_archive/
/build/
/dist/
/database/
/docs/
/css/
/js/
/memories/

# ---- Root .sql files (any name) ----
# These are one-off migration / seed / fix scripts that must NEVER be
# included in a production deploy.  Use spark migrate + db:seed instead.
*.sql
!app/Database/Migrations/*.sql
!app/Database/Seeds/*.sql
!deployment/fix-approval-fk.sql

# ---- Root .md design docs ----
# All the *_BLUEPRINT*.md / *ANALYSIS*.md / *ARCHITECTURE*.md at root
# are internal design docs and must NOT be deployed.
_*.md

# ---- Root index.php dev bypass ----
# Temporary bypass to public/index.php for local testing only.
# Production vhost always points at public/, not this file.
index.php

# ---- P0 backup directory (added 7 July 2026) ----
/.p0-backup/

# ---- Test / dev HTML pages ----
/basic_test.html
/migration_dashboard.html
/module10_dashboard.html
/project_status.html
/sidebar-demo.html
/public/test_icons.html
/public/_assets_static/

# ---- IDE / OS ----
/.idea/
/.vscode/
/.DS_Store
/Thumbs.db
*.swp
*~
/.php-cs-fixer.cache
/.php-cs-fixer.php
/.phpunit.result.cache

# ---- Logs (project root) ----
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# ---- Tests (excluded from prod build) ----
/tests/coverage/
/phpunit.xml

# ---- Spark (CodeIgniter CLI) ----
# keep spark — it is shipped with the framework
