{"id":25534576,"url":"https://github.com/aksweb/tensorgo","last_synced_at":"2026-01-26T08:30:20.216Z","repository":{"id":273028485,"uuid":"918505639","full_name":"aksweb/tensorgo","owner":"aksweb","description":"Invoice management system","archived":false,"fork":false,"pushed_at":"2025-01-18T05:39:15.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T06:21:55.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/aksweb.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}},"created_at":"2025-01-18T05:18:18.000Z","updated_at":"2025-01-18T05:39:16.000Z","dependencies_parsed_at":"2025-01-18T06:22:20.740Z","dependency_job_id":"135aae42-1de1-4b2d-8b65-f3a7b224b165","html_url":"https://github.com/aksweb/tensorgo","commit_stats":null,"previous_names":["aksweb/tensorgo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksweb%2Ftensorgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksweb%2Ftensorgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksweb%2Ftensorgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksweb%2Ftensorgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aksweb","download_url":"https://codeload.github.com/aksweb/tensorgo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768926,"owners_count":19693764,"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","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-02-20T03:20:01.551Z","updated_at":"2026-01-26T08:30:20.160Z","avatar_url":"https://github.com/aksweb.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice Management and Mailing System\n   ``` by Abhishekh Singh (https://github.com/aksweb/tensorgo)```\n   \nThis project is an Invoice Management and Mailing System that provides a comprehensive solution for managing invoices and sending automated email reminders for due payments. The project is divided into **Frontend** and **Backend** sections to ensure clarity and maintainability.\n\n---\n# Solution Approach:\n\n1. **Backend API Development:**\n   - Developed backend API endpoints to handle:\n     - **Authentication** using Google OAuth and JWT tokens.\n     - **Invoice management** to fetch, filter, and process invoice data.\n     - **Automated email workflows** integrated with Zapier.\n\n2. **Frontend Integration:**\n   - Designed a user-friendly interface to display invoices.\n   - Implemented features to:\n     - Fetch invoice data from the backend via API calls.\n     - Filter invoices based on their status (Paid/Due).\n     - Display customer details like name, email, purchase date, due date, amount, and payment status.\n\n3. **Zapier Zap Configuration:**\n   - Created a Zapier workflow to handle automated emails:\n     1. **Step 1:** Set up a webhook in Zapier to receive dynamic email details like recipient name, amount due, and invoice ID.\n     2. **Step 2:** Linked the Zapier Gmail service to send automated email reminders using the received data.\n\n4. **Zap Execution Workflow:**\n   - Trigger the zap from the frontend:\n     1. When the user clicks the **Send Due Alert** button, send a `POST` request to the backend server.\n     2. The backend:\n        - Filters invoices based on their **Due** status.\n        - Prepares the required data (e.g., recipient details and invoice information).\n        - Sends the filtered data to the Zapier webhook.\n     3. Zapier processes the webhook data and triggers automated email alerts.\n\n\n## Frontend\n### Features:\n1. **Google OAuth Login:**\n   - Implemented Google OAuth for user authentication.\n   - Uses JWT tokens to manage user sessions and control scope throughout the web app.\n   - Upon successful login:\n     - A code is generated and sent to the backend for authentication via `GET http://localhost:5000/auth/`.\n     - The token is saved in `localStorage` as `user-info`.\n   - Easy login for existing users and signup for new users.\n   - Logic to retain the token on page refresh:\n     - The token is checked in `localStorage` and verified for validity.\n     - The token expires after the predefined expiration time.\n2. **Dashboard:**\n   - After logging in, users are redirected to the dashboard (`localhost:5713/dashboard`).\n   - Fetch invoices using `GET http://localhost:5000/invoices`:\n     - Implemented using the `useEffect` hook for real-time updates.\n   - Filter invoices based on **Paid** or **Due** status.\n   - Display customer details:\n     - Name, email, purchase date, due date, amount, and status.\n3. **Persistent User Data:**\n   - User information is stored in a MongoDB database for persistent storage.\n\n### Token Retention Logic:\n```javascript\nconst token = localStorage.getItem('user-info');\nif (token) {\n    // Validate the token (optional call to backend for verification).\n    // If valid, set the user session.\n}\n```\n# Backend\n## Features:\n\n### 1. **Authentication:**\n- **Endpoint:** `GET localhost:5000/auth/google`  \n  Handles Google OAuth authentication.\n- Uses JWT to issue tokens to authenticated users.\n---\n\n### 2. **Invoice Management:**\n- **Endpoint:** `GET localhost:5000/invoices`  \n  Retrieves all invoice details.\n- Filters invoices based on their status (Paid/Due).\n- Invoice data is stored in MongoDB for reliability and scalability.\n---\n\n### 3. **Automated Email Alerts:**\n- Built using **Zapier** for seamless integration:\n  1. **Step 1:** Created a webhook in Zapier to receive dynamic email details (recipient name, amount due, invoice ID).\n  2. **Step 2:** Integrated Zapier's Gmail service to send automated emails using this webhook.\n- **Flow:**\n  1. Manager clicks the **Send Due Alert** button.\n  2. Sends a `POST` request to `http://localhost:5000/exezap` to execute the `sendDueInvoicesToZapier` function.\n  3. Filters due customers and sends their details to the Zapier webhook.\n  4. Zapier triggers the Gmail service to send email reminders.\n---\n\n## API Endpoints:\n### Authentication:\n- **Endpoint:** `GET localhost:5000/auth/google`  \n  For user authentication.\n### Invoice Management:\n- **Endpoint:** `GET localhost:5000/invoices`  \n  Fetch invoice details.\n### Zapier Workflow Execution:\n- **Endpoint:** `POST localhost:5000/exezap`  \n  Trigger Zapier workflow for email alerts.\n---\n\n## Code Structure:\nThe backend follows **MVC Architecture** to ensure separation of concerns and better maintainability:\n- **Model:** Handles database schemas and interactions with MongoDB.\n- **View:** Manages data presentation (integrates with the frontend).\n- **Controller:** Manages business logic and API endpoints.\n---\n\n## Usage Instructions:\n### 1. **Clone the Repository:**\n```bash\ngit clone \u003crepository-url\u003e\ncd invoice-management-system\nnpm install\n```\n### 2. **Set up Environment Variables:**\nEnsure the following environment variables are configured in your `.env` file:\n- **Database URI for MongoDB**  \n  Example: `MONGO_URI=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@cluster.mongodb.net/myDatabase`  \n- **Zapier Webhook URL**  \n  Example: `ZAPIER_WEBHOOK_URL=https://hooks.zapier.com/hooks/catch/\u003cyour-webhook-id\u003e/` \n- **Google OAuth Credentials**  \n  Example:  `GOOGLE_CLIENT_ID=\u003cyour-client-id\u003e GOOGLE_CLIENT_SECRET=\u003cyour-client-secret\u003e`\n### 3. **Run the Application:**\nbackend: npm start\nfrontend: npm run dev\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksweb%2Ftensorgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faksweb%2Ftensorgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksweb%2Ftensorgo/lists"}