A powerful web application built with .NET 10 that analyzes your social media posts in real-time, suggesting the top trending hashtags to maximize post reach and engagement. Perfect for influencers and marketers who want to stay ahead of the trend curve.
- π€ AI-Powered Analysis: Uses OpenRouter AI to analyze post content and generate relevant hashtags
- π± Multi-Platform Support: Works with LinkedIn, Twitter/X, and general web content
- π Secure: Implements SSRF protection, input sanitization, and secure API key handling
- β‘ High Performance: Built with ASP.NET Core and Blazor for optimal performance
- π³ Docker Support: Fully containerized for easy deployment
- π§ͺ Tested: Comprehensive unit tests with xUnit
- π CI/CD Ready: GitHub Actions workflow for automated testing and deployment
- Backend: ASP.NET Core 10 Web API
- Frontend: Blazor Web App (Server-Side Rendering)
- AI Integration: OpenAI SDK with OpenRouter
- Web Scraping: Playwright for .NET
- Testing: xUnit with Moq
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions
PulseTag/
βββ src/
β βββ PulseTag.Api/ # Web API
β βββ PulseTag.Web/ # Blazor Frontend
β βββ PulseTag.Shared/ # Shared Models
βββ tests/
β βββ PulseTag.Api.Tests/ # Unit Tests
βββ .github/workflows/ # CI/CD Pipelines
βββ docker-compose.yml # Docker Compose Configuration
βββ PulseTag.sln # Solution File
- .NET 10.0 SDK
- Docker (optional)
- OpenRouter API Key (free at openrouter.ai)
-
Clone the repository
git clone https://github.com/bradmca/pulse-tag-c-sharp.git cd pulse-tag -
Set up configuration
Create
src/PulseTag.Api/appsettings.Development.json:{ "OpenRouter": { "ApiKey": "your-openrouter-api-key", "Model": "microsoft/phi-3-medium-128k-instruct:free" }, "LinkedIn": { "Cookies": "your-linkedin-cookies-optional" } } -
Run the solution
# Run both API and Web dotnet run --project src/PulseTag.Api dotnet run --project src/PulseTag.Web -
Access the applications
For Docker deployment:
- Frontend: http://localhost:3000
- API: http://localhost:8000
- API Documentation: http://localhost:8000/swagger
For local development:
- Frontend: https://localhost:5001
- API: https://localhost:8000
- API Documentation: https://localhost:8000/swagger
-
Using Docker Compose
# Create .env file with your configuration cp .env.example .env # Edit .env with your API keys # Run with Docker Compose docker-compose up -d
-
Access the applications
- Frontend: http://localhost:3000
- API: http://localhost:8000
POST /api/analyze
Content-Type: application/json
{
"url": "https://linkedin.com/posts/example"
}Response:
{
"originalText": "Your post content...",
"hashtags": {
"safe": ["Marketing", "Business"],
"rising": ["GrowthHacking", "GenAI"],
"niche": ["B2BMarketingTips"]
}
}GET /api/health| Variable | Description | Default |
|---|---|---|
OpenRouter__ApiKey |
OpenRouter API key | Required |
OpenRouter__Model |
AI model to use | microsoft/phi-3-medium-128k-instruct:free |
LinkedIn__Cookies |
LinkedIn cookies for authenticated access | Optional |
AllowedOrigins |
CORS allowed origins | http://localhost:3000 |
ApiBaseUrl |
API base URL for frontend | http://localhost:8000 |
- LinkedIn: Works with public posts. Use cookies for private posts.
- Twitter/X: Requires individual tweet URLs (must contain
/status/). - General Websites: Can extract content from most web pages.
Run the test suite:
# Run all tests
dotnet test
# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"-
Environment Setup
# Create production settings cp src/PulseTag.Api/appsettings.json src/PulseTag.Api/appsettings.Production.json # Update with production values
-
Docker Deployment
# Build and deploy docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d -
Kubernetes
# Apply Kubernetes manifests kubectl apply -f k8s/
- SSRF Protection: URL validation to only allow approved domains
- Input Sanitization: Prevents prompt injection attacks
- Secure Headers: CORS, CSP, and other security headers
- Rate Limiting: Built-in rate limiting capabilities
- No Hardcoded Secrets: All secrets via environment variables
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request at https://github.com/bradmca/pulse-tag-c-sharp
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenRouter for providing free AI model access
- Playwright for reliable web scraping
- Blazor for the modern web framework
- .NET for the powerful runtime
If you have any questions or issues, please open an issue on GitHub.
β If this project helps you, please give it a star!