AI-Powered Diagram Builder
A collaborative whiteboard application with AI-powered diagram generation using voice and text commands.
Features
- 🎤 Voice Commands: Record audio to create diagrams with natural language
- 💬 Text Prompts: Type requests to generate and modify diagrams
- 👥 Real-time Collaboration: Multiple users can edit whiteboards simultaneously
- 🔐 Authentication: Secure user management with AWS Cognito
- 🤖 AI Integration: Powered by Google Gemini AI for intelligent diagram generation
- 📱 Responsive Design: Works on desktop and mobile devices
Architecture
- Frontend: React with ReactFlow for diagram editing
- Backend: AWS Amplify Gen 2 (Lambda functions, DynamoDB, Cognito)
- AI: Google Gemini 2.0 Flash for multimodal processing
- Storage: DynamoDB for whiteboards, S3 for file storage
- Real-time: GraphQL subscriptions for live collaboration
Quick Start
Prerequisites
- Node.js 18+
- AWS Account
- Google AI Studio API Key
Local Development
-
Clone the repository
git clone <your-repo-url> cd sematic -
Install dependencies
npm install cd frontend && npm install -
Set up environment variables
# Create .env file in project root GEMINI_API_KEY=your_gemini_api_key_here -
Run locally
# Start frontend cd frontend && npm start # The app will run in local mode with simulation
Production Deployment
-
Configure AWS credentials
aws configure # Or use AWS environment variables -
Set Gemini API key
export GEMINI_API_KEY="your_gemini_api_key_here" -
Deploy to AWS
npx ampx sandbox --once # For permanent deployment: # npx ampx generate --out deployment -
Access your app
- The deployment will provide a CloudFront URL
- Amplify will automatically configure authentication and API endpoints
Environment Configuration
The app automatically switches between local and production modes:
- Local Mode: Uses localStorage, simulation AI, mock authentication
- Production Mode: Uses AWS services, real Gemini AI, Cognito authentication
No code changes needed - the same codebase works in both environments!
Project Structure
├── amplify/ # AWS Amplify configuration
│ ├── auth/ # Cognito authentication
│ ├── data/ # DynamoDB schema
│ ├── functions/ # Lambda functions
│ └── storage/ # S3 configuration
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ └── ...
│ └── package.json
├── .env # Environment variables (local)
└── README.md
API Reference
Whiteboard Operations
GET /whiteboards- List user whiteboardsPOST /whiteboards- Create new whiteboardPUT /whiteboards/:id- Update whiteboardDELETE /whiteboards/:id- Delete whiteboard
AI Processing
POST /ai-process- Process AI diagram requests- Supports text prompts, voice commands, and image input
- Returns series of diagram modification commands
Real-time Collaboration
- GraphQL subscriptions for live whiteboard updates
- WebSocket connections for real-time editing
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally and with production build
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- Check the Issues page
- Review deployment logs in AWS CloudWatch
- Verify Gemini API key configuration