{"id":30305441,"url":"https://github.com/techievena/plattr","last_synced_at":"2025-08-17T08:09:37.710Z","repository":{"id":300508512,"uuid":"1006349513","full_name":"techievena/plattr","owner":"techievena","description":"Everything on one platter – orders, views, deals, growth","archived":false,"fork":false,"pushed_at":"2025-06-22T09:35:16.000Z","size":14389,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T11:53:43.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techievena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-06-22T04:11:35.000Z","updated_at":"2025-07-09T21:32:17.000Z","dependencies_parsed_at":"2025-06-22T05:32:11.081Z","dependency_job_id":null,"html_url":"https://github.com/techievena/plattr","commit_stats":null,"previous_names":["abinashsena/plattr","techievena/plattr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techievena/plattr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techievena%2Fplattr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techievena%2Fplattr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techievena%2Fplattr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techievena%2Fplattr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techievena","download_url":"https://codeload.github.com/techievena/plattr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techievena%2Fplattr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270820793,"owners_count":24651534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"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":"2025-08-17T08:09:37.048Z","updated_at":"2025-08-17T08:09:37.689Z","avatar_url":"https://github.com/techievena.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plattr\nEverything on one platter – orders, deals \u0026 growth\n\nA unified, AI-powered assistant that empowers merchants to manage all their aggregator platforms (Swiggy, Zomato, Magicpin, ONDC, and more) from a single conversational interface. The Merchant Assistant automates operational tasks, provides proactive alerts, and surfaces actionable insights—helping merchants save time, reduce errors, and maximize revenue.\n\n\u003ca href=\"assets/plattr-demo.mp4\"\u003e\n  \u003cimg src=\"assets/plattr-demo.gif\" width=\"800\"/\u003e\n\u003c/a\u003e\n\n---\n\n## Objective\n\n**Platrr** solves the chaos of multi-platform management for merchants by:\n- Providing a single conversational interface for all merchant operations.\n- Securely logging into partner portals and executing merchant commands (change offers, opt in/out of promotions, run campaigns, update timings, etc.).\n- Using agentic AI to autonomously complete complex, multi-step tasks and proactively alert merchants about anomalies, opportunities, and trends.\n\n---\n\n## Features\n\n- **Conversational Interface:** Interact via a unified interface.\n- **Unified Platform Management:** Update offers, timings, and campaigns across Swiggy, Zomato, Magicpin, ONDC, and more.\n- **Secure Portal Integration:** Securely log in and perform actions on partner portals.\n- **Agentic AI:** \n  - Autonomously completes multi-step tasks (e.g., \"Run a weekend discount similar to my last Diwali promo\").\n  - Proactively alerts merchants about anomalies (deductions, rating drops), seasonal opportunities, and competitor trends.\n- **Proactive Monitoring:** Detects and notifies about operational issues before they impact revenue.\n\n---\n\n## Project Structure\n\n```\n/server\n  ├── index.ts         # Server entry point\n  ├── routes.ts        # API and bot routes\n  ├── db.ts            # Database connection\n  ├── seed.ts          # Seed data for development\n  ├── storage.ts       # Storage and session management\n  ├── vite.ts          # Vite server config\n  └── services/        # Integrations and business logic\n\n/client\n  ├── index.html\n  ├── assets/          # Static assets\n  └── src/             # Frontend source code\n```\n\n---\n\n## ⚙️ Tech Stack\n\n### Frontend\n- **React 18** (TypeScript)\n- **Vite** (build tool)\n- **Shadcn/ui** (Radix UI primitives)\n- **Tailwind CSS** (custom merchant-themed variables)\n- **TanStack Query** (server state management)\n- **Wouter** (routing)\n- **Chart.js** (analytics visualization)\n\n### Backend\n- **Node.js** (TypeScript)\n- **Express.js** (REST API)\n- **PostgreSQL** (Neon Database, serverless)\n- **Drizzle ORM** (type-safe DB operations)\n- **OpenAI GPT-4o** (AI assistant)\n- **Connect-pg-simple** (session storage)\n\n---\n\n## Database Schema\n\n- **Merchants:** Profile, contact, store timings, delivery settings\n- **Platforms:** Connections, credentials, sync status\n- **Offers:** Promotions, discount types, scheduling\n\n---\n\n## Analytics \u0026 Reporting\n\n- Revenue, order tracking, and growth metrics\n- Chart visualizations and platform comparisons\n- PDF report generation\n- Real-time data refresh\n\n---\n\n## Alerting \u0026 Monitoring\n\n- Real-time alert monitor (deductions, rating drops, anomalies)\n- Notification system (email, Telegram)\n- Emergency controls (shutdown, pause orders, holiday mode)\n- Mobile-optimized dashboard\n\n---\n\n## 🤖 Browser Automation Setup\n\nSome platform actions (such as logging into Swiggy, Zomato, or Magicpin portals) are performed using a Python-based browser automation agent.\n\n### 1. Install Python Dependencies\n\nEnsure you have Python 3 and pip installed. Then run:\n\n```sh\npip3 install -r requirements.txt\n```\n\n### 2. Environment Variables\n\nThe `.env` file should include your OpenAI API key and database URL, which are used by both the Node.js and Python services.\n\n### 3. Running Browser Automation\n\nThe browser automation agent is invoked automatically by the backend when required.  \nYou can also run it manually for testing:\n\n```sh\npython3 scripts/browser_agent.py '{\"task\": \"login\", \"platform\": \"swiggy\"}'\n```\n\n### 4. Automated Setup\n\nYou can use the provided setup script to automate the above steps:\n\n```sh\nbash setup-browser-automation.sh\n```\n\nThis will:\n- Install Python and Node.js dependencies\n- Create a `.env` file if it doesn't exist\n- Remind you to update your API keys and database URL\n\n---\n\n**Browser automation endpoints:**\n- `POST /api/platforms/connect` (with browser automation)\n- `POST /api/platforms/action` (with browser automation)\n- `POST /api/browser/execute` (direct browser tasks)\n- `GET /api/tasks/:taskId` (check task status)\n\n---\n\n## 🏁 Setup Instructions\n\n### Prerequisites\n\n- Node.js (v18+)\n- npm (v9+)\n- PostgreSQL database (Neon or local)\n- [Optional] OpenAI API key for AI features\n\n### 1. Clone the Repository\n\n```sh\ngit clone https://github.com/your-org/plattr.git\ncd plattr\n```\n\n### 2. Install Dependencies\n\n```sh\nnpm install\n```\n\n### 3. Configure Environment Variables\n\nCreate a `.env` file in the root directory and set the following variables:\n\n```env\nDATABASE_URL=your_postgres_connection_string\nOPENAI_API_KEY=your_openai_api_key\nSESSION_SECRET=your_session_secret\nPORT=8080\n```\n\n### 4. Database Setup\n\nRun migrations and seed data:\n\n```sh\nnpm run db:push\nnpm run db:seed\n```\n\n### 5. Start the Development Servers\n\n#### Backend\n\n```sh\nnpm run dev:server\n```\n\n#### Frontend\n\n```sh\nnpm run dev:client\n```\n\nThe app will be available at [http://localhost:8080](http://localhost:8080).\n\n---\n\n## 🚀 Running in Production\n\n1. Build the client and server:\n\n    ```sh\n    npm run build\n    ```\n\n2. Start the production server:\n\n    ```sh\n    npm start\n    ```\n\n---\n\n## 🐳 Running with Docker\n\n### Prerequisites\n\n- Docker Engine 20.10+\n- Docker Compose 2.0+\n- At least 2GB of available RAM\n\n### Quick Start with Docker\n\n1. **Clone the Repository**\n\n    ```sh\n    git clone https://github.com/your-org/plattr.git\n    cd plattr\n    ```\n\n2. **Set Environment Variables**\n\n    Create a `.env` file in the root directory:\n\n    ```env\n    DATABASE_URL=your_postgres_connection_string\n    OPENAI_API_KEY=your_openai_api_key\n    SESSION_SECRET=your_session_secret\n    PORT=8080\n    ```\n\n3. **Run with Docker Compose**\n\n    **Production Mode:**\n    ```sh\n    # Build and start the application\n    docker-compose up -d\n\n    # View logs\n    docker-compose logs -f app\n\n    # Stop the application\n    docker-compose down\n    ```\n\n    **Development Mode (with hot reloading):**\n    ```sh\n    # Build and start with hot reloading\n    docker-compose -f docker-compose.dev.yml up -d\n\n    # View logs\n    docker-compose -f docker-compose.dev.yml logs -f app\n\n    # Stop the application\n    docker-compose -f docker-compose.dev.yml down\n    ```\n\n4. **Database Setup**\n\n    Run migrations after the container is up:\n\n    ```sh\n    # For production\n    docker-compose exec app npm run db:push\n\n    # For development\n    docker-compose -f docker-compose.dev.yml exec app npm run db:push\n    ```\n\n### Manual Docker Build\n\n**Build the Image:**\n```sh\n# Production build\ndocker build -t plattr:latest .\n\n# Development build\ndocker build -t plattr:dev --target base .\n```\n\n**Run the Container:**\n```sh\n# Production\ndocker run -d \\\n  --name plattr \\\n  -p 8080:8080 \\\n  -e DATABASE_URL=\"your_database_url\" \\\n  -e OPENAI_API_KEY=\"your_openai_key\" \\\n  -e SESSION_SECRET=\"your_session_secret\" \\\n  plattr:latest\n\n# Development with volume mounting\ndocker run -d \\\n  --name plattr-dev \\\n  -p 8080:8080 \\\n  -v $(pwd):/app \\\n  -v /app/node_modules \\\n  -e DATABASE_URL=\"your_database_url\" \\\n  -e OPENAI_API_KEY=\"your_openai_key\" \\\n  -e SESSION_SECRET=\"your_session_secret\" \\\n  plattr:dev\n```\n---\n\n## 📝 Maintenance Guidelines\n\n- **Security:** Never store or log merchant credentials in plaintext. Use environment variables and secure vaults for secrets.\n- **Dependencies:** Keep all dependencies up to date. Run `npm audit` regularly.\n- **Testing:** All new features must include tests. Use integration tests for platform actions.\n- **Documentation:** Update this README and inline code comments with every major change.\n- **Monitoring:** Set up error and performance monitoring for both server and client.\n\n---\n\n## 🤝 Contribution Guidelines\n\nWe welcome contributions! To contribute:\n\n1. **Fork the repository** and create your branch from `main`.\n2. **Describe your changes** clearly in your pull request.\n3. **Write tests** for new features or bug fixes.\n4. **Adhere to the code style** and linting rules.\n5. **Sign the CLA** if prompted.\n\n**Areas to contribute:**\n- New platform integrations (e.g., ONDC, new aggregators)\n- UI/UX improvements for the conversational interface\n- Agentic AI workflows and prompt engineering\n- Proactive alerting and anomaly detection modules\n- Documentation and developer experience\n\n---\n\n## 🧭 Roadmap\n\n- [X] Automated end-to-end pipeline for automated workflow management \n- [X] Secure login and action execution for MagicPin\n- [X] Proactive anomaly and opportunity alerts\n---\n\n## 📄 License\n\n[MIT License](LICENSE)\n\n---\n\n## 📬 Contact\n\nFor questions, suggestions, or support, open an issue or contact [Abinash](mailto:abinashsena@gmail.com) or [Akshat](mailto:akshat28101997@gmail.com).\n\n---\n\n*Empowering merchants to focus on growth, not grunt work!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechievena%2Fplattr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechievena%2Fplattr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechievena%2Fplattr/lists"}