LinkedIn Agent
Pricing
Pay per usage
LinkedIn Agent
A linkedin agent
0.0 (0)
Pricing
Pay per usage
2
Total users
3
Monthly users
3
Runs succeeded
16%
Last modified
2 days ago
π LinkedIn Agent - Clean Architecture
A production-ready LinkedIn scraping agent with a clean, organized architecture. This project has been restructured for better maintainability, scalability, and developer experience.
ποΈ Project Structure
linkedin-agent/βββ π backend/ # Core LinkedIn scraping engineβ βββ src/ # Main Python source codeβ βββ tests/ # Backend testsβ βββ requirements.txt # Python dependenciesβ βββ Dockerfile* # Backend containersβββ π frontend/ # React admin dashboardβ βββ src/ # React componentsβ βββ package.json # Frontend dependenciesβββ π infrastructure/ # Deployment & DevOpsβ βββ docker/ # Docker configurationsβ βββ scripts/ # Utility scriptsβ βββ monitoring/ # Monitoring configsβββ π docs/ # Documentationβββ π examples/ # Sample inputs & configsβββ π storage/ # Runtime data (gitignored)
π Quick Start
1. Setup Development Environment
# Clone and setupgit clone <your-repo>cd linkedin-agentmake setup-dev# Edit environment variablesnano .env # Add your API keys# Start developmentmake dev
2. Setup Production Environment
# Setup productionmake setup-prod# Edit production settingsnano .env# Deploymake deploy
β¨ Key Features
- π― Clean Architecture: Separated backend, frontend, and infrastructure
- π³ Docker-First: Multi-stage builds with development and production configs
- π Queue Processing: Redis-based job queue with worker processes
- π Security: JWT authentication and role-based access
- π Monitoring: Health checks and Prometheus integration
- πΎ Persistent Storage: SQLite database with backup automation
- π Batch Processing: Excel/CSV input with resumable processing
- π¨ Modern UI: React-based admin dashboard
π οΈ Development Commands
# Show all available commandsmake help# Backend developmentmake dev # Start backend servicesmake backend-test # Run backend testsmake backend-lint # Run backend linting# Frontend developmentmake frontend-dev # Start frontend developmentmake frontend-test # Run frontend testsmake frontend-lint # Run frontend linting# Full stack developmentmake fullstack-dev # Start both backend and frontend# Productionmake deploy # Deploy to productionmake stop # Stop all servicesmake clean # Clean up containers# Utilitiesmake status # Check service statusmake logs # View service logsmake backup # Create backupmake health # Health check
π Documentation
- PROJECT_STRUCTURE.md - Detailed structure guide
- docs/ARCHITECTURE.md - System design and components
- docs/API.md - REST API reference
- docs/DEPLOYMENT.md - Production deployment guide
- docs/DEVELOPMENT.md - Development workflow
π§ Configuration
Environment Variables
Copy the example environment file and configure:
$cp examples/env.example .env
Key variables:
OPENAI_API_KEY
- OpenAI API key for LLM featuresAPIFY_TOKEN
- Apify token for proxy and platform featuresSUPABASE_JWT_SECRET
- JWT secret for authentication
Input Formats
The system supports multiple input formats:
- JSON Input: Direct LinkedIn URLs
- CSV/Excel: Batch processing with LinkedIn URLs
- REST API: Programmatic job submission
Excel Templates
For Excel batch processing, use the provided templates:
examples/linkedin_template.xlsx
- Empty template with correct structureexamples/sample_input.xlsx
- Example data showing proper format
Excel files must have tabs named:
Company_Profiles
- For LinkedIn company pagesIndividual_Profiles
- For LinkedIn personal profiles
See docs/EXCEL_FORMAT.md
for detailed format requirements.
See examples/
directory for sample inputs.
π¦ Usage Examples
CLI Mode
cd backendpython -m src.cli ../examples/input.json
REST API
# Submit jobcurl -F "owner_email=user@example.com" \-F "input_file=@examples/input.csv" \http://localhost:8000/submit# Check statuscurl http://localhost:8000/status/1# Download resultscurl -OJ http://localhost:8000/result/1
Batch Processing
cd backend# Enhanced processor with multi-tab support and URL validation./src/batch_scrape_excel_enhanced.sh ../examples/sample_input.xlsx ../examples/input.json# Legacy processor (single sheet only)./src/batch_scrape_excel.sh ../examples/sample_input.xlsx ../examples/input.json
ποΈ Architecture Overview
Backend Components
- API Server: FastAPI REST API for job management
- Worker: Queue processing with Redis
- Crawler: Playwright-based LinkedIn scraping
- Database: SQLite for job persistence
- Agent: LLM orchestration for summarization
Frontend Components
- Admin Dashboard: React-based management interface
- Authentication: Supabase-based auth with role management
- Real-time Updates: WebSocket integration for job status
Infrastructure
- Docker: Multi-stage builds for development and production
- Monitoring: Prometheus and health checks
- Backup: Automated backup system
- CI/CD: Ready for pipeline integration
π Security
- Authentication: JWT-based authentication with Supabase
- Authorization: Role-based access control (admin/user)
- Input Validation: Comprehensive input sanitization
- Container Security: Non-root user execution
- Network Security: Internal service communication
π Monitoring & Health
Health Endpoints
/health
- Full system health check/health/simple
- Simple health check/health/ready
- Kubernetes readiness probe/health/live
- Kubernetes liveness probe
Monitoring
- Prometheus: Metrics collection
- Grafana: Dashboard (optional)
- Logs: Structured logging with rotation
π Deployment
Development
make setup-devmake dev
Production
make setup-prodmake deploy
Docker Compose
# Developmentcd infrastructure/dockerdocker-compose up -d# Productiondocker-compose -f docker-compose.prod.yml up -d
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Development Workflow
# Setup development environmentmake setup-dev# Make changes in backend/src/ or frontend/src/# Test your changesmake backend-testmake frontend-test# Format codemake backend-lintmake frontend-lint# Commit and pushgit add .git commit -m "feat: your feature description"git push origin feature/your-feature
π License
MIT License - see LICENSE file for details.
π Support
- Documentation: Check the
docs/
directory - Examples: See
examples/
directory for usage examples - Issues: Report bugs and feature requests via GitHub issues
π Welcome to the clean, organized LinkedIn Agent!
This restructured project makes development, deployment, and maintenance much easier. The separation of concerns and clear documentation will help you get up and running quickly.