#!/bin/bash

echo "-------------------------------------------"
echo "   Facelook Project - Lines of Code (LoC)  "
echo "-------------------------------------------"

# Backend
echo -n "Backend (Python, excluding migrations): "
find backend -name "*.py" -not -path "*/migrations/*" | xargs cat 2>/dev/null | wc -l

# Frontend
echo -n "Frontend (Vue, JS, CSS, excluding node_modules): "
find frontend \( -name "*.vue" -o -name "*.js" -o -name "*.css" \) -not -path "*/node_modules/*" -not -path "*/dist/*" | xargs cat 2>/dev/null | wc -l

echo "-------------------------------------------"
echo -n "Overall Project LoC: "
find backend frontend \( -name "*.py" -o -name "*.vue" -o -name "*.js" -o -name "*.css" \) \
    -not -path "*/node_modules/*" \
    -not -path "*/migrations/*" \
    -not -path "*/dist/*" | xargs cat 2>/dev/null | wc -l
echo "-------------------------------------------"
