DarkGravity is a sophisticated, end-to-end horror story ecosystem. It crawls the dark corners of the web (Reddit, YouTube), uses a multi-provider AI engine to analyze the "scary score" and hidden patterns of stories, and presents them through a premium, immersive "Dark Mode" web interface.
The repository is organized into a modular, decoupled architecture following SOLID principles and Clean Architecture patterns:
src/Crawler: A .NET Console application that acts as the "Ingestion Engine". It fetches stories from multiple subreddits (r/nosleep, r/shortscarystories) and YouTube transcripts. It saves raw data to the database, leaving analysis for the next stage.src/Analyzer: A dedicated AI processing project. It scans the database for pending stories, runs them through the multi-provider AI failover engine, and updates the "Scary Scores" and analysis.src/Api: An ASP.NET Core Web API that serves the analyzed stories to the frontend via RESTful endpoints.src/Shared: A Class Library containing shared Domain Models (Story) and the Entity Framework CoreAppDbContext. This ensures high cohesion and low coupling across the system.src/Web: A high-end Angular 18+ application featuring glassmorphism, fluid animations, and a premium "void" aesthetic.infra/: Docker configuration for local infrastructure (SQL Server).
- Multi-Source Ingestion: Automated crawling logic for Reddit JSON APIs and YouTube transcripts.
- "Socrates" AI Engine: Integrated with Google Gemini, OpenAI (GPT-4o), DeepSeek, and Mistral via a failover strategy to ensure constant analysis availability. (See
StoryAnalyzer.cs) - Automated Scoring: AI-generated "Scary Scores" and qualitative analysis stored alongside raw story data for complex querying and sorting.
- Premium Viewing Experience: Responsive "Reader Mode" with optimized typography for maximum immersion.
- Dockerized Infrastructure: One-command setup for the local SQL Server database.
- Backend: .NET 8, C#, EF Core (SQL Server).
- Frontend: Angular 18+, Vanilla CSS (Glassmorphism), Google Fonts (Orbitron/Inter).
- AI: Semantic Kernel, Multi-LLM provider integration with automatic failover.
- Infra: Docker, User Secrets Management.
- .NET 8.0 SDK
- Docker Desktop
- Node.js / npm (for the Angular frontend)
Spin up the SQL Server database:
docker compose -f infra/docker-compose.yml up -dEnsure you have the required AI API keys and database credentials set up using .NET User Secrets. This keeps sensitive data out of the repository. See Docs: Secrets Management for detailed instructions.
# Set AI Keys (Move to Analyzer project)
dotnet user-secrets set "GEMINI_API_KEY" "your_key" --project src/Analyzer
# Set Database Password (Namespaced)
dotnet user-secrets set "DARKGRAVITY_DB_PASSWORD" 'your_strong_password_here' --project src/Api
dotnet user-secrets set "DARKGRAVITY_DB_PASSWORD" 'your_strong_password_here' --project src/Analyzer
# View all configured secrets
dotnet user-secrets list --project src/Analyzer
dotnet user-secrets list --project src/Api- Populate the database:
dotnet run --project src/Crawler
- Analyze the stories (AI Processing):
dotnet run --project src/Analyzer
- Start the API:
dotnet run --project src/Api
- Start the Web UI:
cd src/Web && npm install && npm start
To generate merged HTML reports for the backend, install the ReportGenerator tool:
dotnet tool install -g dotnet-reportgenerator-globaltoolRun unit and integration tests and collect coverage:
# Run tests and collect data
dotnet test --collect:"XPlat Code Coverage"
# Generate human-readable HTML report
reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html
# View report (MacOS)
open coveragereport/index.htmlRun component/service tests and generate coverage:
cd src/Web
# Run tests once with coverage
npm test -- --coverage --watch=false
# View report (MacOS)
open coverage/index.html- Implementation Plan - The roadmap of the project.
- Secrets Management Guide - How to configure API keys.
Generated by Antigravity.