{"id":30266745,"url":"https://github.com/juliusmarkwei/attache","last_synced_at":"2025-08-15T23:19:45.982Z","repository":{"id":308035877,"uuid":"1031415695","full_name":"juliusmarkwei/attache","owner":"juliusmarkwei","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-03T17:58:43.000Z","size":758,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T19:35:24.262Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliusmarkwei.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}},"created_at":"2025-08-03T17:33:04.000Z","updated_at":"2025-08-03T17:58:46.000Z","dependencies_parsed_at":"2025-08-03T19:35:25.655Z","dependency_job_id":"fe633bbb-dd80-4290-ad20-4b404f595c60","html_url":"https://github.com/juliusmarkwei/attache","commit_stats":null,"previous_names":["juliusmarkwei/attache"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/juliusmarkwei/attache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliusmarkwei%2Fattache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliusmarkwei%2Fattache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliusmarkwei%2Fattache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliusmarkwei%2Fattache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliusmarkwei","download_url":"https://codeload.github.com/juliusmarkwei/attache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliusmarkwei%2Fattache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644761,"owners_count":24621332,"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-15T02:00:12.559Z","response_time":110,"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-15T23:19:45.210Z","updated_at":"2025-08-15T23:19:45.970Z","avatar_url":"https://github.com/juliusmarkwei.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attache - Document Management Platform\n\nA full-stack document management platform that automatically processes email attachments and organizes them by company. Built with Next.js, Convex, and Gmail API integration.\n\n## 🚀 Features\n\n- **Email \u0026 Password Authentication**: Login with email and password\n- **Gmail Integration**: Automatic email processing with webhooks\n- **Document Management**: Store and organize documents by company\n- **Real-time Updates**: Live document and company listings\n- **Secure Storage**: Convex file storage with download functionality\n- **Beautiful UI**: Modern, responsive design with Tailwind CSS\n- **PWA Support**: Progressive Web App with custom app icon\n- **Cross-platform**: Works on desktop, tablet, and mobile devices\n- **Open Graph**: Rich social media sharing with custom images\n- **SEO Optimized**: Comprehensive metadata for search engines\n\n## 🏗️ Architecture\n\n### Backend\n\n- **Next.js API Routes**: RESTful endpoints for authentication and document management\n- **Convex Database**: Real-time database for companies, documents, and users\n- **Convex Storage**: Secure file storage for document attachments\n- **Gmail API**: Webhook-based email processing\n\n### Frontend\n\n- **Next.js 14**: App Router with TypeScript\n- **Convex React**: Real-time data synchronization\n- **Tailwind CSS**: Utility-first styling\n- **Lucide Icons**: Beautiful icon library\n- **PWA Support**: Progressive Web App capabilities\n- **Custom App Icon**: Branded icon for all platforms\n- **Open Graph**: Social media sharing optimization\n- **Twitter Cards**: Enhanced Twitter sharing\n\n## 📋 Prerequisites\n\n- Node.js 18+\n- pnpm package manager\n- Gmail account with API access\n- Convex account\n\n## 🛠️ Setup Instructions\n\n### 1. Clone and Install Dependencies\n\n```bash\ngit clone \u003crepository-url\u003e\ncd attache\npnpm install\n```\n\n### 2. Environment Variables\n\nCreate a `.env.local` file in the root directory:\n\n```env\n# Convex (automatically generated)\nNEXT_PUBLIC_CONVEX_URL=your_convex_url\nCONVEX_DEPLOYMENT=your_deployment_name\n\n# Gmail API\nGOOGLE_SERVICE_ACCOUNT_KEY_FILE=path/to/service-account-key.json\nGMAIL_WEBHOOK_SECRET=your_webhook_secret\n\n# Optional: Custom domain for webhooks\nNEXT_PUBLIC_APP_URL=https://your-domain.com\n```\n\n### 3. Gmail API Setup\n\n1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project or select existing one\n3. Enable Gmail API\n4. Create a Service Account\n5. Download the JSON key file\n6. Set up Gmail API credentials\n\n### 4. Convex Setup\n\nThe project is already configured with Convex. The database schema and functions are ready to use.\n\n### 5. Run Development Server\n\n```bash\npnpm dev\n```\n\nThe application will be available at `http://localhost:3000`\n\n## 📧 Gmail Webhook Configuration\n\n### Setting up Gmail Push Notifications\n\n1. **Enable Gmail API**: Ensure Gmail API is enabled in your Google Cloud project\n2. **Create Service Account**: Set up a service account with Gmail API permissions\n3. **Configure Webhook**: Set up push notifications to your webhook endpoint\n\n### Webhook Endpoint\n\nThe webhook endpoint is available at:\n\n```\nPOST /api/gmail/webhook\n```\n\n### Email Processing Logic\n\nThe system automatically:\n\n- Extracts company names from email subjects\n- Downloads email attachments\n- Stores documents in Convex storage\n- Associates documents with companies\n- Updates the UI in real-time\n\n## 🔐 Authentication\n\nThe platform uses email and password authentication:\n\n1. **Email Entry**: Users enter their email address\n2. **Password Entry**: Users enter their password\n3. **Authentication**: System verifies credentials and creates a session\n4. **Session Management**: Secure session tokens with HTTP-only cookies\n\n## 📁 Document Management\n\n### Features\n\n- **Automatic Processing**: Documents are processed when emails are received\n- **Company Association**: Documents are linked to companies based on email subjects\n- **Download Functionality**: Users can download documents directly\n- **Metadata Tracking**: File size, upload date, and source information\n\n### Document Storage\n\n- Files are stored securely in Convex storage\n- Metadata is stored in the Convex database\n- Download URLs are generated on-demand\n\n## 🎨 UI Components\n\n### Dashboard\n\n- **Company List**: Shows all companies with document counts\n- **Document List**: Displays recent documents with download options\n- **Statistics**: Overview of companies and documents\n- **Real-time Updates**: Live data synchronization\n\n### Authentication\n\n- **Login Form**: Beautiful OTP-based authentication\n- **Session Management**: Automatic session handling\n- **Logout**: Secure session termination\n\n## 🔧 Development\n\n### Project Structure\n\n```\nattache/\n├── convex/                 # Convex functions and schema\n│   ├── schema.ts          # Database schema\n│   ├── auth.ts            # Authentication functions\n│   ├── companies.ts       # Company management\n│   ├── documents.ts       # Document management\n│   └── files.ts           # File storage functions\n├── app/                   # Next.js app router\n│   ├── api/               # API routes\n│   └── dashboard/         # Dashboard pages\n├── components/            # React components\n└── public/                # Static assets\n    ├── icon.svg           # App icon (SVG)\n    ├── icon-192.png       # App icon (192x192)\n    ├── icon-512.png       # App icon (512x512)\n    ├── manifest.json      # PWA manifest\n    ├── og-image.svg       # Open Graph image (SVG)\n    ├── og-image.png       # Open Graph image (PNG)\n    └── Sandy_Tech-02_Single-10.jpg  # Background image\n```\n\n### Key Technologies\n\n- **Next.js 14**: Full-stack React framework\n- **Convex**: Real-time database and file storage\n- **Gmail API**: Email processing and webhooks\n- **Tailwind CSS**: Utility-first CSS framework\n- **TypeScript**: Type-safe development\n- **PWA**: Progressive Web App capabilities\n- **SVG Icons**: Scalable vector graphics for crisp display\n- **Open Graph**: Social media sharing optimization\n- **Twitter Cards**: Enhanced social media sharing\n\n## 🚀 Deployment\n\n### Vercel Deployment\n\n1. Connect your repository to Vercel\n2. Set up environment variables in Vercel dashboard\n3. Deploy the application\n\n### App Icon \u0026 PWA\n\nThe application includes a custom app icon and Progressive Web App (PWA) support:\n\n- **App Icon**: Custom SVG icon with brand colors\n- **PWA Manifest**: Web app manifest for mobile installation\n- **Cross-platform**: Works on desktop, tablet, and mobile\n- **Offline Support**: Can be installed as a native app\n\nThe app icon appears in:\n\n- Browser tabs and bookmarks\n- Mobile home screens (when added)\n- App stores (if published as PWA)\n\n### Social Media Sharing\n\nThe application includes comprehensive Open Graph and Twitter Card support:\n\n- **Open Graph**: Rich previews on Facebook, LinkedIn, and other platforms\n- **Twitter Cards**: Enhanced sharing on Twitter with large image previews\n- **Custom Images**: Branded sharing images (1200x630) in SVG and PNG formats\n- **SEO Metadata**: Comprehensive meta tags for search engine optimization\n\nWhen shared on social media, the application displays:\n\n- Custom branded image with logo and features\n- Descriptive title and description\n- Platform-specific optimizations\n\n### Environment Variables for Production\n\nEnsure all environment variables are set in your production environment:\n\n- `NEXT_PUBLIC_CONVEX_URL`\n- `CONVEX_DEPLOYMENT`\n- `GOOGLE_SERVICE_ACCOUNT_KEY_FILE`\n- `GMAIL_WEBHOOK_SECRET`\n\n## 🔒 Security Considerations\n\n- **HTTPS Only**: All production deployments should use HTTPS\n- **Secure Cookies**: Session tokens are HTTP-only and secure\n- **API Key Protection**: Gmail API keys are stored securely\n- **Input Validation**: All user inputs are validated\n- **Error Handling**: Comprehensive error handling throughout\n- **PWA Security**: Secure manifest and icon handling\n\n## 📈 Advanced Features\n\n### Duplicate Email Handling\n\n- Email IDs are tracked to prevent duplicate processing\n- Timestamp-based deduplication\n\n### Sender Authentication\n\n- Email domain validation\n- Whitelist/blacklist functionality (can be implemented)\n\n### Webhook vs Polling\n\n- **Webhooks**: Real-time processing, lower latency\n- **Polling**: Fallback option for reliability\n- **Hybrid Approach**: Webhooks with polling backup\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🆘 Support\n\nFor support and questions:\n\n- Create an issue in the repository\n- Check the documentation\n- Review the code comments\n\n---\n\n**Built with ❤️ using Next.js, Convex, and modern web technologies**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliusmarkwei%2Fattache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliusmarkwei%2Fattache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliusmarkwei%2Fattache/lists"}