Platform Overview
Enterprise social media automation platform โ avatar management, publishing, engagement & narrative management
Tech Stack
Runtime
.NET Framework 4.8 (C#)
Entity Framework 6 (EDMX/Database First)
Visual Studio 2019
Database
Microsoft SQL Server (local per server)
400+ tables via EF6
Windows Integrated Authentication
Automation
Selenium WebDriver 4 + Chrome
Multilogin Anti-Detect Browser
100-200 concurrent instances/server
Infrastructure
Windows Server RDS (Multi-session)
Decodo Residential Proxies
WatchDog Auto-Scaling
Supported Platforms
System Architecture
Layered architecture: Web โ API โ Business Logic โ Actions โ Data
Solution Projects (60+)
| Category | Projects | Purpose |
|---|---|---|
| Core | FBPublisherEngine, EngineController, ControllerService, EngineUpdater, FBPExecuter, ConsoleUI | Task execution & orchestration |
| Actions | FacebookActionsHandler, FacebookActionsHandlerLight | Browser automation (Selenium) |
| Business | BL (32+ classes) | Business logic for all operations |
| Data | DAL, DAL_Light, DAL_Sync | Database access (400+ entities) |
| APIs | DesocializeAPI, AnubisAPI, DevApi, AuthenticationService, MainServer, EndPointServer, WebApi | HTTP APIs |
| Web | FBPublisherWeb, WebNew, WebNewS, AnubisDash | Dashboards |
| Tools | ChromeExecuter, ImagesHandler, MetaDataHandler, TwoCaptcha, WatchDog, PingChecker, ScrapeTexts | Support tools |
| AI | AI, AITests, Sentiment (Python), PopAIClient | AI/ML integration |
| Infra | AWSS3StorageProvider, NewRelicEngine, ZohoWrapper, TelegramClient, Framework.* | Infrastructure |
Engine & Task System
Core task execution loop โ pulls tasks from queue, dispatches to handlers
Task Flow
Task Types
PostTask
Post text + images to groups/profiles. Supports retry (3 attempts), image upload, scheduled posting.
CommentTask
Comment on posts/shares with optional like. Iteration support for mass commenting. Credit system check.
GetGroupsTask
Scrape group list from an avatar account. Used for group discovery and mapping.
JoinGroupTask
Join specified Facebook groups. By URL or search-and-join.
AskFriendShipTask
Send friend requests. To specific users or from group member lists.
Engine Code Structure
Task Status Flow
Action Handlers
Selenium-based browser automation across all social networks
Inheritance
Facebook Actions (IFBAction Interface)
| Method | Description |
|---|---|
Login() | Cookie-based + credential login, handles 2FA & checkpoints |
Post() | Post text + images to groups/profiles |
Comment() / CommentByUrl() | Comment on posts, with like option |
Like() / LikesOnProfile() | Like posts and profile content |
ShareOnProfile() | Share content to profile |
JoinGroup() / JoinGroups() | Join Facebook groups |
AskFriendship() | Send friend requests (to users or group members) |
AcceptFriendship() | Accept incoming friend requests |
BeAlive() | ๐ฅ Organic activity simulation (browse, interact, look human) |
UpdateProfilePhoto() | Change avatar's profile picture |
Recover() | Attempt to recover locked/disabled account |
TakeSnapshotTask() | Screenshot monitoring |
Report() | Report content/pages |
SearchAndJoinGroups() | Search for groups by keyword and join |
ChangeFBUserLocation() | Spoof avatar's Facebook location |
GetFriends() / DeleteFreindsFromFBUser() | Friend list management |
Chrome Configuration
Data Access Layer
Entity Framework 6 with EDMX model โ 400+ entities mapped to SQL Server
Key Entity Categories
Avatar Management
- FBUsers โ Avatar accounts (credentials, proxy, email, phone, status)
- AvatarsImages โ Profile/cover photos
- Friends โ Friend lists per avatar
- FBUserGroups โ Group memberships
- AuthenticationUsers โ System auth
Campaign System
- Campaign / CampaignType โ Campaign definitions
- Tasks โ Task queue (type, status, schedule)
- Post / PostFiles โ Post content & attachments
- Comment / Likes โ Engagement actions
- BoostCampaign / Boost โ Amplification
AI System
- AIComments / AICommentsTasks โ AI-generated content
- AIGenerateImage โ AI image generation
- AIImageClassification โ Image analysis
- AICheckSentiment โ Sentiment analysis
- AIPackages โ AI credit system
Monitoring
- BeAliveParameters โ Organic activity config
- BeAliveSnapShots โ Activity screenshots
- ActionsLog โ Full audit trail
- UnlockErrorLog โ Account recovery logs
- ChangeUserLog โ Change tracking
Database
Business Logic Layer
32+ BL classes managing all platform operations
| Class | Domain | Key Operations |
|---|---|---|
BLPost | Posts | Create, schedule, mass post, task management |
BLComment | Comments | Comment campaigns, engagement tracking |
BLPM | Messages | Private/direct message campaigns |
BLGroup | Groups | Join, post, member management, alt-ID tracking |
BLBooster | Boost | Amplification campaigns |
BLLead | Leads | Lead generation & tracking |
BLUsers | Avatars | Create, update, lock/unlock, status management |
BLTask | Tasks | Queue management, proxy assignment, scheduling |
BLAI | AI | Content generation, image creation, sentiment |
BLInstagram | IG-specific operations | |
BLReddit | Reddit posting & commenting | |
BLWhatsApp | WhatsApp messaging campaigns | |
BLGoogle | Search & survey manipulation | |
BLSync | Sync | Cross-environment data synchronization |
BLDataAnalyzer | Analytics | Data analysis & reporting |
BLSearchPeople | Targeting | People search & targeting |
BLReports | Reports | Report generation |
BLGeneral | Config | GetValueByKey(), global settings |
MassPost | Mass Ops | Broadcast posting across groups/profiles |
API Layer
Multiple ASP.NET Web API endpoints serving dashboards and external integrations
DesocializeAPI
Main client-facing API โ ASP.NET Web API 2 with Swagger
Controllers
- DesocializeController โ Core operations
- AnubisController โ Anubis integration
- AvatarsCreatorController โ Avatar CRUD
- AvatarsMetaDataChangesController โ Metadata
- AIGeneretorController โ AI content
- POPAIController โ PopAI integration
- TraffiqActionsController โ Engagement
- UIController โ Dashboard data
Other APIs
- AnubisAPI โ Backend automation API
- DevApi โ Developer/integration API
- AuthenticationService โ JWT/token auth
- FacebookPublisherMainServer โ Central coordination
- FacebookPublisherEndPointServer โ Task endpoints
- FaceBookPublisherWebApi โ Web API layer
Server Infrastructure
Central server + 5 country servers โ Cloudflare DNS routing per client
High-Level Architecture
Central Server
Central Server (Master)
- Authentication โ Handles initial login for all clients
- Client Routing โ Returns LoginData with the correct server subdomain per client
- WatchDog โ Master process that monitors all country servers
- AnubisAPI (Central) โ Receives session views, aggregates status from all servers
- DNS Mapping โ Each client is mapped to their country server via Cloudflare A record (subdomain)
Note: The management dashboard (web UI) is a separate project in Git โ not part of the FacebookPublisher solution.
Country Servers
Hungary Server
Windows Server RDS โข MSSQL Local
USA Server
Windows Server RDS โข MSSQL Local
Albania Server
Windows Server RDS โข MSSQL Local
Mexico Server
Windows Server RDS โข MSSQL Local
Israel Server
Windows Server RDS โข MSSQL Local
Per Country Server Breakdown
Client โ Server Flow
Client authenticates on Central, gets routed to their country server's API via Cloudflare subdomain (A record, no proxy). All subsequent API calls go directly to the country server's IIS.
DNS Setup (Cloudflare)
WatchDog
Runs on the Central Server โ monitors and manages all engines across all country servers
What WatchDog Does
Monitoring
- TCP socket communication with all engine slaves
- Tracks CPU, Memory, Tasks (waiting/in-progress)
- Monitors locked/available/penalty avatars
- Generates JSON status for AnubisAPI dashboard
Auto-Scaling
- Opens new RDP sessions when tasks are waiting
- Uses
cmdkey+mstsc.exeto create sessions - Terminates idle sessions with
logoff.exe - Respects MaxSessionsAllowed and resource thresholds
Alerts
- Telegram notifications for session failures
- Ping timeout detection (10min / 20min / 70min tiers)
- Auto-restart crashed engines
- Tracks session live time and startup time
Session Lifecycle
Proxy & Anti-Detection
Multi-layer evasion stack to keep avatars undetected
Proxy Management
- Decodo (formerly Smartproxy) residential proxies
- NetNat residential proxy integration
- Dynamic proxy rotation with vendor tracking
- Per-avatar proxy assignment with country matching
- ProxyGatewayManager: local TCP binding (ports 20000-40000)
- Proxy health monitoring (KeepAlive)
- Auto-rotation on ERR_TUNNEL_CONNECTION_FAILED
Browser Fingerprinting
- Multilogin anti-detect browser integration
- Isolated Chrome profiles per avatar
- Timezone override via Chrome DevTools
- Cookie persistence per account
- WebRTC disabled (no IP leaks)
- Automation flags removed
Proxy Flow
ProxyGatewayManager Architecture
Account Recovery
5 automatic unlock methods for Facebook checkpoints
Version 1 โ "Get Started"
Clicks "Get Started" โ "Next" โ Chooses phone or email verification โ Enters OTP code โ "Don't remove anything" โ "Back to Facebook"
Version 2 โ "Dismiss"
Simple dismiss button click. For soft warnings that just need acknowledgment.
Version 3 โ Email Code
Clicks "Check your email" โ "Continue" โ Connects to IMAP โ Reads OTP code โ Enters code โ Continue
Version 4 โ 2FA Center
Detects 2FA security center โ Tries email path โ Falls back to phone if email unavailable
Version 5 โ Password Reset
Detects password_new field โ Generates new password โ Updates DB โ Saves changes
OTP Sources
Email (IMAP)
ImapManager connects to avatar's email โ Searches for Facebook code โ Extracts numeric OTP
Tries primary email first, falls back to OriginalEmail
Phone (SMS)
Opens new tab โ Navigates to billing.makwhiz.com/rami.php โ Enters phone number โ Reads SMS code
Uses Rami Levy phone numbers
AI Systems
AI-powered content generation, image creation, and sentiment analysis
Text Generation
RunPod OpenAI-compatible endpoint for comment generation, post writing, and narrative content
Image Generation
AI image creation for posts, profile photos, and engagement content
Sentiment Analysis
Python-based sentiment analyzer + AI check sentiment for content quality
Image Classification
Classify uploaded images for appropriateness and content type
External Services
Third-party integrations powering the platform
| Service | Purpose | Integration |
|---|---|---|
| Decodo (Smartproxy) | Residential proxy provider | ProxyGatewayManager |
| NetNat | Residential proxy (backup) | NetNatIpApi.cs |
| Multilogin | Anti-detect browser | MultiloginClient.cs |
| TwoCaptcha | CAPTCHA solving | Recaptcha2captcha.cs |
| RunPod | AI inference (OpenAI API) | RunpodOpenAIClient.cs |
| PopAI | AI content generation | POPAIHandler.cs |
| AWS S3 | File/image storage | AWSS3StorageProvider |
| New Relic | APM monitoring | NewRelicEngine |
| Telegram | Alerts & notifications | Email.TelegramSendMessage() |
| Zoho CRM | Customer management | ZohoWrapper |
| billing.makwhiz.com | SMS OTP retrieval | TryToUnLockVersion1ByPhone() |
Linux Migration Plan
Proposed migration path from Windows RDS to Linux + Xvfb
Why Migrate?
โ Current: Windows RDS
- Chrome: ~400MB RAM per instance
- RDP session overhead: ~300MB each
- 200 browsers โ 83GB RAM
- Desktop rendering (DWM) per session
- RDS CAL licensing costs
- Session startup: ~30 seconds
- Multi-session Administrator = fragile
โ Proposed: Linux + Xvfb
- Chrome: ~200-250MB RAM per instance
- Xvfb display overhead: ~5MB each
- 200 browsers โ 45GB RAM
- No desktop rendering at all
- No licensing costs
- Session startup: ~2 seconds
- Unlimited concurrent displays
Key: Xvfb โ Headless
โ ๏ธ Facebook detects headless mode (--headless flag). But Xvfb is NOT headless โ it's a full GUI rendered to virtual memory. Chrome runs in normal mode with full WebGL, Canvas, and rendering. Facebook cannot tell the difference between a real monitor and Xvfb.
Debugging with noVNC
3-Phase Plan
Phase 1 โ Remote Browsers
Effort: 1-2 days
Change: ~10-15 files
- Set up Selenium Grid on Linux servers
- Change
new ChromeDriver()โnew RemoteWebDriver() - Add config: UseRemoteDriver=true/false
- C# code stays on Windows, only browsers on Linux
- Chrome profiles via shared storage (NFS/S3)
Phase 2 โ Docker Containers
Effort: 1 week
- Docker container per avatar/session
- Each container: Chrome + Xvfb + proxy config
- Profile persistence via Docker volumes
- noVNC per container for debugging
Phase 3 โ Full Migration
Effort: Months
- Migrate C# to .NET 8 (cross-platform)
- EF6 โ EF Core (Code First)
- SQL Server โ PostgreSQL (optional)
- Full Linux-native platform
Decodo Proxy Issues
Known problems and fixes for Decodo residential proxy integration
Problem 1: Session Persistence Breaking
Sticky sessions drop because no session ID is passed in the Decodo username. Each new TCP connection through ProxyGatewayManager gets a different IP.
Fix
Problem 2: IP Whitelist + SOCKS5
IP whitelisting with sticky sessions only works with HTTPS protocol. SOCKS5 requires explicit session parameter even with whitelist.
Fix
Use HTTPS protocol for whitelisted connections, or add session parameter for SOCKS5.
Problem 3: New TCP Per Request
ProxyGatewayManager.HandleConnect() opens a fresh TCP connection to Decodo for every CONNECT request. Without session ID, each = new IP.
Fix
Implement connection pooling in ProxyGatewayManager, or ensure session parameter is always present in username.
Problem 4: Wrong Endpoint
Using country-specific endpoints like us.decodo.com doesn't work for residential SOCKS5.
Fix
Problem 5: Engine Restart = Lost Sessions
When WatchDog restarts an engine (logoff + new RDP session), the ProxyGatewayManager singleton is destroyed. All proxy bindings and Decodo session IDs are lost โ all avatars get new IPs.
Fix
Use avatar's UniqID as the Decodo session ID so it survives engine restarts. Decodo will try to give the same IP if the previous residential device is still online.