{"id":50771927,"url":"https://github.com/nirwanadoteth/posiframe","last_synced_at":"2026-06-11T19:33:51.052Z","repository":{"id":326772514,"uuid":"1104933021","full_name":"nirwanadoteth/posiframe","owner":"nirwanadoteth","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-26T23:33:40.000Z","size":2552,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-27T07:11:57.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posiframe.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nirwanadoteth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-26T22:38:15.000Z","updated_at":"2026-01-26T23:33:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nirwanadoteth/posiframe","commit_stats":null,"previous_names":["nirwanadoteth/posiframe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nirwanadoteth/posiframe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirwanadoteth%2Fposiframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirwanadoteth%2Fposiframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirwanadoteth%2Fposiframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirwanadoteth%2Fposiframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nirwanadoteth","download_url":"https://codeload.github.com/nirwanadoteth/posiframe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirwanadoteth%2Fposiframe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34215253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-11T19:33:46.984Z","updated_at":"2026-06-11T19:33:51.046Z","avatar_url":"https://github.com/nirwanadoteth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PosiFrame - Farcaster Positive Reframing Tool\n\n**Turn Negativity Into Positivity with AI-Powered Language Transformation**\n\nPosiFrame is a Farcaster Mini App that helps users transform negative or hostile language into positive, constructive communication using AI-powered sentiment analysis and reframing.\n\n## 🎯 Research Scope (Batasan Masalah)\n\nThis application was developed with specific research constraints:\n\n### 1. **Platform Scope**\n\n- **Exclusive to Farcaster**: This system is designed specifically for the Farcaster social platform ecosystem\n- **Post Creation Focus**: Covers interaction through post/cast creation only\n- **Not included**: Other social media platforms (Instagram, TikTok, YouTube, Facebook)\n\n### 2. **Input Processing**\n\n- **Text-only**: Processes text input in **English and Bahasa (Indonesia)** languages only\n- **No multimedia**: Does not process or moderate images, audio, or video content\n\n### 3. **AI Technology Approach**\n\n- **Third-party LLM API**: Uses Google Gemini API via third-party service\n- **Prompt Engineering**: Focuses on prompt engineering optimization for reframing results\n- **No fine-tuning**: Does not include fine-tuning or training LLM models from scratch\n\n### 4. **API Key Management**\n\n- **BYOK (Bring Your Own Key)**: Users must configure their own API keys\n- **Client-side Configuration**: API keys are set up directly in the app interface\n- **Encrypted Storage**: Keys are encrypted and stored locally in the browser\n\n### 5. **Reframing Strategy**\n\n- **Positive Rephrasing**: Focuses on transforming negative tone into constructive communication\n- **Preserves Core Meaning**: Does not change the fundamental message intent\n- **Empathetic Language**: Emphasizes empathy and professional communication\n\n### 6. **Functional Features**\n\nBased on user needs survey, features are limited to:\n\n- ✅ **Text Input**: Draft messages in English or Bahasa\n- ✅ **Automatic Reframing**: AI-powered reframing using Gemini\n- ✅ **Simple Sentiment Statistics**: Track analysis history (total, negative, positive)\n- ✅ **Direct Publish to Farcaster**: One-click publish to Farcaster feed\n\n---\n\n## 🚀 Features\n\n### 1. **Bilingual Sentiment Analysis**\n\n- Detects sentiment in both **English** and **Bahasa**\n- Identifies negative, aggressive, passive-aggressive, or neutral tones\n- Provides reasoning for detected sentiment\n\n### 2. **AI-Powered Positive Reframing**\n\n- Transforms negative language into constructive alternatives\n- Maintains the core message while improving emotional tone\n- Uses Google Gemini 2.5 Flash model for fast, accurate results\n- Response in the same language as input\n\n### 3. **Simple Statistics Dashboard**\n\n- **Total Analyses**: Count of all sentiment analyses performed\n- **Negative Detected**: Number of texts with negative sentiment\n- **Already Positive**: Number of texts with positive sentiment\n- Persistent statistics stored locally in browser\n\n### 4. **Direct Farcaster Integration**\n\n- Compose casts directly from the app\n- One-click \"Publish to Farcaster\" button\n- \"Use \u0026 Publish\" feature to apply suggestion and publish immediately\n- Seamless integration with Farcaster composer\n\n### 5. **Secure API Key Management (BYOK)**\n\n- Bring Your Own Key approach\n- Client-side encryption using Web Crypto API\n- Keys stored securely in browser localStorage\n- No server-side key storage\n\n---\n\n## 🛠️ Technology Stack\n\n- **Framework**: Next.js 16 (App Router, React 19.2, Turbopack)\n- **UI Components**: Shadcn/ui, Radix UI, Tailwind CSS\n- **AI Model**: Google Gemini 2.5 Flash via `@google/genai`\n- **Farcaster Integration**: `@farcaster/miniapp-sdk`\n- **Type Safety**: TypeScript, Zod for schema validation\n- **Code Quality**: Ultracite (Biome) for linting and formatting\n\n---\n\n## 📋 Prerequisites\n\n- Node.js 20+ and npm\n- Google Gemini API Key ([Get one here](https://aistudio.google.com/app/apikey))\n- Farcaster account (for publishing casts)\n\n---\n\n## 🏃 Getting Started\n\n### 1. Clone and Install\n\n\\`\\`\\`bash\ngit clone \u003crepository-url\u003e\ncd posiframe\nnpm install\n\\`\\`\\`\n\n### 2. Configure Environment Variables (Optional)\n\nCreate a \\`.env.local\\` file:\n\n\\`\\`\\`env\nNEXT_PUBLIC_URL=\u003chttp://localhost:3000\u003e\n\n# Farcaster Manifest Signing (for production deployment)\n\nFARCASTER_HEADER=\nFARCASTER_PAYLOAD=\nFARCASTER_SIGNATURE=\n\\`\\`\\`\n\n### 3. Run Development Server\n\n\\`\\`\\`bash\nnpm run dev\n\\`\\`\\`\n\nOpen [http://localhost:3000](http://localhost:3000)\n\n### 4. Configure Your API Key\n\n1. Enter your Google Gemini API key when prompted\n2. The key will be encrypted and stored locally\n3. You can clear and reconfigure the key anytime\n\n---\n\n## 📱 How to Use\n\n### Step 1: Configure API Key\n\n- On first launch, enter your Google Gemini API key\n- Get a free key at: \u003chttps://aistudio.google.com/app/apikey\u003e\n- The key is encrypted and stored locally on your device\n\n### Step 2: Draft Your Message\n\n- Type your message in English or Bahasa\n- The textarea accepts any text input\n\n### Step 3: Analyze \u0026 Refine\n\n- Click \"Analyze \u0026 Refine\" to process your text\n- View sentiment analysis results:\n  - **Sentiment**: Brief description of detected tone\n  - **Reasoning**: Analysis of underlying message\n  - **Suggestion**: Positive reframe of your text\n\n### Step 4: Choose Your Action\n\n- **Keep Original**: Discard suggestion and keep your text\n- **Use Suggestion**: Replace your text with the positive version\n- **Publish to Farcaster**: Publish current text directly (requires Farcaster)\n- **Use \u0026 Publish**: Apply suggestion and publish immediately\n\n### Step 5: Track Your Progress\n\n- View statistics at the top:\n  - Total analyses performed\n  - Negative sentiments detected\n  - Already positive messages\n\n---\n\n## 🔐 Security \u0026 Privacy\n\n### API Key Storage\n\n- Keys are encrypted using AES-GCM with a device-specific encryption key\n- Stored locally in browser's localStorage\n- Never transmitted to any server except Google's Gemini API\n- Can be cleared at any time\n\n### Data Processing\n\n- Text is sent only to Google Gemini API for analysis\n- No text is stored on any server\n- Statistics are stored locally in your browser\n- Complete data privacy and control\n\n---\n\n## 📊 Research Application\n\nThis application demonstrates:\n\n1. **Prompt Engineering**: Optimized prompts for bilingual sentiment analysis\n2. **Positive Rephrasing**: AI-powered language transformation strategies\n3. **BYOK Architecture**: User-controlled API key management\n4. **Mini App Integration**: Seamless Farcaster platform integration\n5. **Bilingual NLP**: English and Bahasa language processing\n\n---\n\n## 🎨 Code Quality\n\nThe project follows strict code quality standards using **Ultracite**:\n\n\\`\\`\\`bash\n\n# Check for issues\n\nnpm run check\n\n# Auto-fix formatting and linting\n\nnpm run fix\n\\`\\`\\`\n\nStandards enforced:\n\n- Type safety with TypeScript\n- Accessible React components\n- Modern JavaScript/TypeScript patterns\n- Proper error handling\n- Semantic HTML\n\n---\n\n## 🚢 Deployment\n\n### Deploy to Vercel\n\n1. Push to GitHub\n2. Import to Vercel\n3. Configure environment variables (optional)\n4. Deploy\n\n### Farcaster Manifest\n\nFor production deployment as a Farcaster Mini App:\n\n1. Sign your manifest at: \u003chttps://farcaster.xyz/~/developers/mini-apps/manifest\u003e\n2. Add signed values to environment variables:\n   - \\`FARCASTER_HEADER\\`\n   - \\`FARCASTER_PAYLOAD\\`\n   - \\`FARCASTER_SIGNATURE\\`\n3. Ensure \\`.well-known/farcaster.json\\` is accessible\n\nRefer to [Farcaster Mini Apps Documentation](https://miniapps.farcaster.xyz/docs/guides/publishing)\n\n---\n\n## 📖 Learn More\n\n### Farcaster Development\n\n- [Farcaster Mini Apps Docs](https://miniapps.farcaster.xyz/)\n- [Farcaster SDK Reference](https://miniapps.farcaster.xyz/docs/sdk/actions)\n- [Publishing Guide](https://miniapps.farcaster.xyz/docs/guides/publishing)\n\n### Next.js Resources\n\n- [Next.js Documentation](https://nextjs.org/docs)\n- [Next.js App Router](https://nextjs.org/docs/app)\n- [React 19 Documentation](https://react.dev/)\n\n### AI \u0026 NLP\n\n- [Google Gemini API](https://ai.google.dev/gemini-api/docs)\n- [Prompt Engineering Guide](https://www.promptingguide.ai/)\n\n---\n\n## 🤝 Contributing\n\nThis is a research project. For questions or contributions, please follow standard GitHub workflow:\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push and create a Pull Request\n\n---\n\n## 📄 License\n\nThis project is developed for research purposes.\n\n---\n\n## 🙏 Acknowledgments\n\n- **Farcaster Team** for the Mini Apps platform\n- **Google** for Gemini API\n- **Vercel** for Next.js and hosting platform\n- Research participants for user needs survey\n\n---\n\n**Made with ❤️ for positive communication on Farcaster**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirwanadoteth%2Fposiframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnirwanadoteth%2Fposiframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirwanadoteth%2Fposiframe/lists"}