CI status
The repository includes automated audit scripts that check code quality, security vulnerabilities, and best practices.
Windows (PowerShell):
# Run full audit
.\tools\audit.ps1
# Quick audit (skip tests and detailed checks)
.\tools\audit.ps1 -Quick
# Skip tests only
.\tools\audit.ps1 -SkipTestsLinux/Mac (Bash):
# Make script executable (first time only)
chmod +x tools/audit.sh
# Run full audit
./tools/audit.shThe audit script performs the following checks:
- ESLint - Code style and syntax issues in frontend and backend
- Unit Tests - Runs test suites if configured (can skip with
-SkipTests) - NPM Audit - Scans for known vulnerabilities in dependencies
- Secret Scanner - Detects hardcoded passwords, API keys, tokens, and credentials
- Code Quality - Finds TODO comments, console.log statements, and large files
- Dependency Health - Checks for outdated packages
- Git Repository - Scans for large files and accidentally committed secrets
Audit reports are saved to logs/audit-YYYYMMDD-HHMMSS.txt with timestamped filenames.
Severity Levels:
- 🚨 CRITICAL - Hardcoded secrets or credentials (fix immediately!)
⚠️ HIGH - Potential security issues or API keys in code- ⚡ MEDIUM - Code quality issues that should be addressed
- ℹ️ INFO - Informational findings (e.g., environment variable usage)
Exit Codes:
0- No critical issues found, safe to deploy1- Issues found, review and fix before production
Common Findings:
-
"ESLint found issues"
- Review
logs/eslint-frontend.logorlogs/eslint-backend.log - Fix syntax errors, unused variables, and style violations
- Run
npm run lint -- --fixto auto-fix some issues
- Review
-
"Hardcoded credentials detected"
- 🚨 NEVER commit real passwords, API keys, or tokens!
- Move secrets to
.envfiles (already in.gitignore) - Use
process.env.VARIABLE_NAMEto access environment variables - Create
.env.examplewith placeholder values for documentation
-
"npm audit found vulnerabilities"
- Review
logs/npm-audit-frontend.jsonandlogs/npm-audit-backend.json - Run
npm audit fixto automatically update vulnerable packages - For breaking changes, run
npm audit fix --force(test thoroughly after) - Some vulnerabilities may require manual package updates
- Review
-
"Large file detected (>500 lines)"
- Consider refactoring into smaller, more maintainable modules
- Extract reusable components or utility functions
- Split business logic from UI code
-
"Found X console.log statements"
- Replace with proper logging in production code
- Use environment-based logging (e.g., only log in development)
- Consider using a logging library like Winston or Pino
Before deploying to production, ensure:
- ✅ Audit script exits with code
0(no critical issues) - ✅ All tests pass
- ✅ No CRITICAL or HIGH severity secrets found
- ✅ NPM audit shows no high/critical vulnerabilities
- ✅
.envfile exists with all required variables - ✅
.envis in.gitignore(never commit secrets!)
For enhanced security scanning, install these tools:
# Snyk (advanced vulnerability scanning)
npm install -g snyk
snyk auth # Follow prompts to authenticate
# Depcheck (find unused dependencies)
npm install -g depcheckThe audit script will automatically use these if available.
"ESLint not found"
cd frontend && npm install
cd ../backend && npm install"Permission denied" (Linux/Mac)
chmod +x tools/audit.sh"Script execution disabled" (Windows)
# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserThe audit script can be integrated into your CI/CD pipeline:
# Example GitHub Actions workflow
- name: Run Security Audit
run: |
chmod +x tools/audit.sh
./tools/audit.sh