{"id":18333982,"url":"https://github.com/mcclowes/mcclowes-apis","last_synced_at":"2026-05-01T08:32:12.234Z","repository":{"id":88229642,"uuid":"542277789","full_name":"mcclowes/mcclowes-apis","owner":"mcclowes","description":"API for some personal utility functions","archived":false,"fork":false,"pushed_at":"2025-10-21T21:35:31.000Z","size":2122,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T23:28:49.820Z","etag":null,"topics":["api","be","express","vercel"],"latest_commit_sha":null,"homepage":"https://api.mcclowes.com/","language":"JavaScript","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/mcclowes.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":"2022-09-27T20:30:47.000Z","updated_at":"2025-10-21T20:31:06.000Z","dependencies_parsed_at":"2023-03-13T18:28:29.269Z","dependency_job_id":"51653a14-9be8-4f94-8cdd-602b1ec62d97","html_url":"https://github.com/mcclowes/mcclowes-apis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcclowes/mcclowes-apis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcclowes%2Fmcclowes-apis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcclowes%2Fmcclowes-apis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcclowes%2Fmcclowes-apis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcclowes%2Fmcclowes-apis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcclowes","download_url":"https://codeload.github.com/mcclowes/mcclowes-apis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcclowes%2Fmcclowes-apis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32490810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["api","be","express","vercel"],"created_at":"2024-11-05T19:45:52.618Z","updated_at":"2026-05-01T08:32:12.229Z","avatar_url":"https://github.com/mcclowes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcclowes-api\n\nA Node.js REST API for personal productivity automation, integrating Todoist task management with AI-powered categorization and summarization via OpenAI's GPT models.\n\n## Features\n\n- **Todoist Integration**: Complete CRUD operations for tasks via Todoist API\n- **AI-Powered Task Management**:\n  - Automatic task categorization using GPT-4\n  - Intelligent task summarization with GPT-3.5 Turbo\n  - Smart priority management\n- **Automated Task Processing**:\n  - Auto-completion of stale tasks (250+ days old)\n  - Automatic urgency escalation for overdue tasks\n  - Daily task focus management\n- **Production-Ready**:\n  - Input validation and sanitization\n  - Comprehensive error handling\n  - Authentication via hash and Bearer tokens\n  - Swagger/OpenAPI documentation\n\n## Prerequisites\n\n- Node.js 18.x or higher\n- Todoist account and API token\n- OpenAI API key\n- npm or yarn\n\n## Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/mcclowes/what-the-fpl-api.git\n   cd mcclowes-apis\n   ```\n\n2. **Install dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Configure environment variables**\n\n   Copy `.env.example` to `.env`:\n   ```bash\n   cp .env.example .env\n   ```\n\n   Edit `.env` and add your credentials:\n   ```env\n   TODOIST_TOKEN='your_todoist_api_token'\n   OPENAI_KEY='your_openai_api_key'\n   HASH='your_hash_for_api_authentication'\n   CRON_SECRET='your_cron_secret_for_scheduled_jobs'\n\n   # Optional - customize project IDs\n   PROJECT_ID_INBOX='your_inbox_project_id'\n   PROJECT_ID_FOCUSED='your_focused_project_id'\n   PROJECT_ID_WORK='your_work_project_id'\n   ```\n\n## Getting Your API Keys\n\n### Todoist API Token\n1. Go to [Todoist Settings → Integrations](https://todoist.com/prefs/integrations)\n2. Scroll to \"API token\" section\n3. Copy your token\n\n### OpenAI API Key\n1. Visit [OpenAI API Keys](https://platform.openai.com/api-keys)\n2. Create a new secret key\n3. Copy and save it securely\n\n## Available API Endpoints\n\n### Public Endpoints\n\n| Endpoint | Description | Authentication |\n|----------|-------------|----------------|\n| `GET /` | API health check | None |\n| `GET /todos` | Get all todos | None |\n| `GET /todos/due` | Get todos that are due | None |\n| `GET /todos/summarize` | AI summary of your tasks | None |\n| `GET /api-docs` | Interactive API documentation | Hash (query param) |\n\n### Cron Job Endpoints (Require Bearer Token)\n\n| Endpoint | Description | Function |\n|----------|-------------|----------|\n| `GET /todos/process/reprioritize` | Increase urgency and cleanup | Auto-bumps old due tasks |\n| `GET /todos/process/stale` | Complete stale tasks | Completes tasks 250+ days old |\n| `GET /todos/process/new-day` | Reset daily focus | Moves focused tasks back to inbox |\n| `GET /todos/process/new-day-focus` | Set new focus | Selects top 5 priority tasks |\n| `GET /todos/process/categorize` | Auto-categorize tasks | Uses GPT-4 to label tasks |\n\n### Authentication\n\n**Hash Authentication** (for Swagger docs):\n```\nGET /api-docs?hash=your_hash_here\n```\n\n**Bearer Token** (for cron jobs):\n```bash\ncurl -H \"Authorization: Bearer your_cron_secret\" \\\n  https://api.mcclowes.com/todos/process/reprioritize\n```\n\n## Development\n\n**Run development server** (with hot reload):\n```bash\nnpm run dev\n```\n\n**Format code**:\n```bash\nnpm run format\n```\n\n**Run tests**:\n```bash\nnpm test\n```\n\n## Production Deployment\n\n### Vercel (Recommended)\n\nThis project is configured for Vercel deployment:\n\n1. Install Vercel CLI:\n   ```bash\n   npm i -g vercel\n   ```\n\n2. Deploy:\n   ```bash\n   vercel --prod\n   ```\n\n3. Set environment variables in Vercel dashboard\n\n### Manual Deployment\n\n```bash\nnpm run start\n```\n\n## Project Structure\n\n```\nmcclowes-apis/\n├── api/\n│   ├── todoist/\n│   │   ├── client.js       # Singleton Todoist API client\n│   │   ├── gpt.js          # OpenAI integration\n│   │   ├── index.js        # Main Todoist service\n│   │   └── utils.js        # Helper functions\n│   ├── errors/\n│   │   ├── AppError.js     # Custom error classes\n│   │   └── errorHandler.js # Express error middleware\n│   ├── middleware/\n│   │   └── validation.js   # Input validation\n│   └── docs/\n│       └── swagger.js      # API documentation\n├── index.js                # Express server setup\n├── package.json\n├── vercel.json\n└── .env.example\n```\n\n## Tech Stack\n\n**Runtime**: Node.js 18.x\n**Framework**: Express.js\n**APIs**:\n- Todoist API (@doist/todoist-api-typescript)\n- OpenAI API (GPT-3.5 Turbo, GPT-4)\n\n**Documentation**: Swagger/OpenAPI\n**Transpiler**: Babel\n**CI/CD**: CircleCI\n**Deployment**: Vercel\n\n## Environment Variables\n\n| Variable | Required | Description | Default |\n|----------|----------|-------------|---------|\n| `TODOIST_TOKEN` | Yes | Todoist API token | - |\n| `OPENAI_KEY` | Yes | OpenAI API key | - |\n| `HASH` | No | API authentication hash | - |\n| `CRON_SECRET` | No | Cron job Bearer token | - |\n| `PROJECT_ID_INBOX` | No | Inbox project ID | `2254468009` |\n| `PROJECT_ID_FOCUSED` | No | Focused project ID | `2299051453` |\n| `PROJECT_ID_WORK` | No | Work project ID | `2304777035` |\n| `PORT` | No | Server port | `3000` |\n\n## Recent Improvements\n\n- ✅ Updated all dependencies to latest stable versions\n- ✅ Replaced deprecated `@babel/polyfill` with `core-js` and `regenerator-runtime`\n- ✅ Removed unused `axios` and `uuid4` dependencies\n- ✅ Moved hardcoded project IDs to environment variables\n- ✅ Fixed duplicate TodoistApi client initialization (singleton pattern)\n- ✅ Updated CircleCI to Node 18.x\n- ✅ Added comprehensive input validation\n- ✅ Improved error handling and security\n\n## License\n\nISC\n\n## Author\n\n[mcclowes](https://github.com/mcclowes)\n\n## Issues\n\nReport issues at: https://github.com/mcclowes/what-the-fpl-api/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcclowes%2Fmcclowes-apis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcclowes%2Fmcclowes-apis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcclowes%2Fmcclowes-apis/lists"}