Welcome to the comprehensive documentation for SocialAi - The Open Social Index & Identity Claim Network.
- Installation & Setup Guide - Complete setup instructions for development and production
- Quick Start - Get up and running in minutes
- System Requirements
- Architecture Overview - Detailed system architecture, components, and data flows
- UI/UX Specifications - User interface and user experience guidelines
- Database Schema - Database structure and relationships
- API Reference - Complete REST API documentation with examples
- Authentication - Farcaster and SIWE authentication flows
- Rate Limiting - API rate limits and best practices
- Development Guide - Development workflow and best practices
- Contributing Guidelines - How to contribute to the project
- Testing Guide - Testing strategies and commands
- Troubleshooting - Common issues and solutions
- Deployment Guide - Production deployment instructions
- Environment Configuration
- Monitoring & Logging
- Security Summary - Security vulnerabilities and remediation
- Security Best Practices
Get SocialAi running in 5 minutes:
# 1. Clone the repository
git clone https://github.com/SMSDAO/SocialAi.git
cd SocialAi
# 2. Install dependencies
npm install
# 3. Setup database
createdb socialai
psql -U postgres -d socialai -f db/schema.sql
# 4. Configure environment
cp .env.example .env
# Edit .env with your settings
# 5. Start the system
npm run dev # Backend + Workers
npm run dev:public # Public App (port 4321)
npm run dev:admin # Admin Console (port 4200)Access Points:
- π Backend API: http://localhost:3000
- π Public App: http://localhost:4321
- βοΈ Admin Console: http://localhost:4200
For detailed instructions, see INSTALLATION.md.
- Node.js: 18.x or higher
- npm: 8.x or higher
- PostgreSQL: 14.x or higher
- Git: 2.x or higher
- RAM: 4GB minimum, 8GB recommended
- Storage: 10GB minimum for database and logs
- CPU: 2 cores minimum, 4 cores recommended
- Docker: For containerized deployment
- Redis: For caching (future enhancement)
SocialAi consists of five major layers:
SEO-optimized user-facing application with:
- Profile pages
- Social timelines
- Identity claim flow
- Landing pages
Administrative console for:
- Feature flag management
- Sync controls
- Worker health monitoring
- System dashboard
Central orchestrator managing:
- Healdec auto-healing engine
- Worker management
- API gateway
- SSR rendering
- SmartBrain AI integration
Seven specialized workers:
- Farcaster Worker: Syncs Farcaster Hub data
- Reddit Worker: Syncs Reddit content
- Ethereum RPC: Ethereum blockchain interactions
- BASE RPC: BASE blockchain interactions
- Solana RPC: Solana blockchain interactions
- Search Worker: Search indexing
- AI Worker: AI processing and embeddings
Stores all application data:
- Users and profiles
- Posts (internal and external)
- Social graph (follows, likes)
- Identity claims
- AI embeddings
- System configuration
For detailed architecture information, see ARCHITECTURE.md.
Users
- Primary user accounts
- Links to Farcaster ID and Ethereum address
- ENS name mapping
Profiles
- User profile information
- Username, bio, avatar, banner
- Claim and verification status
Posts
- Internal posts created by users
- Threading support (parent_id, root_id)
- Engagement metrics
External Posts
- Posts from external sources (Farcaster, Reddit)
- Source attribution
- Sync timestamps
Follows
- Social graph connections
- Follower/following relationships
Likes
- User interactions with posts
- Supports both internal and external posts
Claims
- Identity verification records
- Farcaster and Ethereum signatures
- Verification status
Embeddings
- AI vector embeddings (1536 dimensions)
- Content representations for similarity search
- Metadata for filtering
Feature Flags
- System feature toggles
- Enable/disable functionality dynamically
Settings
- System configuration
- JSON-based flexible storage
For the complete schema, see db/schema.sql.
SocialAi supports two authentication methods:
- User initiates sign-in
- Farcaster client generates signature
- Backend verifies signature
- JWT token issued
- User authenticated
- User connects wallet
- Message generated for signing
- User signs with private key
- Backend verifies signature
- JWT token issued
- User authenticated
For implementation details, see API.md.
To ensure fair usage and system stability, the API implements rate limiting:
- Default: 100 requests per minute per IP address
- Headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset - Response: 429 status code when limit exceeded
- Configuration: Adjustable via settings table
For more information, see API.md.
Key environment variables:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/socialai
# Server
PORT=3000
NODE_ENV=development
# Feature Flags
FARCASTER_SYNC_ENABLED=true
REDDIT_SYNC_ENABLED=false
AI_SUMMARIES_ENABLED=true
# External Services
FARCASTER_HUB_URL=https://hub.farcaster.xyz
REDDIT_API_KEY=your_reddit_api_key
OPENAI_API_KEY=your_openai_api_key
# Security
JWT_SECRET=your_jwt_secret
CORS_ORIGIN=http://localhost:4321For complete environment configuration, see .env.example and INSTALLATION.md.
Monitor system health via:
- API Endpoint:
GET /health - Worker Status:
GET /api/workers/status - Admin Console: http://localhost:4200/workers
- Backend logs to stdout
- Worker logs included in backend output
- Structured logging for parsing
- Log levels: INFO, WARN, ERROR
The Healdec engine automatically:
- Monitors worker health (every 30 seconds)
- Restarts failed workers (max 3 attempts)
- Validates changes before applying
- Rolls back problematic updates
For troubleshooting, see TROUBLESHOOTING.md.
- Never commit secrets to version control
- Use
.envfiles for local configuration - Keep dependencies up to date
- Run
npm auditregularly
- Use HTTPS/TLS for all connections
- Configure strict CORS policies
- Use strong database passwords
- Rotate API keys regularly
- Enable security headers (Helmet.js)
- Monitor for suspicious activity
- Keep system updated with security patches
For detailed security information, see SECURITY.md.
docs/
βββ README.md # This file - main table of contents
βββ INSTALLATION.md # Complete setup guide
βββ ARCHITECTURE.md # System architecture
βββ UIUXSPECTS.md # UI/UX specifications
βββ API.md # API reference
βββ DEVELOPMENT.md # Development guide
βββ CONTRIBUTING.md # Contributing guidelines
βββ TESTING.md # Testing strategies
βββ TROUBLESHOOTING.md # Common issues
βββ DEPLOYMENT.md # Production deployment
Start with the documentation most relevant to your needs:
- New users: INSTALLATION.md
- Developers: DEVELOPMENT.md
- Contributors: CONTRIBUTING.md
- DevOps: DEPLOYMENT.md
- Issues: https://github.com/SMSDAO/SocialAi/issues
- Discussions: https://github.com/SMSDAO/SocialAi/discussions
MIT License - see LICENSE
Documentation Version: 1.0
Last Updated: 2026-02-07