A modern web application built with React and Python backend for AI-powered community engagement, featuring real-time sentiment analysis, interactive polls, intelligent chat capabilities, and a comprehensive currency points system with transaction management tools.
DecentAI is a comprehensive platform that leverages artificial intelligence to facilitate meaningful community interactions and policy discussions. The platform combines advanced NLP capabilities with modern web technologies to provide real-time sentiment analysis, interactive polling systems, AI-powered chat functionality, a robust currency points system with secure transactions, and comprehensive administrative controls.
Here's a full demonstration of DecentAI showcasing all key features:
Click the link above to download and watch the complete demonstration of DecentAI's features, including:
- 💰 Currency points system with transaction management
- 🤖 AI-powered sentiment analysis and chat
- 📊 Interactive polls and data analytics
- 👑 Administrative controls and user management
- 🎨 Modern responsive UI/UX
Note: The video file is included in the repository. Click the link above to download and play it locally.
- Points Transfer: Secure point transfers between users with username-based lookup
- Transaction History: Complete transaction history with sent/received indicators
- Real-time Balance Updates: Automatic balance synchronization across all components
- Color-coded Transactions: Green for received points, red for sent points
- Transaction Analytics: Visual graphs showing balance trends over time
- Smart Validation: Prevents self-transfers and insufficient balance errors
- Intelligent Chat: AI-powered conversations using Google's Gemini API
- Real-time Sentiment Analysis: Advanced NLP for text sentiment analysis
- Overall Sentiment Summaries: AI-generated comprehensive summaries of:
- All chat conversations sentiment trends
- Polls and voting pattern analysis
- Content Analysis: Automated content moderation and trend detection
- Interactive Polls: Create and participate in polls with real-time voting
- Advanced Search: Search functionality across all data tables
- Data Analytics Dashboard: Comprehensive analytics with user insights
- Real-time Updates: Live data synchronization across components
- Transaction Trends: Visual graphs showing spending/receiving patterns
- JWT-based Authentication: Secure user authentication system
- Protected Routes: Role-based access control
- Secure Data Storage: MongoDB with proper data validation
- Session Management: Secure session handling with Flask
- User Management: Complete user lifecycle management with cascading deletes
- Admin Request System: Process admin access requests with approval/rejection workflow
- Content Moderation: Delete individual admin requests, polls, and chat messages
- System Cleanup: Clear all chat messages and manage platform content
- Audit Trail: Track all administrative actions and changes
- Responsive Design: Mobile-first approach with Tailwind CSS
- Custom Modal System: Professional confirmation dialogs replacing browser alerts
- Enhanced Notifications: Color-coded success (green) and error (red) messages
- Accessibility: WCAG compliant design with proper form attributes
- Dark/Light Theme Support: Modern design system
- React 18 - Modern JavaScript library for building user interfaces
- Tailwind CSS - Utility-first CSS framework
- React Router - Declarative routing for React
- Recharts - Composable charting library
- HeroIcons - Beautiful hand-crafted SVG icons
- Custom Modal System - Professional confirmation dialogs
- Google Generative AI - AI-powered content generation
- Python Flask - Lightweight WSGI web application framework
- MongoDB - NoSQL database for flexible data storage
- JWT Authentication - JSON Web Tokens for secure authentication
- CORS - Cross-Origin Resource Sharing support
- Wink NLP - Natural Language Processing library
- npm/yarn - Package management
- Git - Version control
- ESLint - Code linting
- Virtual Environment - Python dependency isolation
- Username-based Transfers: Transfer points using usernames instead of complex IDs
- Transaction History: Complete history with sent/received indicators and timestamps
- Color-coded Transactions: Green for received (+), red for sent (-) transactions
- Real-time Balance Updates: Automatic balance synchronization across Dashboard and Points pages
- Transaction Analytics Graph: Visual representation of balance trends over time
- Smart Validation: Prevents self-transfers and validates sufficient balance
- Scrollable History: Optimized scrolling with proper spacing and visual gaps
- Transaction Trend Graphs: Visual charts showing transaction patterns over time
- Chronological Sorting: Graphs progress from oldest to newest dates for better analysis
- User Registration Trends: Visual representation of user growth over time
- Interactive Charts: Hover tooltips and responsive design using Recharts
- Real-time Data Updates: Live synchronization of analytics data
- Polls Search: Search through poll titles and options with real-time filtering
- Data Analytics Search: Search across users, chats, and transactions tables
- Smart Filtering: Case-insensitive search with instant results
- No Results Handling: User-friendly messages when no matches found
- Individual Text Analysis: Real-time sentiment analysis using Wink NLP
- AI-Powered Summaries: Gemini API integration for comprehensive sentiment analysis
- Chat Sentiment Summary: Overall sentiment analysis of all chat conversations
- Polls Sentiment Summary: Voting pattern and sentiment analysis of all polls
- Analysis History: Persistent storage and display of analysis results
- Poll Creation: Create polls with multiple options
- Real-time Voting: Live voting with duplicate prevention
- Vote Tracking: Secure voter tracking system
- Results Visualization: Dynamic percentage bars and vote counts
- Search Integration: Search through polls and their options
- User Lifecycle Management: Complete user management with cascading data deletion
- Admin Request Processing: Approve, reject, or delete individual admin requests
- Content Moderation: Delete polls, users, and manage platform content
- Chat Management: Clear all chat messages for system maintenance
- Audit & Control: Comprehensive admin tools for platform management
- Professional Modals: Custom confirmation dialogs replacing browser alerts
- Color-Coded Notifications: Green for success, red for errors
- Accessibility Compliance: WCAG compliant with proper form attributes
- Enhanced UX: Better user experience with modern dialog design
- Keyboard Navigation: Full keyboard support and screen reader compatibility
- Cascading Deletes: Automatic cleanup of all related user data
- Secure Deletions: Confirmation dialogs prevent accidental data loss
- Audit Trail: Track all administrative actions
- Data Validation: Comprehensive input validation and sanitization
- Gemini AI Integration: Powered by Google's Gemini 1.5 Flash model
- Contextual Conversations: Maintains conversation history
- Voice Input: Speech recognition for hands-free interaction
- Text-to-Speech: Audio output for chat responses
- Real-time Responses: Instant AI-generated responses
- Comprehensive Overview: Users, chats, polls, and transactions analytics
- Interactive Charts: Visual data representation using Recharts
- Search Integration: Search across all data tables
- Real-time Updates: Live data synchronization
- Export Ready: Structured data for further analysis
- JWT Authentication: Secure token-based authentication
- Protected Routes: Role-based access control
- Session Management: Secure session handling
- Data Validation: Input validation and sanitization
- MongoDB Security: Secure database connections
- Modern Design: Clean, intuitive interface with Tailwind CSS
- Responsive Layout: Mobile-first design approach
- Interactive Elements: Smooth animations and hover effects
- Loading States: User feedback during data operations
- Error Handling: Comprehensive error messages and recovery options
- Node.js (v18 or higher)
- Python 3.8+
- MongoDB (local installation or cloud service like MongoDB Atlas)
- npm or yarn package manager
- Git for version control
git clone https://github.com/NafisRayan/DecentAI.git
cd DecentAI
# Install frontend dependencies
npm install
# Start development server
npm start
The frontend will be available at http://localhost:3000
# Navigate to Backend directory
cd Backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\Activate.ps1
# Install Python packages
pip install -r requirements.txt
cd .\Backend\;venv\Scripts\Activate.ps1;python app.py
-
Option A: Local MongoDB
- Install MongoDB Community Server
- Start MongoDB service
- Default connection:
mongodb://localhost:27017
-
Option B: MongoDB Atlas (Cloud)
- Create account at mongodb.com
- Create a cluster
- Get connection string and update in
app.py
Create a .env
file in the Backend directory (optional):
MONGODB_URI=mongodb://localhost:27017
JWT_SECRET=your-secret-key
# From Backend directory with virtual environment activated
python app.py
The backend will run on http://localhost:5000
-
Start Backend First:
cd Backend venv\Scripts\Activate.ps1 python app.py
-
Start Frontend:
# In a new terminal npm start
-
Access the Application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
DecentAI/
├── public/ # Static assets
│ ├── dai1.png # Screenshots
│ ├── dai2.png
│ ├── dai3.png
│ ├── dai4.png
│ └── favicon.ico
├── src/ # Frontend React application
│ ├── components/ # Reusable UI components
│ │ ├── Layout/ # Layout components
│ │ │ ├── Layout.jsx
│ │ │ ├── Sidebar.jsx
│ │ └── ui/ # UI components
│ │ └── Modal.jsx # Custom modal system
│ ├── contexts/ # React contexts
│ │ ├── AuthContext.jsx
│ │ └── model_artifacts.json
│ ├── pages/ # Main application pages
│ │ ├── AIChat.jsx # AI chat interface
│ │ ├── Chat.jsx # Chat functionality
│ │ ├── Dashboard.jsx # Main dashboard with transaction history
│ │ ├── DataAnalytics.jsx # Analytics dashboard with transaction graphs
│ │ ├── LoginRegister.jsx # Authentication
│ │ ├── Points.jsx # Currency points system with transfer functionality
│ │ ├── Polls.jsx # Polling system
│ │ ├── SentimentAnalysis.jsx # Sentiment analysis
│ │ └── UserSettings.jsx # User settings & admin panel
│ ├── App.jsx # Main app component
│ ├── index.js # App entry point
│ └── setupTests.js # Test setup
├── Backend/ # Python Flask backend
│ ├── app.py # Main Flask application with admin endpoints
│ ├── requirements.txt # Python dependencies
│ ├── test_backend.py # Backend tests
│ └── venv/ # Virtual environment
├── package.json # Node.js dependencies
├── tailwind.config.js # Tailwind CSS configuration
└── README.md # Project documentation
- Username-based Transfers: Simplified point transfers using usernames instead of user IDs
- Real-time Balance Updates: Automatic balance synchronization across all components
- Transaction Validation: Smart validation preventing self-transfers and insufficient balance
- Color-coded History: Green for received points, red for sent points with +/- indicators
- Transaction Analytics: Visual graphs showing balance trends and transaction patterns
- Transaction Trends Graph: Interactive line chart showing balance changes over time
- Chronological Graph Sorting: X-axis progresses from oldest to newest dates
- Responsive Charts: Mobile-friendly charts with hover tooltips and detailed information
- Real-time Data Updates: Live synchronization of transaction and analytics data
- Scrollable Transaction Cards: Optimized scrolling with proper height management
- Visual Spacing: Added gaps between transaction amounts and scrollbars for better readability
- Consistent Card Heights: Balanced card heights across Dashboard and Points pages
- Enhanced Transaction Display: Improved layout with better visual hierarchy
- Transaction Processing: Robust transaction handling with proper error management
- Data Integrity: Cascading updates ensuring data consistency across components
- API Optimization: Efficient data fetching and real-time updates
- Security Improvements: Enhanced validation and secure transaction processing
- Custom Modal System: Replaced browser
window.confirm()
with professional, accessible modal dialogs - Enhanced Notifications: Color-coded success (green) and error (red) messages throughout the app
- Accessibility Compliance: Fixed form attributes, added proper ARIA labels, and improved keyboard navigation
- Responsive Design: Improved mobile experience and cross-device compatibility
- Cascading User Deletion: Complete data cleanup when deleting users (removes transactions, chats, polls, admin requests, analysis history)
- Individual Admin Request Management: Delete specific admin requests with confirmation dialogs
- Chat Management: Admin-only feature to clear all chat messages for system maintenance
- Enhanced Admin Panel: Improved user management interface with better search and filtering
- New API Endpoints: Added comprehensive admin operations endpoints
- Data Integrity: Cascading delete operations ensure no orphaned data
- Error Handling: Enhanced error responses and validation
- Security: Improved data validation and secure deletion operations
- Modal Component Library: Reusable modal system for consistent user interactions
- State Management: Improved state handling for admin operations
- Real-time Updates: Automatic data refresh after admin operations
- Loading States: Better user feedback during operations
- React 18 - Modern JavaScript library for building user interfaces
- Tailwind CSS - Utility-first CSS framework for rapid UI development
- React Router - Declarative routing for React applications
- Recharts - Composable charting library built on React components
- HeroIcons - Beautiful hand-crafted SVG icons
- Google Generative AI - AI-powered content generation and analysis
- Python Flask - Lightweight WSGI web application framework
- MongoDB - NoSQL database for flexible data storage
- PyMongo - Python driver for MongoDB
- JWT - JSON Web Tokens for secure authentication
- Flask-CORS - Cross-Origin Resource Sharing for Flask
- Wink NLP - Natural Language Processing library
- npm - Package manager for Node.js
- Git - Distributed version control system
- ESLint - Tool for identifying and reporting patterns in ECMAScript/JavaScript code
- Python venv - Virtual environment for Python
POST /auth/register
- User registrationPOST /auth/login
- User loginPOST /auth/logout
- User logout
GET /users
- Get all usersGET /chats
- Get all chat messagesPOST /chats
- Send chat messageGET /polls
- Get all pollsPOST /polls
- Create new pollPOST /polls/<poll_id>/vote
- Vote on a pollGET /transactions
- Get user transactions with username resolutionPOST /transactions
- Create new transaction (point transfer)GET /analytics/transactions
- Get transaction analytics data
GET /admin-requests
- Get all admin requestsPOST /admin-requests
- Submit admin requestPOST /admin-requests/<request_id>/approve
- Approve admin requestPOST /admin-requests/<request_id>/reject
- Reject admin requestDELETE /admin/delete-admin-request/<request_id>
- Delete admin requestDELETE /admin/delete-user/<user_id>
- Delete user (with cascading cleanup)DELETE /admin/delete-poll/<poll_id>
- Delete pollDELETE /admin/clear-chats
- Clear all chat messages
GET /analysis-history
- Get sentiment analysis historyPOST /analysis-history
- Save analysis resultDELETE /analysis-history
- Clear analysis history
# Build the production version
npm run build
# The build artifacts will be stored in the `build/` directory
# Set environment variables
export MONGODB_URI="your-mongodb-connection-string"
export JWT_SECRET="your-jwt-secret"
# Run with production WSGI server
gunicorn --bind 0.0.0.0:5000 app:app
- Google Generative AI for providing powerful AI capabilities
- The React and Flask communities for excellent documentation and support
- MongoDB for reliable database solutions and comprehensive documentation
- Tailwind CSS for beautiful, responsive design utilities
- HeroIcons for consistent and professional iconography
- Open source contributors for accessibility tools and best practices
- Web accessibility community for WCAG guidelines and inclusive design principles
- ✅ Points Transfer System: Username-based point transfers with real-time validation
- ✅ Transaction History: Complete transaction tracking with sent/received indicators
- ✅ Color-coded Transactions: Green for received (+), red for sent (-) transactions
- ✅ Transaction Analytics Graph: Visual balance trends and transaction patterns
- ✅ Scrollable UI: Optimized scrolling with proper spacing and visual gaps
- ✅ Chronological Graphs: X-axis progresses from oldest to newest dates
- ✅ Real-time Updates: Automatic balance synchronization across components
- ✅ Enhanced UX: Improved transaction display and visual hierarchy
- ✅ Custom Modal System: Professional confirmation dialogs
- ✅ Enhanced Admin Panel: Complete user and content management
- ✅ Cascading Deletes: Comprehensive data cleanup operations
- ✅ Accessibility Compliance: WCAG compliant form attributes
- ✅ Color-coded Notifications: Green success, red error messages
- ✅ Admin Request Management: Individual request deletion
- ✅ Chat Management: Admin-only chat clearing functionality
- ✅ Initial release with AI chat, sentiment analysis, and polling
- ✅ Basic user authentication and dashboard
- ✅ Real-time data visualization and analytics
DecentAI - Empowering communities through AI-driven engagement, intelligent analysis, and comprehensive administrative controls.