{"id":20137389,"url":"https://github.com/thund3rhawk/datacourier","last_synced_at":"2026-04-10T11:04:29.401Z","repository":{"id":240664849,"uuid":"801943560","full_name":"Thund3rHawk/DataCourier","owner":"Thund3rHawk","description":"Admins can add users to a list via CSV upload and send notifications to them through email according to the provided CSV file.","archived":false,"fork":false,"pushed_at":"2024-05-22T07:09:43.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T22:45:21.946Z","etag":null,"topics":["cors","csv-","dotenv","expressjs","mongodb","mongoose","multer","nodejs","nodemailer","render","ts-node","typescript"],"latest_commit_sha":null,"homepage":"https://mathongo-assignment-hite.onrender.com","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/Thund3rHawk.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":"2024-05-17T08:09:46.000Z","updated_at":"2024-06-07T07:48:44.000Z","dependencies_parsed_at":"2024-05-20T12:51:45.877Z","dependency_job_id":"d9cf6ecc-a1fb-4282-8fda-6b89cc723d82","html_url":"https://github.com/Thund3rHawk/DataCourier","commit_stats":null,"previous_names":["thund3rhawk/mathongo-assignment","thund3rhawk/datacourier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thund3rHawk%2FDataCourier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thund3rHawk%2FDataCourier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thund3rHawk%2FDataCourier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thund3rHawk%2FDataCourier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thund3rHawk","download_url":"https://codeload.github.com/Thund3rHawk/DataCourier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582522,"owners_count":19985846,"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":["cors","csv-","dotenv","expressjs","mongodb","mongoose","multer","nodejs","nodemailer","render","ts-node","typescript"],"created_at":"2024-11-13T21:27:15.613Z","updated_at":"2025-11-27T12:02:38.556Z","avatar_url":"https://github.com/Thund3rHawk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV Email Sender API\n\nThis project allows admins to add users to a list via CSV upload, efficiently handling 10,000+ records, and send email notifications to them using the provided CSV file.\n\n## API Endpoints\n\n### 1. Create a List\n\n- **URL:** `http://localhost:3000/post`\n- **Method:** `POST`\n- **Description:** Creates a new list with a title and custom properties.\n- **Request Body:**\n  ```json\n  {\n    \"title\": \"My List\",\n    \"customProperties\": [\n      { \"title\": \"city\", \"fallbackValue\": \"Unknown\" }\n    ]\n  }\n  ```\n- **Response:**\n  - **201 Created:** List created successfully.\n  - **400 Bad Request:** Missing or invalid parameters.\n  - **409 Conflict:** List with the same title already exists.\n\n- **Example:**\n  ```sh\n  curl -X POST http://localhost:3000/post -H \"Content-Type: application/json\" -d '{\n    \"title\": \"My List\",\n    \"customProperties\": [\n      { \"title\": \"city\", \"fallbackValue\": \"Unknown\" }\n    ]\n  }'\n  ```\n\n  ✅ List creation with title and custom properties\n\n### 2. Upload Users via CSV\n\n- **URL:** `http://localhost:3000/:listTitle/users`\n- **Method:** `POST`\n- **Description:** Adds users to the specified list via CSV upload. The CSV must have a header row with 'name' and 'email' as required fields. Custom properties should match the headers.\n- **URL Parameters:**\n  - `listTitle` (string) - The title of the list to add users to.\n- **Request Body:** Multipart/form-data\n  - **file:** CSV file containing users to be added.\n\n- **Sample CSV Format:**\n\n  | name      | email            | city       |\n  | --------- | ---------------- | ---------- |\n  | John Doe  | john.doe@example.com | Bengaluru  |\n  | Jane Doe  | jane.doe@example.com |            |\n\n  - **Note:** The second record doesn't have the city value defined, so the fallback value present in the list should be used.\n\n- **Response:**\n  - **200 OK:** Users added successfully with details.\n  - **400 Bad Request:** Missing or invalid parameters.\n  - **404 Not Found:** List not found.\n  - **409 Conflict:** Duplicate emails found.\n  - **Partial Success:** Users added with some errors. The response will include details about the errors and successful additions.\n\n- **Example:**\n  ```sh\n  curl -X POST http://localhost:3000/My%20List/users -H \"Content-Type: multipart/form-data\" -F \"file=@/path/to/your/file.csv\"\n  ```\n\n  ✅ Upload CSV file to add users to the list\n\n## Error Handling\n\n- **Invalid Parameters:** Ensure all required parameters are included in the request body or URL.\n- **Unique Emails:** Ensure no duplicate emails are present in the CSV file.\n- **List Not Found:** Ensure the list title specified in the URL exists.\n\n## Example Usage\n\n### Create a New List\n```sh\ncurl -X POST http://localhost:3000/post -H \"Content-Type: application/json\" -d '{\n  \"title\": \"Friends List\",\n  \"customProperties\": [\n    { \"title\": \"hobby\", \"fallbackValue\": \"Unknown\" }\n  ]\n}'\n```\n\n### Add Users to a List via CSV Upload\n```sh\ncurl -X POST http://localhost:3000/Friends%20List/users -H \"Content-Type: multipart/form-data\" -F \"file=@/path/to/your/file.csv\"\n```\n\n## Environment Variables\n\nEnsure to set up the following environment variables:\n\n- `AUTH_EMAIL` - The email address used for sending emails.\n- `AUTH_EMAIL_PASS` - The password or app-specific password for the email account.\n- `MONGODB_URI` - The url for mongodb.\n```sh\nAUTH_EMAIL=your-email@gmail.com\nAUTH_EMAIL_PASS=your-email-password\nMONGODB_URI= mongoDB-url\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthund3rhawk%2Fdatacourier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthund3rhawk%2Fdatacourier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthund3rhawk%2Fdatacourier/lists"}