#!/bin/bash

echo "========================================="
echo "DOOCTOR.ONLINE FULL PROJECT AUDIT"
echo "========================================="

echo
echo "SERVER"
echo "-----------------------------------------"
hostname
whoami
pwd

echo
echo "PHP"
echo "-----------------------------------------"
php -v

echo
echo "COMPOSER"
echo "-----------------------------------------"
composer --version 2>/dev/null

echo
echo "NODE"
echo "-----------------------------------------"
node -v 2>/dev/null

echo
echo "NPM"
echo "-----------------------------------------"
npm -v 2>/dev/null

echo
echo "LARAVEL"
echo "-----------------------------------------"
php artisan --version 2>/dev/null

echo
echo "ROOT FILES"
echo "-----------------------------------------"
ls -lah

echo
echo "DIRECTORIES"
echo "-----------------------------------------"
find . -maxdepth 2 -type d | sort

echo
echo "CSS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.css"

echo
echo "SCSS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.scss"

echo
echo "SASS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.sass"

echo
echo "LESS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.less"

echo
echo "JS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.js"

echo
echo "TS FILES"
echo "-----------------------------------------"
find . -type f -iname "*.ts"

echo
echo "VUE FILES"
echo "-----------------------------------------"
find . -type f -iname "*.vue"

echo
echo "REACT FILES"
echo "-----------------------------------------"
find . -type f \( -iname "*.jsx" -o -iname "*.tsx" \)

echo
echo "BLADE FILES"
echo "-----------------------------------------"
find . -type f -iname "*.blade.php"

echo
echo "PHP FILES"
echo "-----------------------------------------"
find . -type f -iname "*.php"

echo
echo "PUBLIC ASSETS"
echo "-----------------------------------------"
find public -maxdepth 3 -type d 2>/dev/null

echo
echo "RESOURCES"
echo "-----------------------------------------"
find resources -maxdepth 4 -type d 2>/dev/null

echo
echo "ROUTES"
echo "-----------------------------------------"
find routes -type f 2>/dev/null

echo
echo "CONTROLLERS"
echo "-----------------------------------------"
find app/Http/Controllers -type f 2>/dev/null

echo
echo "MODELS"
echo "-----------------------------------------"
find app/Models -type f 2>/dev/null

echo
echo "MIDDLEWARE"
echo "-----------------------------------------"
find app/Http/Middleware -type f 2>/dev/null

echo
echo "MIGRATIONS"
echo "-----------------------------------------"
find database/migrations -type f 2>/dev/null

echo
echo "CONFIG"
echo "-----------------------------------------"
find config -type f 2>/dev/null

echo
echo "ENV VARIABLES"
echo "-----------------------------------------"
grep "APP_NAME" .env 2>/dev/null
grep "APP_ENV" .env 2>/dev/null
grep "APP_DEBUG" .env 2>/dev/null

echo
echo "PACKAGE.JSON"
echo "-----------------------------------------"
cat package.json 2>/dev/null

echo
echo "COMPOSER.JSON"
echo "-----------------------------------------"
cat composer.json 2>/dev/null

echo
echo "FINISHED"
