A comprehensive social media platform designed specifically for political entities, combining Facebook-like functionality with advanced political data analytics.
This platform creates detailed profiles for political entities using data from:
- api.congress.gov - Congressional data and voting records
- govinfo.gov/api - Government information and bulk data
- openstates.org - State-level political data
- π± Mobile-responsive Facebook-like interface
- π₯ User profiles and politician profiles
- π Posts, comments, likes, and shares
- π Real-time notifications
- π° Personalized news feeds
- π³οΈ Voting record analysis and visualization
- π Bill summaries using NLP processing
- π Cosine similarity calculations between politicians
- π KPIs and statistical measures
- π·οΈ Automated bill categorization and binning
- π Automated data ingestion from government APIs
- π Comprehensive political entity profiles
- ποΈ Membership and committee data
- π Legislative history tracking
- Next.js 14 with TypeScript
- Tailwind CSS for styling
- React Query for data fetching
- Chart.js/D3.js for data visualization
- PWA capabilities for mobile experience
- Node.js with Express.js
- TypeScript for type safety
- PostgreSQL for primary database
- Redis for caching and sessions
- Bull Queue for background jobs
- Natural Language Processing for bill analysis
- Cosine similarity algorithms
- Text summarization and categorization
- Statistical analysis and KPI generation
- Docker containerization
- GitHub Actions CI/CD
- AWS/Vercel deployment
- Monitoring and logging
βββ frontend/ # Next.js React application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Next.js pages
β β βββ hooks/ # Custom React hooks
β β βββ styles/ # CSS and styling
β β βββ utils/ # Utility functions
β βββ package.json
βββ backend/ # Express.js API server
β βββ src/
β β βββ routes/ # API route handlers
β β βββ controllers/ # Business logic
β β βββ services/ # External service integrations
β β βββ models/ # Database models
β β βββ middleware/ # Express middleware
β β βββ jobs/ # Background job processors
β β βββ analytics/ # Analytics and NLP processing
β β βββ database/ # Database migrations and seeds
β βββ package.json
βββ shared/ # Shared types and utilities
βββ docs/ # Documentation
βββ docker-compose.yml # Development environment
βββ package.json # Root package.json
- Node.js 18+
- PostgreSQL 14+
- Redis 6+
- Docker (optional)
-
Clone the repository
git clone <repository-url> cd political-social-network
-
Install dependencies
npm install cd frontend && npm install cd ../backend && npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start the database
docker-compose up -d postgres redis
-
Run database migrations
cd backend npm run migrate npm run seed -
Start the development servers
# Terminal 1 - Backend cd backend && npm run dev # Terminal 2 - Frontend cd frontend && npm run dev
-
Open your browser
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Bills and resolutions
- Voting records
- Committee information
- Member data
- Federal Register documents
- Congressional documents
- Bulk data downloads
- State legislature data
- State bills and votes
- State legislator information
npm test # Run all tests
npm run test:frontend # Frontend tests only
npm run test:backend # Backend tests onlynpm run migrate # Run migrations
npm run migrate:rollback # Rollback migrations
npm run seed # Seed databasenpm run jobs:start # Start job processors
npm run jobs:dashboard # View job dashboard- Bill Summarization: Automatic extraction of key points from legislation
- Topic Classification: Categorization of bills by policy area
- Sentiment Analysis: Analysis of political statements and positions
- Voting Pattern Analysis: Compare politicians based on voting history
- Policy Position Similarity: Cosine similarity on policy stances
- Coalition Detection: Identify political alliances and opposition
- Participation Rates: Voting attendance and engagement
- Bipartisan Index: Measure of cross-party collaboration
- Influence Scores: Impact and leadership metrics
- Consistency Ratings: Alignment with stated positions
- JWT-based authentication
- Rate limiting on API endpoints
- Input validation and sanitization
- SQL injection prevention
- XSS protection
- CORS configuration
- Responsive design for all screen sizes
- Touch-friendly interface elements
- Optimized loading for mobile networks
- Progressive Web App (PWA) features
- Offline capability for core features
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- Create an issue on GitHub
- Check the documentation in
/docs - Review the API documentation at
/api/docs
Built with β€οΈ for political transparency and civic engagement