AI-powered analysis platform with 9 guardian perspectives
Grounded is a sophisticated web application that provides comprehensive analysis of your ideas, plans, and questions through the lens of 9 distinct AI guardian personalities. Each guardian offers unique perspectives ranging from optimistic encouragement to critical analysis, helping you make well-informed decisions.
- 9 Unique Guardians: Each with distinct personalities and perspectives
- π The Optimist - Sees potential and opportunities
- βοΈ The Realist - Focuses on facts and feasibility
- π The Skeptic - Challenges assumptions and finds flaws
- π‘ The Innovator - Explores new possibilities and alternatives
- π― The Strategist - Provides systematic planning and analysis
- β€οΈ The Empath - Considers human impact and emotions
- π° The Economist - Analyzes financial and economic aspects
- π€ The Philosopher - Explores deeper meaning and ethics
- β‘ The Executor - Focuses on implementation and action
- Comprehensive Summaries with sentiment analysis
- Guardian Scoring System with numerical ratings (1-10 scale)
- Key Themes Identification across all perspectives
- Actionable Recommendations for next steps
- Consensus & Divergent Views analysis
- Automatic Language Detection - Responds in your query language
- Global Accessibility - Works with any language you speak
- Cultural Context - Guardians adapt to cultural nuances
- Anonymous Usage - Try one query without registration
- Secure Authentication - Email/password with bcrypt encryption
- Personal Dashboard - View and manage your analysis history
- Rate Limiting - Fair usage policies with upgrade options
- Free Plan - 10 daily queries for registered users
- PRO Plan - Unlimited queries for $5/month
- Seamless Upgrades - Instant plan activation
- Apple Liquid Glass Design - Beautiful, modern interface
- Mobile-First - Responsive design for all devices
- Tailwind CSS - Clean, professional styling
- Real-time Updates - Instant analysis results
- SvelteKit - Modern web framework
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Vite - Fast build tooling
- Cloudflare D1 - Serverless SQL database
- Cloudflare Workers - Edge computing platform
- Wrangler - Development and deployment CLI
- Anthropic Claude - Advanced AI language model
- Custom Guardian System - Specialized AI personalities
- Parallel Processing - Simultaneous guardian responses
- bcrypt - Password hashing
- Session Management - Secure authentication
- Rate Limiting - Usage control and fairness
- Analytics Tracking - Usage insights and optimization
- Node.js 18+
- npm or pnpm
- Cloudflare account
- Anthropic API key
-
Clone the repository
git clone <repository-url> cd grounded
-
Install dependencies
npm install
-
Environment Setup
# Copy environment template cp .env.example .env # Edit .env file with your actual API key # Get your API key from: https://console.anthropic.com/ nano .env
-
Database Setup
# Create D1 database wrangler d1 create grounded-db # Execute schema wrangler d1 execute grounded-db --file=schema.sql --remote # Add seed data (optional) wrangler d1 execute grounded-db --file=seed.sql --remote
-
Start Development Server
npm run dev
wrangler.toml- Cloudflare configurationschema.sql- Database schemaseed.sql- Sample data for testingtailwind.config.js- Styling configuration.env.example- Environment variables template.env- Your local environment variables (not committed to git)
| Variable | Description | Required | Default |
|---|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key from console.anthropic.com | Yes | - |
CLAUDE_MODEL |
Claude model to use for AI responses | No | claude-3-5-sonnet-20241022 |
ENVIRONMENT |
Application environment | No | development |
Security Note: Never commit your actual API keys to git. Use .env for local development and Cloudflare Pages environment variables for production.
grounded/
βββ src/
β βββ lib/
β β βββ components/ # Reusable UI components
β β βββ anthropic.ts # AI integration
β β βββ auth.ts # Authentication service
β β βββ database.ts # Database operations
β β βββ guardians.ts # Guardian definitions
β β βββ usage-tracker.ts # Rate limiting
β βββ routes/
β β βββ api/ # API endpoints
β β βββ analysis/[id]/ # Analysis results page
β β βββ dashboard/ # User dashboard
β β βββ +page.svelte # Homepage
β βββ app.css # Global styles
βββ schema.sql # Database schema
βββ seed.sql # Sample data
βββ wrangler.toml # Cloudflare config
βββ package.json # Dependencies
-
Build the application
npm run build
-
Deploy to Cloudflare
wrangler pages deploy
-
Configure Environment Variables in Cloudflare Pages Dashboard
- Navigate to your Pages project β Settings β Environment variables
- Add
ANTHROPIC_API_KEYwith your Anthropic API key (keep this secret!) - Add
CLAUDE_MODELwith your preferred model (e.g.,claude-3-5-sonnet-20241022) - Environment variables are automatically available to your application
# Deploy schema to production
wrangler d1 execute grounded-db --file=schema.sql --remote
# Optional: Add seed data
wrangler d1 execute grounded-db --file=seed.sql --remotePOST /api/guardians- Submit query for analysisGET /api/analysis/[id]- Retrieve analysis results
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current user
GET /api/user/analyses- Get user's analysis historyGET /api/usage- Get usage statisticsPOST /api/upgrade- Upgrade to PRO planPOST /api/analysis/claim- Claim anonymous analysis
Each guardian has a unique perspective and specialized focus:
| Guardian | Focus Area | Personality Traits |
|---|---|---|
| π Optimist | Opportunities & Potential | Encouraging, enthusiastic, realistic |
| βοΈ Realist | Facts & Feasibility | Balanced, practical, objective |
| π Skeptic | Risks & Challenges | Critical, questioning, constructive |
| π‘ Innovator | Creativity & Alternatives | Creative, boundary-pushing, experimental |
| π― Strategist | Planning & Execution | Systematic, analytical, structured |
| β€οΈ Empath | Human Impact | Caring, inclusive, emotionally aware |
| π° Economist | Financial Analysis | Value-focused, market-aware, ROI-driven |
| π€ Philosopher | Ethics & Meaning | Thoughtful, principled, wisdom-seeking |
| β‘ Executor | Implementation | Action-oriented, results-driven, practical |
- Password Encryption - bcrypt with salt rounds
- Session Management - Secure HTTP-only cookies
- Rate Limiting - Prevents abuse and ensures fair usage
- Input Validation - Comprehensive request validation
- CSRF Protection - Cross-site request forgery prevention
- Content Safety - AI safety guidelines and content filtering
- Usage Tracking - Query counts and patterns
- Performance Metrics - Response times and success rates
- User Behavior - Analysis views, shares, and engagement
- Error Monitoring - Comprehensive error logging and tracking
We welcome contributions! Please see our contributing guidelines for details on:
- Code style and standards
- Pull request process
- Issue reporting
- Feature requests
This project is proprietary software. All rights reserved.
Bachtiar Rifai
π§ b@majumapan.net
- Anthropic - For the powerful Claude AI models
- Cloudflare - For the robust edge computing platform
- Svelte Team - For the excellent web framework
- Tailwind CSS - For the beautiful utility-first CSS framework
Built with β€οΈ using modern web technologies