Project Overview
The BSOD AI Analyzer is an enterprise-grade application designed to diagnose Windows crash dump errors using Google's Gemini AI. It features a secure client-server architecture, with a React frontend for user interaction and an Express.js backend that proxies sensitive Gemini API calls. The application supports various crash dump formats, provides detailed analysis reports, and integrates advanced debugging capabilities. A key aspect of its design is robust security, including server-side API key protection and in-memory processing of crash dumps to ensure no sensitive data is stored.
Building and Running
This project uses Node.js and npm for dependency management and script execution.
Prerequisites:
- Node.js 18+
- Google Cloud account (for deployment)
- Gemini API key from Google AI Studio
Local Development:
-
Clone the repository:
git clone https://github.com/faratech/bsod-analyzer.git cd bsod-analyzer -
Install dependencies:
npm install
-
Set up environment: Create a
.env.localfile in the project root with your Gemini API key:GEMINI_API_KEY=your-gemini-api-keyFor additional secrets like
TURNSTILE_SECRET_KEYandSESSION_SECRET, you can add them to.env.localor set them as environment variables directly. -
Start development server:
npm run dev
This command concurrently starts both the backend (on port 8080) and the frontend development server.
Development Commands:
npm run dev: Starts both backend and frontend servers.npm run dev:backend: Starts the backend server only.npm run dev:frontend: Starts the frontend development server only.npm run build: Builds the production-ready frontend.npm start: Runs the production server.
Deployment:
The application can be deployed to Google Cloud Run. The README.md provides detailed instructions for quick deployment using deploy-with-secret.sh script, manual deployment via Docker and gcloud CLI, and CI/CD setup with Cloud Build.
Development Conventions
- Technology Stack:
- Frontend: React 19, TypeScript, Vite
- Backend: Express.js with ES modules
- AI Service: Google Gemini 3.1 Flash Lite with grounding via
@google/genaiSDK - Styling: Custom CSS
- Deployment: Docker, Google Cloud Run, Secret Manager
- Secret Management:
- Production: All secrets (e.g.,
GEMINI_API_KEY,TURNSTILE_SECRET_KEY,SESSION_SECRET) are stored in Google Secret Manager and injected as environment variables by Cloud Run. - Local Development: Secrets are managed via
.env.localfiles or direct environment variables. The.env.localfile is git-ignored and should never be committed. - Dedicated scripts (
setup-all-secrets.sh,update-turnstile-secret.sh,deploy-with-secret.sh) are provided for secret management.
- Production: All secrets (e.g.,
- Security Best Practices:
- Never commit secrets to the repository.
- Regularly rotate secrets.
- Utilize Secret Manager for production environments.
- Adhere to the principle of least privilege for secret access.
- Code Structure:
- Frontend components are located in the
components/andpages/directories. - Backend logic is primarily in
server.jsandservices/. - Utility functions are in the
utils/directory.
- Frontend components are located in the
- Testing: (No explicit testing commands or frameworks were identified in the
README.mdbeyond general development commands. Further exploration would be needed to determine specific testing conventions.)